I have a shapefile to be imported to db. in QGIS 3.8 the following worked:

ogr2ogr -f ....... -t_srs "+proj=latlong +datum=WGS84 +axis=neu +wktext"

but with the latest QGIS 3.20 coordinates are in the wrong order:
'POLYGON((8.62661151165165 46.8970840194569....' instead of 'POLYGON((46.8970840194569 8.62661151165165...'

What do I miss?

  • 1
    It may be related to this GDAL change (read carefully): gdal.org/tutorials/osr_api_tut.html#crs-and-axis-order Sep 21 at 15:20
  • try with -t_srs epsg:4326
    – Ian Turton
    Sep 21 at 16:06
  • What is the EPSG code of the source CRS? Give one coordinate pair in the source system. What is to target database? How did you generate the WKT for the polygon?
    – user30184
    Sep 21 at 16:33
  • This is what in QGIS 3.8 worked: ogr2ogr -f MySQL MySQL:name,host=name,user=username,password=pwd name.shp -nln dbname -update -append -lco engine=MYISAM -skipfailures -t_srs "+proj=latlong +datum=WGS84 +axis=neu +wktext" i had to update to QGIS 3.20 because now i need engine=INNODB the EPSG of the source is 2056
    – Martini
    Sep 21 at 17:11
  • 1
    INNODB does not seem to be documented gdal.org/drivers/vector/mysql.html. Have you tried +axis=enu?
    – user30184
    Sep 21 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.