[Mapserver-users] Tricky bug with multiple styles for one class

Daniel FAIVRE daniel.faivre at camptocamp.com
Fri Feb 20 14:10:54 EST 2004


Hello,

Does anybody experienced similar bugs ?

> I've faced a tricky bug with some PostGIS layers and MapServer. I'm 
> using MapServer from CVS (040213), php mapscript, php 4.3.4, and 
> PostgreSQL 7.4 on a Debian woody.
>
> I've got a postgis layer with 50000 streets (no dump joined, see table 
> def at the end of this message). These layer is a MULTILINESTRING 
> layer, with simple and valids geometries with  1 as numgeometries  
> (all geometries are in fact simple LINESTRINGs).
>
> When I try to classify this layer as reported below, I get a bug 
> (Probably a MapServer one). Nothing is reported by PostGreSQL debug, 
> except a  "LOG:  08P01: unexpected EOF on client connection" ...
> Apache only report:  [Thu Feb 19 16:51:38 2004] [error] [client 
> 127.0.0.1] Premature end of script headers: /usr/lib/cgi-bin/php
>
> The bug seem to relate to multiple styles for one class.
>
> Here is a mapfile extraction, with comments about how to produce or 
> avoid the bug:
>
> LAYER                NAME "streets"
>  TYPE LINE
>  CONNECTIONTYPE postgis
>  CONNECTION "user=my_user_name dbname=my_db_name"
>  DATA "the_geom from streets"
>  STATUS ON
>  TRANSPARENCY 80
>  TEMPLATE "ttt"
>  HEADER "link_id st_name"   CLASSITEM "route_type"
>  CLASS
>    EXPRESSION /[123]/
>    NAME "Routes principales"    STYLE
>      COLOR 64 0 0
>      SYMBOL "line1"
>      SIZE 5      END
>    STYLE
>      COLOR 255 196 0
>      SYMBOL "line2"
>      SIZE 3      END      LABEL
>      ANTIALIAS true
>      ANGLE AUTO
>      FONT verdana
>      MINDISTANCE 1
>      BUFFER 20
>      TYPE truetype
>      COLOR 0 0 0
>      OUTLINECOLOR 255 255 255
>      SIZE 6
>      MINSIZE 6
>      MAXSIZE 10
>      POSITION auto
>    END     END
>  CLASS
>    EXPRESSION "4"
>    NAME "Routes secondaires"    STYLE
>      COLOR 64 0 0
>      SYMBOL "line1"
>      SIZE 4      END
>    STYLE
>      COLOR 255 64 0
>      SYMBOL "line2"
>      SIZE 2      END
>    LABEL
>      ANTIALIAS true
>      ANGLE AUTO
>      FONT verdana
>      MINDISTANCE 1
>      BUFFER 20
>      TYPE truetype
>      COLOR 0 0 0
>      OUTLINECOLOR 255 255 255          SIZE 6
>      MINSIZE 6
>      MAXSIZE 8
>      POSITION auto
>    END     END
>  CLASS
>    NAME "Autres"
>    EXPRESSION /[95]/
>    STYLE
>      COLOR 96 96 96
>      SYMBOL "line1"
>      SIZE 2      END
> #    STYLE                # second style commented to avoid the bug 
> with type 9: no bug with this part commented
> #      COLOR 64 255 0
> #      SYMBOL "line2"
> #      SIZE 1   #    END
>  END    TOLERANCE 5
>  TOLERANCEUNITS pixels
> END
>
> When the commented part is uncommented, the bug happens. In this case, 
> when  EXPRESSION /[95]/ is replaced by EXPRESSION /5/, no bug happens ...
> Furthermore, when I start my application with the commented part, make 
> a zoom, and a query, I can uncomment this style part aned refresh my 
> page without a bug !
>
> I've search about something related to my data set, but I could not 
> have found anything. All my MULTILINESTRING GEOMETRIES are simples, 
> valid, and report 1 as numgeometries ...
>
> Does anybody see any hint ? Is it really a MapServer bug related to 
> multiple styles on the same line ?
>
> Best regards,
> Daniel FAIVRE
>
> Here is my very simple table def:
>
> CREATE TABLE public.streets
> (
>  link_id int8,
>  st_name varchar,
>  route_type varchar,
>  the_geom public.geometry,
>  CONSTRAINT "$1" CHECK srid(the_geom) = -1,
>  CONSTRAINT "$2" CHECK geometrytype(the_geom) = 
> 'MULTILINESTRING'::text OR the_geom IS NULL
> ) WITH OIDS;





More information about the mapserver-users mailing list