I'm attempting to use QGIS to convert a GeoJSON to DXF. The problem is that the GeoJSON import is distorted, with the latitudes compressed. This isn't just a problem with the screen's aspect ratio: the distortion carries through to the DXF.

Here's a sample GeoJSON: http://geojson.io/#id=gist:nkoren/8c26a440d9dcff96872b7e7743821803&map=18/51.50123/-0.14192

And this is what it looks like when I import it as a vector layer QGIS 3.6:

Squashed GeoJSON import

My assumption is that this was a projection problem, however, both the layer and the document itself are WGS84, as is the GeoJSON, of course. I'm a QGIS novice, so is there another place that I should be looking?

  • 1
    Do they (project and geojson projection) have the same EPSG code? Even though they are both in WGS 84 the projection used could still be different.
    – gHupf
    Mar 25 '19 at 12:55
  • 1
    geojson.io displays it in a different CRS (Web Mercator, 3857). When you choose on-the-fly projection to 3857 in QGIS, it will look the same.
    – pLumo
    Mar 25 '19 at 13:07

The shape looks good.

There is a perceived visual distortion because you are displaying lat-long coordinates away from the equator.

The ground length, in meters, of a degree of longitude at the equator is not the same as ground length, in meters, of a degree of longitude a few cm away from the pole. To the contrary, the ground length of a degree of latitude is fairly constant wherever you are.

So, what looks like a perfect circle on the ground (the source data seen in 3857) is represented by an ellipse in 4326. Inversely, a perfect circle in 4326 will look like an ellipse on the ground (except at the equator)

  • Hm, using the measurement tool, I can see that the circle does indeed have the same dimension (or close enough) on both axes. However when I export this as DXF, it does not: the distortion is backed into the geometry. In reality, this is a circle on the ground, and it needs to still be circular as a DXF. How can I do that?
    – nkoren
    Mar 25 '19 at 16:26
  • I don't know about DXF. QGIS will compute the distances using the great circle arc, i.e. the true ground distance. If you measure in degrees (which is wrong), the X and Y sizes will be different (ex: 1 degree latitude * 0.75 degrees longitude)
    – JGH
    Mar 25 '19 at 17:08
  • Ah! That was a helpful clue! The DXF output is definitely distorted, with the dimensions of the circle being 0.0008 x 0.0005. Which is the difference in longitude and latitude, respectively. So the output is using Lon,Lat coordinates rather than true ground distance! ...Any idea how to fix this?
    – nkoren
    Mar 25 '19 at 17:36
  • 1
    When viewing the WGS84 DXF in a non CRS aware application eg CAD, measurement will be in degrees, and you're comparing apples with pears as @JGH has explained. Changing to a projected CRS when saving out the DXF from QGIS will result in the coordinate units being set to linear ones (typically metres). A projected CRS might be EPSG:3395 (World Mercator), or the appropriate UTM zone Mar 26 '19 at 9:36

This is a projection problem, but one of the absence of a projection!

As explained by @JGH, WGS84 uses degrees as its coordinate units, and the length of a degree of longitude on the ground decreases as you move from the equator to the poles.

Angular coordinates are great for measuring location on the curved surface of the earth, but QGIS is drawing its map on the flat surface of your monitor, and so makes the assumption that degrees of latitude and longitude have a constant and equal length. This might be reasonable near the equator, but as you move towards the poles, a degree of longitude reduces in length on the ground and so shapes appear squashed vertically, or more appropriately, stretched horizontally.

Choosing a projected coordinate system for the QGIS project will apply a different distortion to flatten the curved surface of the earth, EPSG:3857 (Web mercator) is an example of this, and the mercator projection has the property of conformality - that the shapes of small objects are not overly distorted. 3857 (or its GIS cousin EPSG:3395 World Mercator) will give a good indication of the true shape of the objects on the ground.

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.