Skip to main content
1 of 3
Ms01
  • 103
  • 3

DXF to GeoJSON conversion gets coordinates completely wrong?

I am using GDAL and the ogr2ogr tool in order to convert a file from a dxf to geojson but at the same time convert the coordinates to another CRS, from Sweref 99TM to WGS84.

The issue I am facing is that the coordinates gets very wacky when the projection is being changed.

I am using this command: ogr2ogr -f GeoJSON -s_srs EPSG:3006 -t_srs EPSG:4326 test1.geojson test1.dxf

All the coordinates is something like: geometry": { "type": "Point", "coordinates": [ 62.30984294549225, 3.52484086442923, 0.0 ] } when in reality the 3 should be 16-something and the first one isn't correct either.

What could be wrong here? I get that it isn't much to go on, but the files are pretty big and I've manually gone through some of the conversion of coordinates if I skip the projection change and that looks as expected.

Is there something wrong with the dxf or my command, or is there something wrong in the actual projection change?

Thanks for answers!

Ms01
  • 103
  • 3