Skip to content
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

Axis order of response coordinates does not follow the requested CRS axis order #51

Closed
komima opened this issue Jul 14, 2023 · 4 comments

Comments

@komima
Copy link

komima commented Jul 14, 2023

With a collection like

{
  "id" : "jobs",
  "title" : "jobs",
  "description" : "jobs",
  "links" : [ ... ],
  "itemType" : "feature",
  "crs" : [ "http://www.opengis.net/def/crs/OGC/1.3/CRS84", "http://www.opengis.net/def/crs/EPSG/0/4326", "http://www.opengis.net/def/crs/EPSG/0/3903" ],
  "storageCrs" : "http://www.opengis.net/def/crs/EPSG/0/3903"
}

and requesting items with ?crs=http://www.opengis.net/def/crs/EPSG/0/3903 the axis order of the response is not reversed (has E,N), while the CRS has N,E.

There seems to be some confusion on the axis order that should be followed on the response (crs-based or always geojson-easting-northing), but the consensus seems to be on prior arragement: client must understand what it requests, and the response header Content-Crs defined in part 2 now "explicitly and unambiguously" defines the response coordinate contents => axis order follows crs.

geopython/pygeoapi#1174 (comment)
qgis/QGIS#52366 (comment)

This breaks hakunapi-based OAPIF layer use for example in QGIS (3.28.7+, 3.30.2+, 3.32.0+) where the implementation was changed to flip the order according to the crs.

@jampukka
Copy link
Collaborator

Thanks for raising the issue. We should move towards a model where hakunapi internally always forces XY-order and let both input and output formats act accordingly.

Something to discuss: should we use external information on the axis order of a certain CRS (for example geotools epsg-hsql) or require configuration for each crs (with sensible/configurable default)? We already do require users to configure available CRSes.

@jratike80
Copy link
Contributor

jratike80 commented Aug 11, 2023

Maybe JSON-FG makes this issue outdated, and GeoJSON gets reserved for CRS:84 while for any other crs the output should use JSON-FG. Who knows. The specification is not accepted yet, but GDAL-dev has a new driver for JSON-FG that can be used as reference implementation https://gdal.org/drivers/vector/jsonfg.html.

@jratike80
Copy link
Contributor

jratike80 commented Aug 11, 2023

I do not know how this hakunapi service is configured, but it does return the coordinates in northing-easting order for the Finnish GK zones.
https://avoin-paikkatieto.maanmittauslaitos.fi/kiinteisto-avoin/simple-features/v3/collections/PalstanSijaintitiedot/items?crs=http://www.opengis.net/def/crs/EPSG/0/3878

The service requires an API key, but anybody can get such from https://omatili.maanmittauslaitos.fi/user/new/avoimet-rajapintapalvelut?lang=en.

@jampukka
Copy link
Collaborator

#55 should fix this issue and is included in version 1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants