[mapserver-users] WFS getFeature Filter resulting in Internal Server Error
Hey! I have set up Mapserver to serve data from my PostGIS database through a WFS. I am using OpenLayers as a client. When I load my test page for the first time OpenLayers sends the following request: http://www.opengis.net/wfs"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd";> http://www.opengis.net/ogc";> the_geom http://www.opengis.net/gml"; srsName="EPSG:4326"> 135.45,-47.425 157.95,-36.175 I get a valid response and the data is properly displayed on the map. When, however, I try to use a spatial filter in the request, like this... http://www.opengis.net/wfs"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd";> http://mapserver.gis.umn.edu/mapserver"; typeName="ms:omega"> http://www.opengis.net/ogc";> the_geom http://www.opengis.net/gml"; srsName="EPSG:4326"> 142.28349609375,-40.5255859375 142.2615234375,-43.49189453125 148.1501953125,-44.15107421875 149.40263671875,-39.44892578125 142.28349609375,-40.5255859375 the_geom http://www.opengis.net/gml"; srsName="EPSG:4326"> 135.45,-47.425 157.95,-36.175 ... one of the two following things will happen: 1. I get a "Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request." The logfile says "Premature end of script headers: mapserv.exe, referer: http://localhost/";. 2. This is the response: http://www.opengis.net/wfs"; xmlns:ms="http://mapserver.gis.umn.edu/mapserver"; xmlns:gml="http://www.opengis.net/gml"; xmlns:ogc="http://www.opengis.net/ogc"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://mapserver.gis.umn.edu/mapserver http://localhost/cgi-bin/mapserv.exe?map=E:/ms4w/Apache/htdocs/mapservertest/wfs.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=ms:omega&OUTPUTFORMAT=XMLSCHEMA";> -1.00,-1.00 -1.00,-1.00 Which one of the two possibilities happens appears to be random. Any ideas? This is my mapfile : MAP NAME "WFS Server" STATUS ON SIZE 600 400 SYMBOLSET "E:\ms4w\Apache\htdocs\mapservertest\symbols\symbols.sym" EXTENT -180 -90 180 90 UNITS DD SHAPEPATH "E:\ms4w\Apache\htdocs\mapservertest\data\" IMAGECOLOR 255 255 255 FONTSET "E:\ms4w\Apache\htdocs\mapservertest\fonts\fonts.list" MAXSIZE 4096 #IMAGECOLOR 200 200 200 #commented out for WFS PROJECTION 'init=epsg:4326' END WEB TEMPLATE 'E:\ms4w\Apache\htdocs\mapservertest\template.html' IMAGEPATH 'E:\ms4w\Apache\htdocs\tmp\' IMAGEURL '/tmp/' METADATA "wfs_title" "WFS Demo Server for MapServer" ## REQUIRED "wfs_onlineresource" "http://localhost/cgi-bin/mapserv.exe?map=E:/ms4w/Apache/htdocs/mapservertest/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 LINE METADATA "wfs_title" "omega" ##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 "" DATA "the_geom from alldata using unique product_id using SRID=4326" CLASS STYLE OUTLINECOLOR125 0 0 END END DUMP TRUE ## REQUIRED END # layer END Thanks for your help. Cheers, Bryan ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] WFS Spatial Filter Problem
The problem: I am trying to implement something similar to http://openlayers.org/dev/examples/wfs-spatial-filter.html with my own data served by MapServer through a WFS. I just changed some lines in the code to make it work with MapServer, so the code is almost equal to the code in the example at the moment. So far it's working fine UNTIL I drag the polygon to apply the spatial filter! According to the getCapabitilies the server should be able to handle the request: ... ... Both WFS GetFeature requests are sent via HTTP POST. The first one that works (called on page load) looks like this: http://www.opengis.net/wfs"; xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd";> http://www .opengis.net/ogc"> msGeometry 135.45,-47.425 157.95,-36.175 The request not working looks like this: http://www.opengis.net/wfs"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd";> http://mapserver.gis.umn.edu/mapserver"; typeName="ms:omega"> http://www.opengis.net/ogc";> msGeometry http://www.opengis.net/gml"; srsName="EPSG:4326"> 145.72880866081,-40.709423872828 145.83867194206,-42.752880904078 148.34355475456,-40.995068404078 145.72880866081,-40.709423872828 msGeometry http://www.opengis.net/gml"; srsName="EPSG:4326"> 135.45,-47.40302734375 157.95,-36.15302734375 Does anyone have an idea? Any help is appreciated, I am stuck. The setup: * OS: Red Hat Enterprise Linux 5.4 * PostgreSQL 8.2 * PostGIS 1.3 * MapServer 5.6.5 * OpenLayers, one of the latest versions. ProxyHost set and working (calling the proxy.cgi shows OpenLayers website) 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. = ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WFS Spatial Filter Problem
Sorry, I forgot to mention the Error message: 500 Internal Server Error Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.2.3 (Red Hat) Server at localhost Port 80 Thanks, Bryan On 05/08/2011 13:02, Bryan Hempen wrote: The problem: I am trying to implement something similar to http://openlayers.org/dev/examples/wfs-spatial-filter.html with my own data served by MapServer through a WFS. I just changed some lines in the code to make it work with MapServer, so the code is almost equal to the code in the example at the moment. So far it's working fine UNTIL I drag the polygon to apply the spatial filter! According to the getCapabitilies the server should be able to handle the request: ... ... Both WFS GetFeature requests are sent via HTTP POST. The first one that works (called on page load) looks like this: http://www.opengis.net/wfs"; xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd";> http://www .opengis.net/ogc"> msGeometry 135.45,-47.425 157.95,-36.175 The request not working looks like this: http://www.opengis.net/wfs"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd";> http://mapserver.gis.umn.edu/mapserver"; typeName="ms:omega"> http://www.opengis.net/ogc";> msGeometry http://www.opengis.net/gml"; srsName="EPSG:4326"> 145.72880866081,-40.709423872828 145.83867194206,-42.752880904078 148.34355475456,-40.995068404078 145.72880866081,-40.709423872828 msGeometry http://www.opengis.net/gml"; srsName="EPSG:4326"> 135.45,-47.40302734375 157.95,-36.15302734375 Does anyone have an idea? Any help is appreciated, I am stuck. The setup: * OS: Red Hat Enterprise Linux 5.4 * PostgreSQL 8.2 * PostGIS 1.3 * MapServer 5.6.5 * OpenLayers, one of the latest versions. ProxyHost set and working (calling the proxy.cgi shows OpenLayers website) 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. = ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users 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. = ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WFS Spatial Filter Problem
Hi there! These are things that I've tried in the meantime: - Manually sending the request to the server, but without different results compared to using OpenLayers functions. Also trying to force the usage of the proxy.cgi by containing it in the URL, but didn't bring up different results. - Thought about the solution as suggested by the John, but substituting a Polygon with a BBOX only works for rectangular Polygons! I need to be able to specify arbitrary Polygons/Shapes. I am sure the solution proposed by him will work, because it will be just a request just like the one that already works. - Thought about trying a newer version of the MapServer. However, I run is the newest ms4w on my local machone and I remember that I had the same problem a few weeks ago. Furthermore, John had the same problem with MapServer 6.0.0, and since then nothing changed about WFS or filter encoding according to the release announcements. - Thought sending a GET request instead of a POST request could solve the problem! They provided examples in the documentation with links, something they definitely wouldn't have done in case those examples wouldn't work! However, even GET requests didn't work! What is strange: Also got errors with code 500. Shouldn't the mapserver return some error message? I AM CONFUSED! Please hlp! Regards, Bryan On 05/08/2011 15:04, John Callahan wrote: This thread may or may not help: http://osgeo-org.1803224.n2.nabble.com/WFS-intersect-request-td6458533.html I have not tried using AND compound filters. The following format does work for me using the BBOX filter. SHAPE http://www.opengis.net/gml"; srsName="EPSG:26957"> 149081.76574899518 163078.62572595105 205627.85303800018 194899.95291598293 - John *** John Callahan, Research Scientist Delaware Geological Survey University of Delaware URL: http://www.dgs.udel.edu 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. = ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WFS Spatial Filter Problem
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 OUTLINECOLOR125 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. = ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WFS Spatial Filter Problem
Hi again, Another thing I just noticed is that the getCapabilities doesn't list any logical operator: According to http://mapserver.org/ogc/filter_encoding.html#currently-supported-features the operators AND OR and NOT should be supported. Shouldn't they be listed then? Even in the example in the documentation they are not listed: http://mapserver.org/ogc/filter_encoding.html#server-side However, it seems that it doesn't make a difference at least in my case. The getCapabilities response is the same with a POSTGIS connection and with a shapefile (both containing the same data). 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. = ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WFS Spatial Filter Problem
Hi David, I enabled debugging using the following settings: CONFIG "MS_ERRORFILE" "/home/bhempen/ms_error.txt" DEBUG 5 CONFIG "CPL_DEBUG" "ON" CONFIG "PROJ_DEBUG" "ON" The only line that shows up after I got an error 500 using the spatial filter is: [Wed Aug 10 14:30:46 2011].451858 CGI Request 1 on process 21100 Not really helpful, right? Regards, Bryan On 09/08/2011 15:38, Fawcett, David (MPCA) wrote: Bryan, For testing, I would enable debugging at the MAP or LAYER level. If you set DEBUG 5, I think that you should be able to see the query that MapServer is crafting. More on debugging here: http://mapserver.org/optimization/debugging.html#debugging David. *From:*mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Bryan Hempen *Sent:* Tuesday, August 09, 2011 4:15 AM *Cc:* mapserver-users@lists.osgeo.org *Subject:* Re: [mapserver-users] WFS Spatial Filter Problem 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&"; <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 OUTLINECOLOR125 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 a
Re: [mapserver-users] WFS Spatial Filter Problem
Hi Daniel, thanks for your input. This, however, was the output of the ms_error.txt! Is there anything that can be concluded from that? Kind regards, Bryan On 10/08/2011 17:52, Daniel Morissette wrote: Looks like you checked the Apache error_log. With the config that you quoted, you should find the debug info in /home/bhempen/ms_error.txt. On 11-08-10 08:35 AM, Bryan Hempen wrote: Hi David, I enabled debugging using the following settings: CONFIG "MS_ERRORFILE" "/home/bhempen/ms_error.txt" DEBUG 5 CONFIG "CPL_DEBUG" "ON" CONFIG "PROJ_DEBUG" "ON" The only line that shows up after I got an error 500 using the spatial filter is: [Wed Aug 10 14:30:46 2011].451858 CGI Request 1 on process 21100 Not really helpful, right? Regards, Bryan On 09/08/2011 15:38, Fawcett, David (MPCA) wrote: Bryan, For testing, I would enable debugging at the MAP or LAYER level. If you set DEBUG 5, I think that you should be able to see the query that MapServer is crafting. More on debugging here: http://mapserver.org/optimization/debugging.html#debugging David. *From:*mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Bryan Hempen *Sent:* Tuesday, August 09, 2011 4:15 AM *Cc:* mapserver-users@lists.osgeo.org *Subject:* Re: [mapserver-users] WFS Spatial Filter Problem 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&"; <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 OUTLINECOLOR125 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 =
Re: AW: [mapserver-users] WFS Spatial Filter Problem
Hey guys, my current status report. I have tried the following list of things: - as proposed by Andreas, used shp2img. Works perfectly fine! - as proposed by Julien, took a look at the Apache error log. Here is a small excerpt of what it shows: [Wed Aug 17 10:42:15 2011] [error] [client 10.68.180.121] 3c3400-3c3403d000 r-xp fd:00 3123859 /usr/lib64/libldap_r-2.3.so.0 .2.31, referer: http://ssols02.esac.esa.int/psa/bhempen/tree.html ... [Wed Aug 17 10:42:15 2011] [error] [client 10.68.180.121] 3c34a1c000-3c34a1d000 rw-p 0001c000 fd:00 3118384 /usr/lib64/libgeos_c.so.1.6.2 , referer: http://ssols02.esac.esa.int/psa/bhempen/tree.html ... [Wed Aug 17 10:42:15 2011] [error] [client 10.68.180.121] Premature end of scrip t headers: mapserv, referer: http://ssols02.esac.esa.int/psa/bhempen/tree.html In case it could be useful to see the whole log, please just tell me. Now, to wrap things up again adding some new insights by testing with different versions of the MapServer. This is what happened: When I try to use the WFS FE Spatial Filter Intersect with MapServer 5.6.5 on a PostGIS layer, it doesn't work and I get an Error 500. When, however, I use a WFS FE Spatial Filter like Intersect with MapServer 5.6.5 on a shapefile layer with the SAME data as the PostGIS layer contains, it works! When I try to use the WFS FE Spatial Filter BBOX with MapServer 5.6.5 on a PostGIS layer, it works! When I use a WFS FE non-spatial filter like PropertyIsEqualTo and/or combined with logical filters like AND or OR combined with the WFS FE Spatial Filter BBOX with MapServer 5.6.5 on a shapefile layer or a PostGIS layer with the the SAME data, it works! When I try to use the WFS FE Spatial Filter Intersect with MapServer 6.0.1 on a PostGIS layer, sometimes no results are returned and sometimes only some. The results are not accurate. When I try to use the WFS FE Spatial Filter Intersect with MapServer 6.0.1 on a shapefile layer, sometimes no results are returned and sometimes only some. The results are not accurate. When I use a WFS FE non-spatial filter like PropertyIsEqualTo and/or combined with logical filters like AND or OR combined with the WFS FE Spatial Filter BBOX with MapServer 6.0.1 on a shapefile layer or a PostGIS layer with the the SAME data, it seems to work, but I am not 100% sure. Therefore: No problem with Apache setup, mapfiles, data, client/requests. Should be a MapServer bug... Using the same PostGIS db and shapefile all the time and mapfiles modified as minimal as possible. Kind regards, Bryan On 10/08/2011 15:16, Eichner, Andreas - SID-NLKM wrote: Hi, HTTP error code 500 means: Internal Server error and is usually reported when the (F)CGI process dies. Probably a simple NULL pointer dereference due to a missing check which results in a segmentation fault... Ever tried the thing with shp2img? If this also segfaults try recompiling with debug enabled and run it trough gdb. Greets. -Ursprüngliche Nachricht- Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Im Auftrag von Bryan Hempen Gesendet: Mittwoch, 10. August 2011 14:35 An: Fawcett, David (MPCA) Cc: mapserver-users@lists.osgeo.org Betreff: Re: [mapserver-users] WFS Spatial Filter Problem Hi David, I enabled debugging using the following settings: CONFIG "MS_ERRORFILE" "/home/bhempen/ms_error.txt" DEBUG 5 CONFIG "CPL_DEBUG" "ON" CONFIG "PROJ_DEBUG" "ON" The only line that shows up after I got an error 500 using the spatial filter is: [Wed Aug 10 14:30:46 2011].451858 CGI Request 1 on process 21100 Not really helpful, right? Regards, Bryan On 09/08/2011 15:38, Fawcett, David (MPCA) wrote: Bryan, For testing, I would enable debugging at the MAP or LAYER level. If you set DEBUG 5, I think that you should be able to see the query that MapServer is crafting. More on debugging here: http://mapserver.org/optimization/debugging.html#debugging David. From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Bryan Hempen Sent: Tuesday, August 09, 2011 4:15 AM Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] WFS Spatial Filter Problem 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
[mapserver-users] WCS GetCoverage responses in multi-part mime format
Hi there! I am currently setting up a WCS server using MapServer 5.6.5. I am serving hyperspectral images and my goal is to visualize a subset of bands within a BBOX in a webclient. This should work fine if WCS 1.1.0 GetCoverage requests would not return results in a multi-part mime format as stated on http://mapserver.org/ogc/wcs_server.html#getcoverage. Browsers can't seem to deal with this type of format. I can't use WCS 1.0.0 requests because they do not allow for subsetting of bands. Since I use MapServer version 5.6.5, WCS 2.0 is not supported, but if a WCS 2.0 (as supported by MapServer 6.x) also returns GetCoverage requests in a multi-part mime format it would be useless for me anyway. Is there any way to turn off the response of WCS GetCoverage requests in a multi-part mime format in MapServer? If I upgrade to WCS 2.0, will I still have the same problem? Or does anyone know how to make a browser visualize the image-part of the reponse? I can't find anything useful on the web. Thanks for your help, 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. = ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] template not showing map
Hi there! i have a problem diplaying nodes, which are read from a postgresql/postgis database. specifically the problem is that when trying to display the nodes using a pretty standard template i don not get a picture, but surprisingly it is generated in the tmp folder (with right timestamp). i am also able to show it via web when navigating to the tmp folder, so it might not be a problem of user rights. http://www.pictureupload.de/originals/pictures/181109204617_no_map_displayed.png shows what it looks like when viewing the template http://www.pictureupload.de/originals/pictures/181109204754_picture_generated.png but the picture is generated! Hopefully you guys can help me if i provide you with the mapfile and the template-sourcecode. please let me know if there is anything more you need me to provide you with. thanks for the help bryan hempen # WFS.MAP MAP NAME 'WFS-Server' IMAGETYPE PNG EXTENT8.01 52.2282 8.135 52.3109 #Osm-Koords. UNITS METERS DEBUG ON # SHAPEPATH 'C:/ms4w/Apache/htdocs/osnamap/data' SYMBOLSET '/home/sgraeule/public_html/mapserver/symbols/symbols.sym' FONTSET '/home/sgraeule/public_html/mapserver/fonts/fonts.list' IMAGECOLOR200 200 200 SIZE 500 500 # Grundeinstellungen- PROJECTION 'init=epsg:4326' END WEB TEMPLATE '/home/sgraeule/public_html/mapserver/template.html' IMAGEPATH '/home/sgraeule/public_html/tmp/' IMAGEURL '/tmp/' METADATA "WFS_TITLE" "WFS-Test" "WFS_SRS" "epsg:4326" "WFS_ABSTRACT" "POIS" "WFS_ONLINERESOURCE" "http://igf-project.igf.uni-osnabrueck.de/cgi-bin/mapserv?map=/home/sgraeule/public_html/mapserver/wfs.map"; END END LAYER SYMBOLSCALE 5 NAME 'punkt_db'# Layer-Name, der in OpenLayers aufgerufen wird TYPE POINT STATUS DEFAULT CONNECTIONTYPE postgis# Verbindung zur PostGIS-Datenbank CONNECTION "user=# password=# dbname=# host=localhost port=5432" DATA "geom from nodes" CLASSITEM'id' DUMP TRUE METADATA "WFS_TITLE" "geb" "WFS_SRS" "epsg:4326" # Festlegung des Koordinatensystems "gml_featureid" "id" "GML_INCLUDE_ITEMS" "all" END CLASS # Stil-Optionen; spielen fuer OpenLayers keine Rolle STYLE SYMBOL 'circle' SIZE 9 MINSIZE 9 MAXSIZE 15 COLOR 0 0 200 END END END END Beispiel zum UMN MapServer Beispiel: UMN MapServer href='http://www.umn-mapserver-community.de'>http://www.umn-mapserver-community.de href="/cgi-bin/mapserv?map=/home/sgraeule/public_html/mapserver/wfs.map">Ausgangszustand Möchten Sie "Browsen" oder eine Abfrage durchführen? checked>Browse value="query">Abfrage Zoom 4X hinein 2X hinein nein 2X heraus 4X heraus ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] template not showing map
Fawcett, David (MPCA) schrieb: Also, do you have an opening tag for your image? I just see the below line with only a closing tag for img: href='http://www.umn-mapserver-community.de'>http://www.umn-mapserver-community.de David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Bryan Hempen Sent: Wednesday, November 18, 2009 1:50 PM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] template not showing map Hi there! i have a problem diplaying nodes, which are read from a postgresql/postgis database. specifically the problem is that when trying to display the nodes using a pretty standard template i don not get a picture, but surprisingly it is generated in the tmp folder (with right timestamp). i am also able to show it via web when navigating to the tmp folder, so it might not be a problem of user rights. http://www.pictureupload.de/originals/pictures/181109204617_no_map_displayed.png shows what it looks like when viewing the template http://www.pictureupload.de/originals/pictures/181109204754_picture_generated.png but the picture is generated! Hopefully you guys can help me if i provide you with the mapfile and the template-sourcecode. please let me know if there is anything more you need me to provide you with. thanks for the help bryan hempen # WFS.MAP MAP NAME 'WFS-Server' IMAGETYPE PNG EXTENT8.01 52.2282 8.135 52.3109 #Osm-Koords. UNITS METERS DEBUG ON # SHAPEPATH 'C:/ms4w/Apache/htdocs/osnamap/data' SYMBOLSET '/home/sgraeule/public_html/mapserver/symbols/symbols.sym' FONTSET '/home/sgraeule/public_html/mapserver/fonts/fonts.list' IMAGECOLOR200 200 200 SIZE 500 500 # Grundeinstellungen- PROJECTION 'init=epsg:4326' END WEB TEMPLATE '/home/sgraeule/public_html/mapserver/template.html' IMAGEPATH '/home/sgraeule/public_html/tmp/' IMAGEURL '/tmp/' METADATA "WFS_TITLE" "WFS-Test" "WFS_SRS" "epsg:4326" "WFS_ABSTRACT" "POIS" "WFS_ONLINERESOURCE" "http://igf-project.igf.uni-osnabrueck.de/cgi-bin/mapserv?map=/home/sgraeule/public_html/mapserver/wfs.map"; END END LAYER SYMBOLSCALE 5 NAME 'punkt_db'# Layer-Name, der in OpenLayers aufgerufen wird TYPE POINT STATUS DEFAULT CONNECTIONTYPE postgis# Verbindung zur PostGIS-Datenbank CONNECTION "user=# password=# dbname=# host=localhost port=5432" DATA "geom from nodes" CLASSITEM'id' DUMP TRUE METADATA "WFS_TITLE" "geb" "WFS_SRS" "epsg:4326" # Festlegung des Koordinatensystems "gml_featureid" "id" "GML_INCLUDE_ITEMS" "all" END CLASS # Stil-Optionen; spielen fuer OpenLayers keine Rolle STYLE SYMBOL 'circle' SIZE 9 MINSIZE 9 MAXSIZE 15 COLOR 0 0 200 END END END END Beispiel zum UMN MapServer Beispiel: UMN MapServer href='http://www.umn-mapserver-community.de'>http://www.umn-mapserver-community.de href="/cgi-bin/mapserv?map=/home/sgraeule/public_html/mapserver/wfs.map">Ausgangszustand Möchten Sie "Browsen" oder eine Abfrage durchführen? checked>Browse value="query">Abfrage Zoom 4X hinein 2X hinein nein 2X heraus 4X heraus ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users hi! imagepath + imageurl are definately set right now, but it does not change anything. IMAGEPATH '/home/sgraeule/public_html/mapserver/tmp/' IMAGEURL '/home/sgraeule/public_html/mapserver/tmp/' you may want to take a look by yourself: http://igf-project.igf.uni-osnabrueck.de/~sgraeule/mapserver/tmp/ i am not sure about how to use the image-tag, so i added the following piece of code to the template. when executed umn mapserver correctly makes it src="/home/sgraeule/public_html/mapserver/tmp/WFS-Server12585768438242.png"> ,but my firefox still does not show the picture, but just a hint that there should be a picture which was not found... bryan ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Mapserver + KML-File Problem
hi there! i have trouble displaying point of interests from a KML file. i followed the description on http://mapserver.org/input/vector/kml.html http://igf-project.igf.uos.de/~bhempen/Gruenderlandkarte/ is where i want to display the data, the template is located at http://igf-project.igf.uos.de/~bhempen/Gruenderlandkarte/template.html this is the content of the mapfile: MAP NAME 'Gastronomapkarte' STATUS ON #EXTENT 3427065.20 5788323.53 3443999.37 5800691.66 #EXTENT 7.9189 52.2102 8.1716 52.3467 EXTENT 88 684 915000 686 IMAGECOLOR 255 255 255 SIZE 700 700 SYMBOLSET'symbols/symbols.sym' FONTSET 'fonts/fonts.list' WEB TEMPLATE 'template.html' IMAGEPATH '/home/bhempen/public_html/routingtest/tmp/' IMAGEURL '/~bhempen/routingtest/tmp/' METADATA 'WMS_TITLE' 'Firmen' 'WMS_FEATURE_INFO_MIME_TYPE' 'text/html' 'WMS_ONLINERESOURCE' 'http://igf-project.igf.uos.de/cgi-bin/mapserv?map=/home/bhempen/public_html/Gruenderlandkarte/Firmen.map' 'WMS_SRS' "EPSG:900913" END END PROJECTION 'init=epsg:900913' END LAYER NAME Firmen TYPE POINT STATUS DEFAULT CONNECTIONTYPE OGR CONNECTION "Firmen.kml" DATA "Firmen" LABELITEM "NAME" CLASS NAME "My Places" STYLE COLOR 0 255 0 OUTLINECOLOR 255 255 255 SYMBOL 'star' SIZE 10 END LABEL SIZE TINY COLOR 0 0 0 OUTLINECOLOR 255 255 255 POSITION AUTO END END END END idea anyone? ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Mapserver + KML-File Problem
hi there! i have trouble displaying point of interests from a KML file. i followed the description on http://mapserver.org/input/vector/kml.html http://igf-project.igf.uos.de/~bhempen/Gruenderlandkarte/ is where i want to display the data, the template is located at http://igf-project.igf.uos.de/~bhempen/Gruenderlandkarte/template.html this is the content of the mapfile: MAP NAME 'Gastronomapkarte' STATUS ON #EXTENT 3427065.20 5788323.53 3443999.37 5800691.66 #EXTENT 7.9189 52.2102 8.1716 52.3467 EXTENT 88 684 915000 686 IMAGECOLOR 255 255 255 SIZE 700 700 SYMBOLSET'symbols/symbols.sym' FONTSET 'fonts/fonts.list' WEB TEMPLATE 'template.html' IMAGEPATH '/home/bhempen/public_html/routingtest/tmp/' IMAGEURL '/~bhempen/routingtest/tmp/' METADATA 'WMS_TITLE' 'Firmen' 'WMS_FEATURE_INFO_MIME_TYPE' 'text/html' 'WMS_ONLINERESOURCE' 'http://igf-project.igf.uos.de/cgi-bin/mapserv?map=/home/bhempen/public_html/Gruenderlandkarte/Firmen.map' 'WMS_SRS' "EPSG:900913" END END PROJECTION 'init=epsg:900913' END LAYER NAME Firmen TYPE POINT STATUS DEFAULT CONNECTIONTYPE OGR CONNECTION "Firmen.kml" DATA "Firmen" LABELITEM "NAME" CLASS NAME "My Places" STYLE COLOR 0 255 0 OUTLINECOLOR 255 255 255 SYMBOL 'star' SIZE 10 END LABEL SIZE TINY COLOR 0 0 0 OUTLINECOLOR 255 255 255 POSITION AUTO END END END END idea anyone? thanks for the help. greets Bryan Hempen ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users