[Geoserver-devel] [jira] Created: (GEOS-1165) Bounding box is null (unknown) when geometry field isn't queried

Bounding box is null (unknown) when geometry field isn't queried
----------------------------------------------------------------

                 Key: GEOS-1165
                 URL: http://jira.codehaus.org/browse/GEOS-1165
             Project: GeoServer
          Issue Type: Improvement
          Components: WFS
    Affects Versions: 1.5.1
         Environment: Windows, PostGIS / Oracle
            Reporter: Frank Steggink
            Assignee: Andrea Aime
            Priority: Minor

When a GetFeature is executed, with only a subset of the properties, and the geometry property isn't one of them, Geoserver returns a null bounding box (value "unknown"). This only happens when "generate feature bounds" is checked.

Examples:

Request 1 (without geometry):
<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:topp="http://www.openplans.org/topp&quot;
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;
maxFeatures="1">
  <wfs:Query typeName="pgtest:single_polygon">
    <ogc:PropertyName>pgtest:prop_varchar10</ogc:PropertyName>
  </wfs:Query>
</wfs:GetFeature>

Result:
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs&quot; xmlns:pgtest="http://www.example.org/pgtest&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation="http://www.example.org/pgtest http://127.0.0.1:8080/geoserver/wfs/DescribeFeatureType?typeName=pgtest:single_polygon http://www.opengis.net/wfs http://127.0.0.1:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
<gml:boundedBy>
<gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#28992&quot;&gt;
<gml:coordinates decimal="." cs="," ts=" ">6886.52587891,487230.53125 79645.1171875,558165.875</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<pgtest:single_polygon fid="single_polygon.37">
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
<pgtest:prop_varchar10>na</pgtest:prop_varchar10>
</pgtest:single_polygon>
</gml:featureMember>
</wfs:FeatureCollection>

Request 2 (with geometry):
<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:topp="http://www.openplans.org/topp&quot;
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;
maxFeatures="1">
  <wfs:Query typeName="pgtest:single_polygon">
    <ogc:PropertyName>pgtest:prop_varchar10</ogc:PropertyName>
    <ogc:PropertyName>pgtest:the_geom</ogc:PropertyName>
  </wfs:Query>
</wfs:GetFeature>

Result:
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs&quot; xmlns:pgtest="http://www.example.org/pgtest&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation="http://www.example.org/pgtest http://127.0.0.1:8080/geoserver/wfs/DescribeFeatureType?typeName=pgtest:single_polygon http://www.opengis.net/wfs http://127.0.0.1:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
<gml:boundedBy>
<gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#28992&quot;&gt;
<gml:coordinates decimal="." cs="," ts=" ">6886.52587891,487230.53125 79645.1171875,558165.875</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<pgtest:single_polygon fid="single_polygon.37">
<gml:boundedBy>
<gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#28992&quot;&gt;
<gml:coordinates decimal="." cs="," ts=" ">6886.526026,511453.2371 17210.88503,548799.4415</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<pgtest:prop_varchar10>na</pgtest:prop_varchar10>
<pgtest:the_geom>
<gml:Polygon srsName="http://www.opengis.net/gml/srs/epsg.xml#28992&quot;&gt;
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">17210.88503,511453.2371 6886.526026,511453.2371 6886.526026,548799.4415 17210.88503,547972.3647 17210.88503,511453.2371</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</pgtest:the_geom>
</pgtest:single_polygon>
</gml:featureMember>
</wfs:FeatureCollection>

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira