-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store information about planar vs spherical coordinates (eg geodesic=true/false) #9
Comments
A good summary of the problems we faced in R when switching to Cloud data warehouses seem like a case where the ability to communicate the intention of the dataset creator is particularly necessary given that more than one of them can create and consume geometries with geodesic edges. |
+1 |
Discussed on the call today. The majority favored a new field
|
@Jesus89 is working on this. |
Yes, I'm about to launch the PR. I have a comment about using 'spheroid' instead of 'ellipsoid'. |
This has come up in several places (eg most recently in #3 (comment)), and brought up in a previous meeting.
Geospatial analytical systems can interpret / treat geometries' coordinates as planar or spherical. For example GEOS considers everything as planar coordinates (and thus also GeoPandas, or R's
sf
or PostGIS when using GEOS). Other libraries can handle spherical coordinates, such R'ss2
package (which is now used as default insf
when having geographical coordinates) or BigQuery's Geography functionality (I think both based on Google'ss2geometry
). PostGIS also differentiates between a geometry and geography type.Once you deal with spherical coordinates, you also have to deal with the edges of geometries. A geometry can be valid (i.e. no intersecting edges) when interpreting the coordinates as planar, but could be invalid when interpreting the geometries as spherical.
And that's where the IO aspect comes into the picture. When reading in data (and working with spherical coordinates), you can either 1) assume the edges are already valid as spherical coordinates, or 2) do a conversion of planar edge to spherical edge.
For example, BigQuery assumes spherical edges when reading in from WKT (with the
planar=TRUE
option inST_GEOGFROMTEXT
to override this default), but planar edges when parsing GeoJSON (see https://cloud.google.com/bigquery/docs/geospatial-data#coordinate_systems_and_edges).Quoting @paleolimbot:
So it would be useful to store this information about the edges in the file metadata, instead of having the user of the data to know this and specify it as an option while reading the data.
The concrete proposal would be to have an additional column metadata field to indicate this. I think a boolean flag is fine for this, and possible names are
"geodesic": true/false
or"planar": true/false
.Note: I am no expert on this front (GeoPandas is, for now, still only using GEOS and thus planar coordinates, so I don't have much experience with handling spherical coordinates). So please correct me if anything in the above isn't fully correct :)
The text was updated successfully, but these errors were encountered: