[Mapserver-users] postgis & mapserver

Gernot Katzlberger knozi at gmx.at
Wed May 19 03:17:28 EDT 2004


hi list,
again I have some problems with mapserver and postgis:

the first data-statement works and I get a map back:

the_geom from 
(select gd_point_002.the_geom,gd_point_002.id,gd_point_002.oid,case 
when td_theme_temperature.m6 < 100 then 0 
when td_theme_temperature.m6 >= 100 and td_theme_temperature.m6 < 150 then 1

when td_theme_temperature.m6 >= 150 then 2 
end as myclass 
from gd_point_002,td_theme_temperature,td_dim_geom,td_dim_year 
where 
gd_point_002.id = td_dim_geom.id AND 
td_dim_geom.id = td_theme_temperature.geom AND 
td_dim_year.id = td_theme_temperature.year AND 
td_dim_year.id = 1990) as foo USING SRID=4326

with the next statement mapserver crashes (shp2img gives me a "segmentation
fault"), the only difference is that I want to make 4 instead of 3 classes:

the_geom from 
(select gd_point_002.the_geom,gd_point_002.id,gd_point_002.oid,case 
when td_theme_temperature.m6 < 100 then 0 
when td_theme_temperature.m6 >= 100 and td_theme_temperature.m6 < 150 then 1

when td_theme_temperature.m6 >= 150 and td_theme_temperature.m6 < 200 then 2

when td_theme_temperature.m6 >= 200 then 3 
end as myclass 
from gd_point_002,td_theme_temperature,td_dim_geom,td_dim_year 
where 
gd_point_002.id = td_dim_geom.id AND 
td_dim_geom.id = td_theme_temperature.geom AND 
td_dim_year.id = td_theme_temperature.year AND 
td_dim_year.id = 1990) as foo USING SRID=4326


Both sqls work in when I execute it in psql so I think it is a problem how
Mapserver accesses the database. At the end I added the layer which crashes.
i use mapserver_dev (13.2.2004) on suse linux.

any hints?

thanks, Gernot





LAYER
    CLASSITEM "myclass"
    CONNECTION "user=xxx password=yyy dbname=iso host=localhost"
    CONNECTIONTYPE POSTGIS
    DATA "the_geom from (select
gd_point_002.the_geom,gd_point_002.id,gd_point_002.oid,case when
td_theme_temperature.m6 < 100 then 0 when td_theme_temperature.m6 >= 100 and
td_theme_temperature.m6 < 150 then 1 when td_theme_temperature.m6 >= 150 and
td_theme_temperature.m6 < 200 then 2 when td_theme_temperature.m6 >= 200
then 3 end as myclass from
gd_point_002,td_theme_temperature,td_dim_geom,td_dim_year where
gd_point_002.id = td_dim_geom.id AND td_dim_geom.id =
td_theme_temperature.geom AND td_dim_year.id = td_theme_temperature.year AND
td_dim_year.id = 1990) as foo USING SRID=4326"
      METADATA
        "DESCRIPTION"	"NOAA Stations"
        "RESULT_FIELDS"	"id"
      END
    NAME "gd_point_002"
    STATUS ON
    TYPE POINT
    UNITS METERS
    
     CLASS
      NAME "name1"
      EXPRESSION "0"
      STYLE
          COLOR 241 238 246
          OUTLINECOLOR 0 0 0
        SIZE 10
        SYMBOL 1
      END
      TEMPLATE "xxx"
    END
    
    CLASS
      NAME "name2"
      EXPRESSION "1"
      STYLE
          COLOR 208 209 230
         OUTLINECOLOR 0 0 0
        SIZE 10
        SYMBOL 1
      END
      TEMPLATE "xxx"
    END
    
    CLASS
      NAME "name3"
      EXPRESSION "2"
      STYLE
          COLOR 116 169 207
          OUTLINECOLOR 0 0 0
        SIZE 10
        SYMBOL 1
      END
      TEMPLATE "xxx"
    END
    
    CLASS
      NAME "name4"
      EXPRESSION "3"
      STYLE
          COLOR 4 90 141
          OUTLINECOLOR 0 0 0
        SIZE 10
        SYMBOL 1
      END
      TEMPLATE "xxx"
    END
  END





More information about the mapserver-users mailing list