Order of coordinates RDWGSConverter

RDWGSConverter.from_rd_to_wgs() expects a (x,y) tuple as input, but it gives (latitude, longitude), i.e. (y,x), as output. I know this is the default format of WGS, but for plotting using Shapely-geometries (which I expect most people use when plotting object in a MapView) the object requires a (x,y)-coordinate.

The x,y (longitude, latitude) order is also the default of the GeoJSON format. Perhaps an parameter can be added to the function so that it can output it in this format? E.g. from_rd_to_wgs(xy_order=True). Making it the default method would be even nicer.

Hi Martijn,

Thank you for contributing to the forum with this request. I have updated the category to be a Feature Request, rather than a Bug report as the current implementation is by design (but can of course be improved upon).

I have registered this request internally as well.

Out of interest, you mention that shapely and GeoJSON expect your proposed order of coordinates, do you know of other packages/services that use coordinates like this?

Hi Kevin,

Thanks! Shapely is used as dependency by many other packages, so for example GeoPandas also uses this order. Other packages that I know of are ArcPy (ArcGIS) and QGIS.

1 Like

It feels a bit overkill to have a keyword only to switch the order of the output. You can manually just use Python for that:

lat, lon = RDWGSConverter.from_rd_to_wgs((x, y))
use_lon_lat_here(lon, lat)