[mapserver-users] WFS Spatial Filter Problem

Bryan Hempen bhempen at sciops.esa.int
Tue Aug 9 05:14:36 EDT 2011


Dear Kai and Assefa,


After you two guys requested me to send you my setup, I exported the 
content in the databasetable to a shapefile so you can test it. When I 
tested the spatial filter right after that, it suddenly worked ! This 
narrows down the possibilities:

- The request I send is definitely not the problem anymore. It works 
with MapServer + shapefile and with GeoServer.

- I exported only the geometries to the shapefile in the table with 
geometrytype = POLYGON because from ~8000 geometries ~10 are 
linestrings. So I investigated possible problems with the linestring 
geometries by telling the MapServer not to serve them using a subquery 
in the mapfile:

DATA "the_geom from (select * from alldata where geometrytype(the_geom) 
= 'POLYGON') as subquery using unique product_id using SRID=4326"

Error 500 still occured. Therefore, the data can't be the problem 
neither, right?

- Since I didn't change anything else MapServer must have problems 
communicating with the PostGIS database, but why Error 500 then?

Here is my mapfile:


MAP
     NAME "WFS Server"
     STATUS ON
     SIZE 600 400
     SYMBOLSET "/var/www/html/psa/bhempen/mapservertest/symbols/symbols.sym"
     EXTENT -180 -90 180 90
     UNITS DD
     SHAPEPATH "/var/www/html/psa/bhempen/mapservertest/data/"
     IMAGECOLOR 255 255 255
     FONTSET "/var/www/html/psa/bhempen/mapservertest/fonts/fonts.list"
     MAXSIZE 4096 # needs to be set because otherwise an error will 
appear when rendering images on large screens


#IMAGECOLOR     200 200 200 #commented out for WFS

PROJECTION
        'init=epsg:4326'
END

     WEB
     TEMPLATE  '/var/www/html/psa/bhempen/mapservertest/template.html'
     IMAGEPATH '/var/www/html/psa/bhempen/tmp/'
     IMAGEURL  '/psa/bhempen/tmp/'
       METADATA
             "wfs_title"                  "WFS Demo Server for 
MapServer" ## REQUIRED
             "wfs_onlineresource"         
"http://localhost/cgi-bin/psa/mapserv?map=/home/bhempen/wfs.map&" ## 
Recommended
             "wfs_srs"                    "EPSG:4326" ## Recommended
             "wfs_abstract"               "This text describes my WFS 
service." ## Recommended
       END
     END

LAYER
     NAME   "omega"
     STATUS       DEFAULT
     TYPE         POLYGON
     METADATA
         "wfs_title"             "omega footprints" ##REQUIRED
         "wfs_srs"               "EPSG:4326" ## REQUIRED
        "gml_include_items"     "all" ## Optional (serves all attributes 
for layer)
         "gml_featureid"         "product_id" ## REQUIRED
     END
     PROJECTION
         "init=epsg:4326"
     END
     CONNECTIONTYPE POSTGIS
     CONNECTION "host=localhost port=xxx dbname=xxx user=xxx password=xxx"
     DATA "the_geom from alldata using unique product_id using SRID=4326"
     CLASS
         STYLE
             OUTLINECOLOR    125 0 0
         END
     END
     DUMP TRUE             ## REQUIRED
END # layer

END

Does anyone see a problem with the setup?

Many thanks to Kai and Assefa for the help so far! I am going to send 
you the shapefile (which you could import into the database with 
pgsql2shp), the mapfile, and my client.

Kind regards,
Bryan

================================================================================================
This message and any attachments are intended for the use of the addressee or addressees only. The unauthorised disclosure, 

use, dissemination or copying (either in whole or in part) of its content is not permitted. If you received this message in 

error, please notify the sender and delete it from your system. Emails can be altered and their integrity cannot be guaranteed by   

the sender. 

Please consider the environment before printing this email.
=================================================================================================

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110809/113ef6d9/attachment.html


More information about the mapserver-users mailing list