0

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?

1
  • 3
    Please add the beginning of the output including one complete feature of ogrinfo -al test1.dxf
    – user30184
    Mar 21 at 15:08

1 Answer 1

1

A few thoughts come to mind. First, are you confident your source data is in EPSG:3006? Second, you said you tried skipping the projection change; do you mean you converted to .geojson and left the output coordinate system untouched? i.e. your resulting .geojson was EPSG:3006? If so, what happens if you then project your resulting .geojson from EPSG:3006 to EPSG:4326? Although adding a step, that may help you diagnose where the problem is occurring. i.e. if you still get wrong coordinates, I would suspect the coordinate system in the .dxf is misspecified or perhaps there's an AutoCAD block in the file or a similar artifact.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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