2

I've imported some OSM data into a 3D application, but the coordinates seem to be slightly distorted in the longitude axis compared to the map rendering on the OSM website.

OSM Screenshot 3D App Screenshot

I've "translated" the Latitude and Longitude values into X/Z coordinates as is. Is there some special value that I need to multiply with the longitude value to get rid of the stretch?

2 Answers 2

4

You didn't mention how you "translated" lat/lon into x/y but I guess you are just using a different projection.

Raw OSM data is projected in EPSG:4326 aka WGS84. OSM's slippy map uses EPSG:3857 aka Web Mercator projection. The slippy map tilenames wiki page provides some additional information.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer. From what I gathered and with a little trial&error I figured dividing the longitude by PI / 2 yields pretty accurate results.
0

Thanks to scai!

The code to make Mercator projection from OpenStreetMaps:

local function mercatorY(lat)
    local radLat = math.rad(lat)
    return math.deg(math.log (math.tan(radLat) + 1/math.cos(radLat)))
end

Map: https://osm.org/go/0JAeZ7oTQ

osm right projection

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.