tiernanmartin/home-and-hope

Retain projection when writing to geojson

tiernanmartin opened this issue · 2 comments

Apparently, st_write(obj, dsn, driver = "GeoJSON") doesn't capture the crs of obj.

According to a blog post titled "More than you ever wanted to know about GeoJSON":

... you shouldn’t use the crs member or try to put projected data into GeoJSON: you should instead reproject it to WGS84 first.

The author references the Internet Engineering Task Force (IETF)'s GeoJSON format standard:

The coordinate reference system for all GeoJSON coordinates is a
geographic coordinate reference system, using the World Geodetic
System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
of decimal degrees.

The spatial data should be converted to ESPG:4326 prior to writing to GeoJSON (do in #41).

I added a post to the Tableau Community Forum asking for .gpkg to be added to the list of spatial data file formats.