[OSGeo-Discuss] How to convert lat/lon to x/y (in pixels) for a given GeoTiff file

Alex Mandel tech_dev at wildintellect.com
Sun Oct 19 18:53:08 EDT 2008


Bogdan Florin Paul wrote:
> Hello all,
> 
> I'm a Geo newbie working on a weather project using a lot of epsg:900913 country maps in GTiff format.
> 
> These country maps will be converted to jpg and will be used as static background images for doing javascript-powered weather maps.
> 
> I am trying to find a way to translate the lists of geodetic lat/lon points (ICAO stations for each country) to x/y coordinates for the relevant country map.
> 
> Could you suggest a software tool for that purpose?
> 
> The original maps were WGS84 Equirectangular and it was very easy to get x/y pixel coordinates from lat/lon, but the maps were too elongated, so I translated them with gdalwarp to epsg:900913, and this is were I get lost.
> 
> Any suggestion would be higly appreciated...
> 

If you used Openlayers js library for the map display you could limit
the map to the each image and wouldn't need to convert any of the data
as openlayers understands projected data.

Otherwise for a given background image you would need export the points
in that frame either as an image, or with a fake projection putting the
corner of the background image as 0,0 (lower left I think).

Alex





More information about the Discuss mailing list