How do I use the ogr SetAttributeFilter
with uppercases?
Code example:
lyr = shp_obj.GetLayer()
sel_str = "%s = '%s'" % (field, value)
lyr.SetAttributeFilter(sel_str)
Can I just do:
sel_str = "UPPER(%s) = '%s'" % (field, value)
?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityHow do I use the ogr SetAttributeFilter
with uppercases?
Code example:
lyr = shp_obj.GetLayer()
sel_str = "%s = '%s'" % (field, value)
lyr.SetAttributeFilter(sel_str)
Can I just do:
sel_str = "UPPER(%s) = '%s'" % (field, value)
?
You don't need to according to the OGR SQL reference.
WHERE Limitations
...
All string comparisons are case insensitive except for <, >, <= and >=