[gdal-dev] RFC 32 - gdallocationinfo utility

Eli Adam EAdam at co.lincoln.or.us
Mon Nov 1 13:26:09 EDT 2010


     This is a helpful new utility.  

I read the documentation and tried it out.  Using gdallocationinfo to find the elevation at a given lat/long location seems like a reasonable use.  It may be desirable to input and output an ogr layer rather than a single point.  For instance, what are the elevations at these points in this shapefile?  

I tried to approach that problem by putting the coordinates into a file with ogrinfo and then use that file as an --optfile for the x y.  That didn't work the way that I tried it.  Can an --optfile be used for the x y input?  

ogrinfo town.shp town | grep 'POINT' | sed 's/  POINT (//' | sed 's/)//' > xyinput2.txt

head xyinput2.txt 
7350538.701077490113676 371057.403368594241329
7388905.153187953867018 357147.769300847954582
7346377.449287764728069 409114.138115067325998

gdallocationinfo -s_srs "EPSG:2913" townraster.tif --optfile xyinput2.txt 
Usage: gdallocationinfo [--help-general] [-xml] [-lifonly] [-valonly]
                        [-b band]* [-s_srs srs_def] [-geoloc] [-wgs84]
                        srcfile x y

What would be the proper approach to the above hypothetical problem?  Is there an effective way to have an ogr input for gdallocaitoninfo?  Perhaps -input_file_list my_liste.txt for the x y similar to gdalbuildvrt?

It looks like -s_srs applies to the x y input.  -s_srs sometimes, i.e. gdalwarp, applies to the srcfile.  

Is -wgs84 equivalent to -s_srs "EPSG:4326"?

These were my initial thoughts I hope that some of them may be helpful.

Thanks for the new utility, Eli

More information about the gdal-dev mailing list