WFS 2.0.0 returns JSON coordinates as [y, x]
pieterprovoost opened this issue · comments
Pieter Provoost commented
mr_features_get
uses WFS 2.0.0 which will, despite the GeoJSON spec, return coordinates as [y, x]:
- http://docs.geoserver.org/stable/en/user/services/wfs/basics.html#axis-ordering
- https://osgeo-org.atlassian.net/browse/GEOS-2397
Perhaps add an option to use WFS 1.0.0?
Code example:
require(mregions)
require(wellknown)
require(jsonlite)
n <- mr_names("MarineRegions:eez")
id <- mr_names_search(n, "Belgian")$id[1]
jsonstr <- mr_features_get("MarineRegions:eez", id, format = "json")
json <- fromJSON(jsonstr, simplifyVector = FALSE, simplifyDataFrame = FALSE)
wkt <- geojson2wkt(json$features[[1]]$geometry)
WFS calls:
- http://geo.vliz.be/geoserver/MarineRegions/wfs?typeNames=MarineRegions:eez&featureID=eez.189&service=wfs&request=getFeature&version=2.0.0&outputFormat=json
- http://geo.vliz.be/geoserver/MarineRegions/wfs?typeNames=MarineRegions:eez&featureID=eez.189&service=wfs&request=getFeature&version=1.0.0&outputFormat=json
Scott Chamberlain commented
thanks @pieterprovoost for pointing this out! that's not good
Perhaps add an option to use WFS 1.0.0?
sounds good.
Scott Chamberlain commented
@pieterprovoost try again after reinstall