[gdal-dev] (no subject)
Jukka Rahkonen
jukka.rahkonen at mmmtike.fi
Wed Sep 11 00:50:18 PDT 2013
Ahmet Temiz <ahmettemiz88 <at> gmail.com> writes:
>
>
> hello
>
> can you tell me what is wrong with following expression:
> (most likely regular expression)
>
> ogr2ogr -where "DETAY!='YRD_MUNHANI' or DETAY!='PAFTA_KENARI' or
DETAY!='KIYI'" dene.shp h22a1top.shp
Hi,
Nothing wrong really, but because you use "OR" you will select everything
and that is probably not what you expect. I suppose your aim is to select
all features except these three: YRD_MUNHANI, PAFTA_KENARI, and KIYI.
DETAY=YRD_MUNHANI will be rejected by the first clause, but because it is
not PAFTA_KENARI it will be reselected by the next clause. Try with ANDs.
This is more understandable to read and seems to work also
ogrinfo -where "DETAY not in ('YRD_MUNHANI','PAFTA_KENARI')" wheretest.shp -al
If things go more complicated, use -sql instead of -where. If you select
also to use SQLite dialect by adding -dialect sqlite you can use standard
ANSI SQL.
-Jukka Rahkonen-
More information about the gdal-dev
mailing list