Arggh! Spotted it - &propertyName crept into it, excluding geometry.

From: Phil Scadden <[email protected]>
Sent: Tuesday, 29 October 2019 15:37
To: geoserver-users <[email protected]>
Subject: [Geoserver-users] How can a spatial query return a feature with null 
geometry?? A particular polygon seems to result in a dud query return, but no 
error.

Doing a WFS query with 
&cql_filter=INTERSECTS(shape,POLYGON+((-42.181268265425096+180,+-42.24646551944196+179.1648221254352,+-42.3764550843559+179.3186295572426,+-42.508320536297404+180,+-42.181268265425096+180)))+OR+INTERSECTS(shape,POLYGON+((-42.508320536297404+-180,+-43.08659061624255+-177.0119835437991,+-42.95807403174561+-171.43100254248122,+-41.46088142451996+-170.77183295946847,+-42.181268265425096+-180,+-42.508320536297404+-180)))

And get response:
{"type":"FeatureCollection","features":[{"type":"Feature","id":"fred_site_view.85265","geometry":null,"properties":{"fr_number":"SW41171/f0001"}}],"totalFeatures":6,"numberMatched":6,"numberReturned":1,"timeStamp":"2019-10-29T02:19:28.339Z","crs":null}

Geometry null??? How it match the filter of there is no geometry? How come 
number matched is 6 (looked about right on the map) but number returned is one? 
How can crs be null?
Nothing at all in the geoserver log. The request is completely reproducible.

Other  extremely similar queries eg
&cql_filter=INTERSECTS(shape,POLYGON+((-41.725973830527934+180,+-41.67460654588495+178.94509705669265,+-43.16678066092337+179.20876966231165,+-43.18984223874159+180,+-41.725973830527934+180)))+OR+INTERSECTS(shape,POLYGON+((-43.18984223874159+-180,+-43.27885366180694+-176.94606592466153,+-43.96281820667889+-173.67218215836957,+-43.61385062483762+-170.0687148317926,+-41.130714714805706+-170.42027583373962,+-42.00200187021109+-174.33135713672766,+-41.725973830527934+-180,+-43.18984223874159+-180)))
returns okay.

{"type":"FeatureCollection","features":[{"type":"Feature","id":"fred_site_view.85265","geometry":{"type":"Point","coordinates":[-171.49889006,-41.78615999]},"geometry_name":"shape","properties":{"fr_number":"SW41171/f0001","feature_type":"Drillhole","locality":"ODP
 Leg 181, SW Pacific Gateways 1998. Hole 1123 A. 3290.1 m water depth. Location 
410 km NE of the Chatham Rise, on the North Chatham sediment drift which is 
located between 169 W and 175 W at depths of 2200-4500 
m."}},{"type":"Feature","id":"fred_site_view.85266","geometry":{"type":"Point","coordinates":[-171.49877992,-41.78588993]},"geometry_name":"shape","properties":{"fr_number":"SW41171/f0002","feature_type":"Drillhole","locality":"ODP
 Leg 181, SW Pacific Gateways 1998. Hole 1123 B. 3289.8 m water depth. Location 
410 km NE of the Chatham Rise, on the North Chatham sediment drift which is 
located between 169 W and 175 W at depths of 2200-4500 
m."}},{"type":"Feature","id":"fred_site_view.85267","geometry":{"type":"Point","coordinates":[-171.49877992,-41.78562003]},"geometry_name":"shape","properties":{"fr_number":"SW41171/f0003","feature_type":"Drillhole","locality":"ODP
 Leg 181, SW Pacific Gateways 1998. Hole 1123 C. 3290.1 m water depth. Locate 
410 km NE of the Chatham Rise, on the North Chatham sediment drift which is 
located between 169 W and 175 W at depths of 2200-4500 
m."}},{"type":"Feature","id":"fred_site_view.85268","geometry":{"type":"Point","coordinates":[-178.16648332,-42.54993611]},"geometry_name":"shape","properties":{"fr_number":"SW42178/f0001","feature_type":"Drillhole","locality":"ODP
 Leg 181, SW Pacific Gateways 1998. Hole 1125 A. 1364.6 m water depth. Located 
approximately 610 km east of the South Island, on the north slope of the 
Chatham 
Rise."}},{"type":"Feature","id":"fred_site_view.85269","geometry":{"type":"Point","coordinates":[-178.16645834,-42.54964995]},"geometry_name":"shape","properties":{"fr_number":"SW42178/f0002","feature_type":"Drillhole","locality":"ODP
 Leg 181, SW Pacific Gateways 1998. Hole 1125 B. 1365.6 m water depth. Located 
approximately 610 km east of the South Island, on the north slope of the 
Chatham 
Rise."}},{"type":"Feature","id":"fred_site_view.88327","geometry":{"type":"Point","coordinates":[-176.51804594,-42.88913949]},"geometry_name":"shape","properties":{"fr_number":"CH/f0653","feature_type":"Outcrop","locality":"Large
 Float Blocks, exposed mostly at low tide,  50 m west of Tahatika Creek, 
Maunganui Beach, northwest Chatham Island, Chatham Islands 
"}},{"type":"Feature","id":"fred_site_view.91818","geometry":{"type":"Point","coordinates":[179.86622621,-42.65654549]},"geometry_name":"shape","properties":{"fr_number":"SE42179/f0001","feature_type":"Outcrop","locality":"Plug
 of chalky material from a depression on the surface of TAN 9401 (Tangaroa 
Survey 9406, Station 110). 'Chatham Rise', water depth 1106 
m."}}],"totalFeatures":7,"numberMatched":7,"numberReturned":7,"timeStamp":"2019-10-29T02:15:01.628Z","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}}}

Note that it includes the same point but this time it has geometry okay.

There seems to be something particular to the query that causes the issue. Both 
split the polygon on the 180 line.

Actually I can simplify the query to
https://data.gns.cri.nz/webmaps/petroleum/wfs?cql_filter=INTERSECTS(shape,POLYGON+((-42.508320536297404+-180,+-43.08659061624255+-177.0119835437991,+-42.95807403174561+-171.43100254248122,+-41.46088142451996+-170.77183295946847,+-42.181268265425096+-180,+-42.508320536297404+-180)))&maxFeatures=1&outputFormat=application%2Fjson&propertyName=fr_number&request=GetFeature&service=wfs&srsName=EPSG:4326&typeNames=gns:fred_site_view&version=1.1.0

It is public geoserver site
Notice: This email and any attachments are confidential and may not be used, 
published or redistributed without the prior written consent of the Institute 
of Geological and Nuclear Sciences Limited (GNS Science). If received in error 
please destroy and immediately notify GNS Science. Do not copy or disclose the 
contents.
Notice: This email and any attachments are confidential and may not be used, 
published or redistributed without the prior written consent of the Institute 
of Geological and Nuclear Sciences Limited (GNS Science). If received in error 
please destroy and immediately notify GNS Science. Do not copy or disclose the 
contents.
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to