简体   繁体   中英

Converting GML to GeoJSON using OGR results in a coordinate shift

I am attempting to convert the Index polygons spatial data (INSPIRE)s that the UK Land Registry provides free of charge. They are provided in GML format and the one referred to in this question is available at this link . A free account can be created to access the download.

I have used the following command line syntax on Ubuntu 20 which is using the latest available release of GDAL v3.3.2:

ogr2ogr -f geojson -s_srs EPSG:27700 -t_srs epsg:4326 output.json Land_Registry_Cadastral_Parcels.gml

The release notes warn that some conversions can result in a coordinate shift of up to fifteen metres and that is what I am experiencing. However, when I attempt the conversion using the desktop QGIS product (it uses GDAL 3.4.1) it performs the conversion accurately. The image below shows the two conversions:

Screen shot of both conversions

As I am not able to see the command that QGIS is performing is anyone able to tell me what I need to include in the command line directive?

After getting the above hint from Ian Turton I managed to put the following command together which seems to work:

ogr2ogr -f geojson -s_srs "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs +nadgrids=./ostn02_ntv2.gsb" -t_srs EPSG:4326 output.json Land_Registry_Cadastral_Parcels.gml

It requires 'ostn02_ntv2.gsb' which can be download from https://www.ordnancesurvey.co.uk/documents/resources/OSTN15-NTv2.zip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM