2

I want to convert DXF from AutoCAD to KML. It works but the coordinates don't come out right when I compare them to a KML produced with global_mapper and consequently it is shifted some when uploading the KML to Google Earth. Maybe someone can illustrate me how to set/calculate the parameters right to adjust the shift?

ogr2ogr -f KML -s_srs "+proj=utm +zone=30 +ellps=WGS84 +towgs84=-36.7193107889714,-4.418216852011938,0,0,0 +units=m +datum=WGS84 +no_defs " -t_srs epsg:25830 -dialect SQLite -sql "select * from entities where layer='SUPERFICIES  ZV'" SUPERFICIES_ZV.kml D02-32.dxf

Southern Spain ETRS89 30 EPSG:25830

2
  • Parameter -t_srs epsg:25830 does not make sense because KML is always in EPSG:4326 but perhaps GDAL just skips that part. Where have you found the +towgs84 parameters? Have you tried not to use them?
    – user30184
    Jun 20, 2019 at 19:32
  • of course. Changed it.
    – Karl
    Jun 21, 2019 at 8:51

1 Answer 1

0

It worked when I have edited the command

ogr2ogr -f KML -s_srs "+proj=utm +zone=30 +ellps=WGS84 +units=m +no_defs " -t_srs epsg:4326 -dialect SQLite -sql "select * from entities where layer='SUPERFICIES  ZV'" SUPERFICIES_ZV.kml D02-32.dxf

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.