2

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

Verve Innovation
  • 2,006
  • 6
  • 29
  • 48
  • Could've just Googled it : http://www.google.co.in/search?q=convert+lat+long+to+x+y&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a Whether it's available in QT I don't know. Maybe someone with QT experience could help you. Or, just Google it! – Nav Feb 03 '11 at 06:08
  • @Nav - So long as they aren't duplicates, asking even 'easy' questions on SO helps people with the same problem find a great answer. Sometimes, it's hard to figure out what to search _for_ :) – Tim Post Feb 03 '11 at 07:14

3 Answers3

2

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.

xcramps
  • 1,203
  • 1
  • 9
  • 9
1

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.

Ariya Hidayat
  • 12,523
  • 3
  • 46
  • 39
0

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

Thanks

Community
  • 1
  • 1
Verve Innovation
  • 2,006
  • 6
  • 29
  • 48