MakieOrg / GeoMakie.jl

Geographical plotting utilities for Makie.jl
https://geo.makie.org
MIT License
167 stars 24 forks source link

wrong coordinate transformation ? German lakes #168

Closed filchristou closed 8 months ago

filchristou commented 1 year ago

Hi, the following figure is supposed to produce the map of germany with the lakes.

let
    geoger = GeoJSON.read(read(Downloads.download("https://raw.githubusercontent.com/isellsoap/deutschlandGeoJSON/main/2_bundeslaender/4_niedrig.geo.json"), String))
    lakes = GeoJSON.read(read(Downloads.download("https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_lakes_europe.geojson"), String))

    fig = Figure()
    ga = GeoAxis(fig[1, 1]; dest = "+proj=merc", lonlims=(11, 13), latlims = (30, 44))

    poly!(ga, geoger; strokewidth = 1, color=:gold, rasterize = 5)
    poly!(ga, lakes; strokewidth = 1, color=:blue, rasterize = 5,  xautolimits=false, yautolimits=false)
    datalims!(ga)

    fig
end

image

However lakes are not like that in Germany: https://www.stepmap.de/landkarte/seen-in-deutschland-kItU9UMxoG-i image

Did I make a mistake somewhere, or is there a bug ?

asinghvi17 commented 1 year ago

There is a bug in the current implementation. That bug is, as I understand, that the aspect ratio of the scene is determined by the limits before the transformation (in lat/long space) and not after it. The big refactor for GeoMakie should fix all this...will see if there can be some kind of quick fix for this!

asinghvi17 commented 8 months ago

download-5 Latest version should fix this!

filchristou commented 3 months ago

How is this fixed ? In the documentation it's also wrong. https://geo.makie.org/v0.7.2/examples/german_lakes

asinghvi17 commented 3 months ago

Ah, just to confirm - is the error in the actual lake positions or the aspect ratio? The lake positions are probably fixable by using a better dataset but the aspect ratio was the main bug IMO.

filchristou commented 3 months ago

My main complain was the lake positioning. The dataset looks alright when github shows it https://github.com/nvkelso/natural-earth-vector/blob/master/geojson/ne_10m_lakes_europe.geojson

So I figured it was an issue on the GeoMakie side.

asinghvi17 commented 3 months ago

Ah, the dataset you linked to is not the dataset used in the example (which is really weird on reflection, I should change that to NaturalEarth). Looking at the one from the example I have no idea what it's actually showing 😅.