|
(sorry if it has been reported before, but i was not able to find it)
I tried to make a request for a number of features within a bbox with the following url
http://[host]/geoserver/GEO/wfs?version=1.1.0&request=GetFeature&typename=[layer]&outputFormat=application/json&srsname=EPSG:4326&filter=<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><BBOX><PropertyName>geom</PropertyName><gml:Box%20srsName="EPSG:4326"><gml:coordinates>12.530799742947515,54.66337753988665 12.550165292031572,55.670753796871054</gml:coordinates></gml:Box></BBOX></Filter>
And got the following result: {"type":"FeatureCollection","totalFeatures":1615,"features":[],"crs":null}
Looking a the result, it was strange to find no feature even though it has counted 1615, so i looked in the geoserver log to find out why:
2015-06-18 15:26:25,848 INFO [geoserver.wfs] - Request: getFeature service = WFS version = 1.1.0 baseUrl = http://localhost:8080/geoserver/ query[0]: filter = [ geom bbox POLYGON ((12.530799742947515 54.66337753988665, 12.530799742947515 55.670753796871054, 12.550165292031572 55.670753796871054, 12.550165292031572 54.66337753988665, 12.530799742947515 54.66337753988665)) ] srsName = EPSG:4326 typeName[0] = {www.geo.dk/1.0.0}
[layer] outputFormat = application/json resultType = results 2015-06-18 15:26:25,848 INFO [wfs.json] - about to encode JSON 2015-06-18 15:26:25,848 DEBUG [geotools.jdbc] - CREATE CONNECTION 2015-06-18 15:26:25,926 DEBUG [geotools.jdbc] - CLOSE CONNECTION 2015-06-18 15:26:25,926 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:25,926 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:25,926 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:25,926 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:25,926 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:25,926 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:25,926 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:25,926 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:25,926 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:25,926 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:25,942 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:25,942 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:25,942 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:25,942 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:25,942 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:25,942 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:25,942 DEBUG [geotools.jdbc] - CREATE CONNECTION 2015-06-18 15:26:25,942 DEBUG [geotools.filter] - exporting PropertyName 2015-06-18 15:26:25,942 DEBUG [geotools.filter] - exporting LiteralExpression 2015-06-18 15:26:25,942 DEBUG [geotools.util] - CRSConverterFactory can be applied from Strings to CRS only. 2015-06-18 15:26:25,942 DEBUG [geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only. 2015-06-18 15:26:25,942 DEBUG [geotools.jdbc] - SELECT count FROM (select .... from ... where (... ) as "vtable" WHERE "geom".Filter(geometry::STGeomFromText('POLYGON ((12.530799742947515 54.66337753988665, 12.530799742947515 55.670753796871054, 12.550165292031572 55.670753796871054, 12.550165292031572 54.66337753988665, 12.530799742947515 54.66337753988665))', 4326)) = 1 2015-06-18 15:26:26,051 DEBUG [geotools.util] - CRSConverterFactory can be applied from Strings to CRS only. 2015-06-18 15:26:26,051 DEBUG [geotools.jdbc] - CLOSE CONNECTION 2015-06-18 15:26:26,051 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:26,051 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:26,051 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:26,051 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:26,051 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:26,051 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:26,051 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:26,051 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:26,051 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:26,051 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:26,051 TRACE [geotools.factory] - ENTRY (GeometryFactory, JTS_GEOMETRY_FACTORY) 2015-06-18 15:26:26,051 TRACE [geotools.factory] - RETURN (GeometryFactory, JTS_GEOMETRY_FACTORY): found implementation GeometryFactory. 2015-06-18 15:26:26,051 DEBUG [geotools.jdbc] - CREATE CONNECTION 2015-06-18 15:26:26,051 DEBUG [geotools.filter] - exporting PropertyName 2015-06-18 15:26:26,051 DEBUG [geotools.filter] - exporting LiteralExpression 2015-06-18 15:26:26,051 DEBUG [geotools.util] - CRSConverterFactory can be applied from Strings to CRS only. 2015-06-18 15:26:26,051 DEBUG [geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only. 2015-06-18 15:26:26,051 DEBUG [geotools.jdbc] - SELECT top 1000000 "id","geom" as "geom","mapsymbol","projectType" FROM (select ... from ... where (... ) as "vtable" WHERE "geom".Filter(geometry::STGeomFromText('POLYGON ((54.66337753988665 12.530799742947515, 54.66337753988665 12.550165292031572, 55.670753796871054 12.550165292031572, 55.670753796871054 12.530799742947515, 54.66337753988665 12.530799742947515))', 4326)) = 1 2015-06-18 15:26:26,082 DEBUG [geotools.jdbc] - CLOSE CONNECTION
And i found the reason why. In the two sqls, the order of x and y coordinate are change, such that in the first sql it return the right result, but in the second the order y, x instead of x,y and it returns no result
|