Opened 14 years ago
Closed 14 years ago
#3734 closed task (invalid)
How do I find Image coordinates from projected coordinates
Reported by: | firani41 | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | 1.7.2 |
Severity: | normal | Keywords: | |
Cc: |
Description
I have point data listed in lat long for locations in my ERDAS image. I want to examine a window surrounding each of these points for particular pixel values.
How do I translate the lat long coords (WGS84) to pixel/line coordinates to use with GDAL RasterIO. ...or do I have to do this outside of GDAL? I see the utility to do this as a command; I wish I had the source code for this utility.
Note:
See TracTickets
for help on using tickets.
The mailing list was a more appropriate venue for this question.
Briefly, you would use the geotransform to convert a pixel/line location into the georeferencing system on the image, and then if that isn't WGS84 you would use the OGRCoordinateTransformation class to convert to wgs84. The OGRCoordinateTransformation has some tutorial material at:
I'm not sure what utility you are referring to, but the gdalinfo and gdaltransform utilities do similar things and their source code can be found in gdal/apps or at http://svn.osgeo.org/gdal/trunk/gdal/apps