opengeospatial / ets-wfs20

Executable Test Suite for WFS 2.0
Other
9 stars 11 forks source link

Invalid GML geometry if server locale is DE #37

Closed lgoltz closed 7 years ago

lgoltz commented 8 years ago

If the locale of the server running the teamengine is DE some tests failes due to invalid GML geometries:

Here an example request from the test intersectsPolygon:

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs/2.0" count="10" service="WFS" startIndex="0" version="2.0.0">
  <wfs:Query xmlns:ns53="http://www.deegree.org/app" typeNames="ns53:osm_protected_area">
    <fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0">
      <fes:Intersects>
        <fes:ValueReference xmlns:tns="http://www.deegree.org/app">tns:geometry</fes:ValueReference>
        <gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2" gml:id="d1e1" srsName="urn:ogc:def:crs:EPSG::4326">
          <gml:exterior>
            <gml:LinearRing>
              <gml:posList>63,39 -24,04 63,39 -13,62 66,46 -13,62 66,46 -24,04 63,39 -24,04</gml:posList>
            </gml:LinearRing>
          </gml:exterior>
        </gml:Polygon>
      </fes:Intersects>
    </fes:Filter>
  </wfs:Query>
</wfs:GetFeature>

The gml:posLists contains a list of coordinates with commas instead of of points.

The following tests are concerned:

All of them creates the geometry node by Extents.envelopeAsGML():

Document gmlEnv = Extents.envelopeAsGML(featureInfo.get(featureType)
                .getGeoExtent());

This is part of geomatics-geotk [1].

As workaround the server locale can be set to EN, but it is preferred to fix this.

[1] https://github.com/opengeospatial/geomatics-geotk/blob/master/src/main/java/org/opengis/cite/geomatics/Extents.java

rjmartell commented 7 years ago

The org.opengis.geometry.Envelope is created by the DataSampler from geometry elements in the data sample (Extents::calculateEnvelope); these are ok. But java.text.DecimalFormat is locale-sensitive so this is probably the source of the error.

rjmartell commented 7 years ago

Fixed in geomatics-geotk-1.14. Format decimal values using Locale.ROOT.