tiernanmartin / home-and-hope

A data set of suitable sites for the development of affordable housing and/or early learning centers in King County, Washington
https://tiernanmartin.github.io/home-and-hope/2-communication/3-bookdown/_book/index.html
MIT License
3 stars 0 forks source link

Retain projection when writing to geojson #39

Closed tiernanmartin closed 6 years ago

tiernanmartin commented 6 years ago

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

tiernanmartin commented 6 years ago

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).

tiernanmartin commented 6 years ago

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