[FWTools] sql string functions for shapefiles in ogrinfo

Bryan Keith bryan at geomega.com
Thu Jan 11 18:22:27 EST 2007


I can use this command and get the output I expect from a shapefile:

ogrinfo "myfile.shp" -al -sql "select * from 'myfile' where ID = 'SB-18'"

However, what if I want all records where ID starts with 'SB'?  If I 
tried left, substr and others e.g.:

where left(ID,2) = 'SB'

I assume if you're using a db like PostGIS then the sql is parsed by the 
db, and you can read the db documentation for the sql syntax.  Which sql 
syntax reference should I be using for shapefiles?


More information about the FWTools mailing list