problem with expression: null values in table

Umberto Nicoletti umberto.nicoletti at GMAIL.COM
Mon Oct 8 06:08:50 EDT 2007


Probably when the column is null it is evaluated by OGR to the empty
string and the expression (after replacing [HINDERCATEGORIE] with '')
becomes ' = 1' which is invalid.

Just a side note: starting with mapserver 5 the shapefile provider
will return 0 for null numeric columns and '' for null strings.

Umberto

On 10/8/07, Bart van den Eijnden <bartvde at gmail.com> wrote:
> Hi list,
>
> I am posting this problem here since I don't know if it is an OGR problem or
> a Mapserver problem.
>
> Using Mapserver 5.0 and GDAL 1.4.1 we have an Oracle table that only
> contains null values for an integer column called HINDERCATEGORIE.
>
> The expression used in Mapserver is:
>
> EXPRESSION ([HINDERCATEGORIE] = 1)
>
> which will result in:
>
> msEvalExpression: Expression parser error. Failed to parse expression:  = 1
>  msyyparse(): Expression parser error. parse error
>
> [bart at hades rwsnl]$ shp2img -m topografie.map -all_debug 10 -l
> vaarwegwerkzaamheid_live -o /tmp/bla.png
> msOGRFileOpen(vaarwegwerkzaamheid_live.ovf)...
> OGROPen(/data/OGC_UMN_services/rwsnl/./vaarwegwerkzaamheid_live.ovf)
> msyyparse(): Expression parser error. parse error
> msEvalExpression: Expression parser error. Failed to parse expression:  = 1
> msyyparse(): Expression parser error. parse error
> msEvalExpression: Expression parser error. Failed to parse expression:  = 1
> msyyparse(): Expression parser error. parse error
> msEvalExpression: Expression parser error. Failed to parse expression:  = 1
> msyyparse(): Expression parser error. parse error
> msEvalExpression: Expression parser error. Failed to parse expression:  = 1
> msyyparse(): Expression parser error. parse error
> msEvalExpression: Expression parser error. Failed to parse expression:  = 1
> msOGRLayerClose(vaarwegwerkzaamheid_live.ovf).
> msOGRFileClose(/data/OGC_UMN_services/rwsnl/./vaarwegwerkzaamheid_live.ovf,0).
> msDrawMap(): Layer 3 (vaarwegwerkzaamheid_live), 0.761s
> msDrawLabelCacheGD(): labelcache_map_edge_buffer = -10
> msDrawMap(): Drawing Label Cache, 0.005s
> msDrawMap() total time: 0.781s
>
> The layer definition is:
>
>   LAYER
>     NAME "vaarwegwerkzaamheid_live"
>     TYPE POINT
>     CONNECTIONTYPE OGR
>     CONNECTION "vaarwegwerkzaamheid_live.ovf"
>     DATA "vaarwegwerkzaamheid"
>     PROCESSING "CLOSE_CONNECTION=DEFER"
>     PROJECTION
>       "init=epsg:28992"
>     END
>     METADATA
>       "WMS_TITLE" "Vaarwegwerkzaamheden - staging omgeving"
>     END
>     CLASS
>       NAME "Unknown"
>       EXPRESSION ([HINDERCATEGORIE] = 1)
>       STYLE
>         ANGLE 360
>         COLOR 0 0 0
>         OPACITY 100
>         SYMBOL "wegwerkzaamheid_3"
>       END
>     END
>   END
>
> Best regards,
> Bart
>
>



More information about the mapserver-dev mailing list