Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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)

?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You don't need to according to the OGR SQL reference.

WHERE Limitations
...
All string comparisons are case insensitive except for <, >, <= and >=

share|improve this answer
    
I must have overseen this when I looked at the reference. Thanks mate. –  LarsVegas Jul 26 '13 at 8:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.