AW: [mapserver-users] WFS Spatial Filter Problem

2011-08-10 Thread Eichner, Andreas - SID-NLKM

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 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.ma
> p&" 
>  p&>  ## 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
>   P

Re: AW: [mapserver-users] WFS Spatial Filter Problem

2011-08-17 Thread Bryan Hempen

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 to the shapefile in
the table with geometrytype = POLYGON because fro

AW: AW: [mapserver-users] WFS Spatial Filter Problem

2011-08-17 Thread Eichner, Andreas - SID-NLKM

OK, now run the CGI on the command line and append the QUERY_STRING parameter 
carrying the request parameters:

$ /usr/lib/cgi-bin/mapserv 
QUERY_STRING='map=&service=WFS&request=GetCapabilities'

This should give you the capabilities document. If that works use your failing 
one. This should expectedly fail. If you can't guess right now what causes the 
crash you can now use gdb to locate the error if you compiled with the debug 
option enabled. Let us know when you find more detailes about the cause.

Regards


> -Ursprüngliche Nachricht-
> Von: Bryan Hempen [mailto:bhem...@sciops.esa.int] 
> Gesendet: Mittwoch, 17. August 2011 11:55
> An: Eichner, Andreas - SID-NLKM
> Cc: mapserver-users@lists.osgeo.org
> Betreff: 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"
> >>