Opened 19 years ago
Closed 19 years ago
#1424 closed defect (worksforme)
GetFeature request with 2 queries both using a Filter crashes Mapserver
Reported by: | Owned by: | mapserverbugs | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | WFS Server | Version: | 4.6 |
Severity: | normal | Keywords: | |
Cc: |
Description
The following request worked with Mapserver 4.6 beta1 but crashes Mapserver 4.6 release (internal server error): <GetFeature maxfeatures="100" service="WFS" version="1.0.0" xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0 WFS-basic.xsd"> <Query xmlns="" typename="bisrapport_vlak"><ogc:Filter><ogc:DWithin><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Polygon srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>104030.047950,498012.127900 104030.263050,498036.333900 104055.456000,498041.950000 104056.623000,498042.210050 104056.669950,498041.993050 104059.873950,498027.176150 104061.607050,498019.162900 104030.047950,498012.127900 </gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon><ogc:Distance units="m">0.01</ogc:Distance></ogc:DWithin></ogc:Filter></Query> <Query xmlns="" typename="bislocatie"><ogc:Filter><ogc:DWithin><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Polygon srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>104030.047950,498012.127900 104030.263050,498036.333900 104055.456000,498041.950000 104056.623000,498042.210050 104056.669950,498041.993050 104059.873950,498027.176150 104061.607050,498019.162900 104030.047950,498012.127900 </gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon><ogc:Distance units="m">0.01</ogc:Distance></ogc:DWithin></ogc:Filter></Query> </GetFeature> Python script to POST: import httplib, urllib, string, base64, time # 1) set variable for request to be posted request=""" <GetFeature maxfeatures="100" service="WFS" version="1.0.0" xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0 WFS-basic.xsd"> <Query xmlns="" typename="bisrapport_vlak"><ogc:Filter><ogc:DWithin><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Polygon srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>104030.047950,498012.127900 104030.263050,498036.333900 104055.456000,498041.950000 104056.623000,498042.210050 104056.669950,498041.993050 104059.873950,498027.176150 104061.607050,498019.162900 104030.047950,498012.127900 </gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon><ogc:Distance units="m">0.01</ogc:Distance></ogc:DWithin></ogc:Filter></Query> <Query xmlns="" typename="bislocatie"><ogc:Filter><ogc:DWithin><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Polygon srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>104030.047950,498012.127900 104030.263050,498036.333900 104055.456000,498041.950000 104056.623000,498042.210050 104056.669950,498041.993050 104059.873950,498027.176150 104061.607050,498019.162900 104030.047950,498012.127900 </gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon><ogc:Distance units="m">0.01</ogc:Distance></ogc:DWithin></ogc:Filter></Query> </GetFeature> """ # 2) set WFS servername and hostname # productie server="/cgi-bin/copy1705/mapserv.exe?map=/ms4w/apps/stragisweb/htdocs/sites/ijmond/map/stragisweb.map&service=WFS&version=1.0.0" hostname="localhost:8080" # 3) execute the request h = httplib.HTTP(hostname) h.putrequest("POST", server) h.putheader("Content-type", "text/xml") h.putheader("Content-length", "%d" % len(request)) h.putheader("Accept", "text/xml") h.putheader('Host', hostname) h.endheaders() h.send(request) reply, msg, hdrs = h.getreply() # 4) print the response print h.getfile().read()
Attachments (1)
Change History (6)
comment:2 by , 19 years ago
Cc: | added |
---|
Assefa, did you have time to look at this one already? It can be fixed on our support contract, but please do let me know before if it will be more than 1 or 2 hours.
comment:4 by , 19 years ago
I have tried the following using the data/map provided and both mapserver cvs and mapserver 4.6.0 release: get request using 2 typnames and 2 filters : http://127.0.0.1/cgi- bin/mapserv.exe? map=d:/msapps/tmp/bug1424/test.map&service=wfs&version=1.0.0&request=GetFeature &typename=bisrapport_vlak,bislocatie&Filter= (<ogc:Filter><ogc:DWithin><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:P olygon srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1040 30.047950,498012.127900 104030.263050,498036.333900 104055.456000,498041.950000 104056.623000,498042.210050 104056.669950,498041.993050 104059.873950,498027.176150 104061.607050,498019.162900 104030.047950,498012.127900</gml:coordinates></gml:LinearRing></gml:outerBounda ryIs></gml:Polygon><ogc:Distance units="m">0.01</ogc:Distance></ogc:DWithin></ogc:Filter>) (<ogc:Filter><ogc:DWithin><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:P olygon srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1040 30.047950,498012.127900 104030.263050,498036.333900 104055.456000,498041.950000 104056.623000,498042.210050 104056.669950,498041.993050 104059.873950,498027.176150 104061.607050,498019.162900 104030.047950,498012.127900</gml:coordinates></gml:LinearRing></gml:outerBounda ryIs></gml:Polygon><ogc:Distance units="m">0.01</ogc:Distance></ogc:DWithin></ogc:Filter>) and a post request using php curl : dl("php_curl.dll"); $url = "http://127.0.0.1/cgi-bin/mapserv.exe? map=d:/msapps/tmp/bug1424/test.map"; $host = "localhost"; $request = '<GetFeature maxfeatures="100" service="WFS" version="1.0.0" xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0 WFS-basic.xsd"> <Query xmlns="" typename="bisrapport_vlak"><ogc:Filter><ogc:DWithin><ogc:PropertyName>msGeometr y</ogc:PropertyName><gml:Polygon srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1040 30.047950,498012.127900 104030.263050,498036.333900 104055.456000,498041.950000 104056.623000,498042.210050 104056.669950,498041.993050 104059.873950,498027.176150 104061.607050,498019.162900 104030.047950,498012.127900</gml:coordinates></gml:LinearRing></gml:outerBounda ryIs></gml:Polygon><ogc:Distance units="m">0.01</ogc:Distance></ogc:DWithin></ogc:Filter></Query><Query xmlns="" typename="bislocatie"><ogc:Filter><ogc:DWithin><ogc:PropertyName>msGeometry</og c:PropertyName><gml:Polygon srsName="EPSG:28992"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1040 30.047950,498012.127900 104030.263050,498036.333900 104055.456000,498041.950000 104056.623000,498042.210050 104056.669950,498041.993050 104059.873950,498027.176150 104061.607050,498019.162900 104030.047950,498012.127900</gml:coordinates></gml:LinearRing></gml:outerBounda ryIs></gml:Polygon><ogc:Distance units="m">0.01</ogc:Distance></ogc:DWithin></ogc:Filter></Query></GetFeature>'; $header[] = "Host: $host"; $header[] = "MIME-Version: 1.0"; $header[] = "Content-type: multipart/mixed; boundary=----doc"; $header[] = "Accept: text/xml"; $header[] = "Content-length: ".strlen($request); $header[] = "Cache-Control: no-cache"; $header[] = "Connection: close \r\n"; $header[] = $request; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_CUSTOMREQUEST,'POST'); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); $data = curl_exec($ch); if (curl_errno($ch)) { print curl_error($ch); } else { curl_close($ch); echo $data; } In both cases I can't reproduce the crash and I get a valid return which is something like : <?xml version='1.0' encoding="ISO-8859-1" ?> <wfs:FeatureCollection xmlns:stragisweb="http://www.syncera.nl/stragisweb" xmlns:wfs="http://www.opengis.net/wfs" 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.cubewerx.com/schemas//wfs/1.0.0/WFS-basic.xsd http://www.syncera.nl/stragisweb http://localhost:8080/stragisweb/cgi-bin/mapserv.exe? map=/ms4w/apps/stragisweb/htdocs/sites/ijmond/map/stragisweb.map&SERVICE=WF S&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=bisrapport_vla k,bislocatie&OUTPUTFORMAT=XMLSCHEMA"> <gml:boundedBy> <gml:Box srsName="EPSG:28992"> <gml:coordinates>103752.446000,497980.614000 104133.426000,498160.249500</gml:coordinates> </gml:Box> </gml:boundedBy> <gml:featureMember> <stragisweb:bisrapport_vlak> <gml:boundedBy> <gml:Box srsName="EPSG:28992"> <gml:coordinates>104035.942500,498008.096500 104062.895500,498055.753000</gml:coordinates> </gml:Box> </gml:boundedBy> <stragisweb:msGeometry> <gml:Polygon srsName="EPSG:28992"> <gml:outerBoundaryIs> <gml:LinearRing> <gml:coordinates>104035.942500,498052.237000 104045.708000,498008.096500 104062.895500,498012.198500 104053.130000,498055.753000 104035.942500,498052.237000 </gml:coordinates> </gml:LinearRing> </gml:outerBoundaryIs> </gml:Polygon> </stragisweb:msGeometry> <stragisweb:Rap_code>AA045301551</stragisweb:Rap_code> <stragisweb:Xcoord> 104049.419000000</stragisweb:Xcoord> <stragisweb:Ycoord> 498031.925121976</stragisweb:Ycoord> <stragisweb:Kwaliteit></stragisweb:Kwaliteit> </stragisweb:bisrapport_vlak> </gml:featureMember> <gml:featureMember> <stragisweb:bislocatie> <gml:boundedBy> <gml:Box srsName="EPSG:28992"> <gml:coordinates>103752.446000,497980.614000 104133.426000,498160.249500</gml:coordinates> </gml:Box> </gml:boundedBy> <stragisweb:msGeometry> <gml:MultiPolygon srsName="EPSG:28992"> <gml:polygonMember> <gml:Polygon> <gml:outerBoundaryIs> <gml:LinearRing> <gml:coordinates>104027.825500,497994.997000 104026.217500,498067.766000 103819.984000,498069.195000 103778.577000,498078.047000 103821.701000,498160.249500 103825.428000,498160.239000 104116.142500,498157.317000 104115.259000,498074.576500 104133.426000,497993.027500 104027.825500,497994.997000 </gml:coordinates> </gml:LinearRing> </gml:outerBoundaryIs> </gml:Polygon> </gml:polygonMember> <gml:polygonMember> <gml:Polygon> <gml:outerBoundaryIs> <gml:LinearRing> <gml:coordinates>103759.048500,497981.223000 103752.446000,498016.585000 103769.454500,498060.194000 103825.775000,498059.615000 103825.722500,497980.614000 103759.048500,497981.223000 </gml:coordinates> </gml:LinearRing> </gml:outerBoundaryIs> </gml:Polygon> </gml:polygonMember> </gml:MultiPolygon> </stragisweb:msGeometry> <stragisweb:Loc_code>AA045303444</stragisweb:Loc_code> <stragisweb:Xcoord>103956</stragisweb:Xcoord> <stragisweb:Ycoord>498077</stragisweb:Ycoord> </stragisweb:bislocatie> </gml:featureMember> </wfs:FeatureCollection> Do you see any thing wrong in my tests ? Not sure where to go from here.
comment:5 by , 19 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Assefa, I just rechecked all this. Using mapserver 4.6.0 Windows binary (14-06-2005) I do still get a crash. But using CVS version (4.7) everything goes well. When you tested with 4.6, did you test with the current 4.6 branch in CVS, or with the actual 4.6.0 release binary? Apparently this has already been fixed in the meantime .... For a while I was thinking I must be getting crazy since all the testcases I provide work for you :-) but I could reproduce with the 4.6.0 Windows release binary. Thanks. I'll close this bug.
Note:
See TracTickets
for help on using tickets.