[gdal-dev] python: read pixel from raster

Paolo Corti pcorti at gmail.com
Wed Jan 12 13:04:58 EST 2011


2011/1/12 Sebastian E. Ovide <sebastian.ovide at gmail.com>:
> thanks for that...
> What I'm looking for is something like ReadRaster but using the coordinates
> system used by the raster... (it could be lat,long etc...)
> otherwise I would need to do something like
> cs=read_raster_coordinate_system()
> (x,y)= cs.convert_from_cs_to_pixel_xy(x,y)
> pixel=ReadRaster
> is there any single line command to do that ?

Hi Sebastian
what about using gdallocationinfo [0] (it is a new command line utility)?
You may run it directly or get inspiration from its code (in cpp, but
easily understandable for converting it in python)

best regards
P

[0] http://www.gdal.org/gdallocationinfo.html

-- 
Paolo Corti
GIS specialist and web developer
web: http://www.paolocorti.net
twitter: @paolo_corti


More information about the gdal-dev mailing list