Closed jorisvandenbossche closed 1 month ago
Ah, and I see there is also an explicit Point constructor https://r-spatial.github.io/s2/reference/s2_geog_point.html, which is also using lng/lat order.
And bigquery seems to do the same: https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_geogpoint
lng/lat order is now used in geometry creation functions added in #51.
At the moment, the constructors use the lat/lng order convention from s2:
But then, as you can see above, the WKT repr uses lng/lat, because that is (AFAIK) generally how WKT (or WKB) is expected to be expressed.
However, that is quite confusing, because that means you can't just copy the coordinates from some WKT string to the constructor ..
I was checking with R's
s2
how they do that, but I don't directly see such explicit constructors from coordinates for a geography object. They do have an explicits2_lnglat
to create a S2LatLng object, and indeed they also use lng/lat order there, but because of the name of the function that is also directly clear.