[OSM-dev] Some help with proj.4

Artem Pavlenko artem at mapnik.org
Sat Apr 7 09:27:05 BST 2007


Hi Andreas,


> Hello,
>
> I'm reading the OSM data from a postgis DB in my C++ application. I
> like to render the map with OpenGL. So I started with the city  
> names to
> get something displayed. My app reads some cities and coordinated from
> postgis:
>
> City: München
> lon: 11.5755230215163
> lat: 48.1372329809622
>
> City: Homburg/Saar
> lon: 7.34116847416298
> lat: 49.3216296092266
>
> City: Hanau
> lon: 8.91677718097002
> lat: 50.1335169934201
>
> City: Münster
> lon: 7.61953662105138
> lat: 51.9614481894247
> ....
>
> I like to transfor the lon/lat coordinated to a format (e.g. mercator
> projected) that I could draw in my OpenGL window.

You can draw geographic coordinates ( lat/lon) or projected  
coordinates ( e.g mercator) in OpenGL window.
You might find you'll need some concept of a viewport and scale those  
coordinates accordingly.
> I think proj.4 is a
> good way to do this. Now I try to understand the proj application
> before using the C API. But the input coordinates for proj look
> different:
>
> # coordinates for a few cities
> 45d15n 71d07w Boston, United States
> 40d40n 73d58w New York, United States
> 48d51n 2d20e Paris, France
> 51d30n 7’w London, England
>
> I'm a GIS beginner and don't really know what's the difference between
> this coordinate style and the lon/lat above. How could I transform my
> coordinates to this style?
>

This is just another notation for decimal longitude/latitude using  
degrees, minutes , seconds.
1 deg = 60 min
1 min = 60 sec ..

west, east, north, south would give you sign of an angle.

I don't know about you application but It is quite simple to write an  
OpenGL renderer for Mapnik in C++  and re-use projections  
transformations, styling , data access etc.  If you're interested I  
can help you to get started.

Cheers,
Artem

> regards
> Andreas
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

Artem Pavlenko
http://mapnik.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20070407/aa48fd0c/attachment.html>


More information about the dev mailing list