Verve Innovation
Verve Innovation

Reputation: 2096

formula to convert Lat and Long to x & Y in an Image

HI

I have a Map Image that I got from OpenstreetMap(Osmarender Image ) .My question is

how to convert geographic coordinates to the co-ordinates of my picture (that is in pixels on X and Y on a picture). That is I receive geographic coordinates and it is necessary for me to draw this point on my picture.

Is there any API availabel in QT for processing this type of Map Problem

Upvotes: 2

Views: 5111

Answers (3)

Verve Innovation
Verve Innovation

Reputation: 2096

The Answer I was expecting can be found at Convert Lat/Longs to X/Y Co-ordinates

Thanks

Upvotes: 0

Ariya Hidayat
Ariya Hidayat

Reputation: 12561

Check the code for my mapsnap example, in particular MapModel::draw() function. If you know the zoom level of the OpenStreetMap rendered image and the tile offset, it is a matter of implementing the slippy map tile approach.

Upvotes: 1

xcramps
xcramps

Reputation: 1213

Check out the Proj4 library. You need to map the lat-longs to an XY coordinate system (e.g. UTM) and then map this to pixel space. Don't think Qt has anything like this.

Upvotes: 2

Related Questions