Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BBOX tests can fail due to precision issues #106

Closed
aaime opened this issue Apr 19, 2018 · 3 comments
Closed

BBOX tests can fail due to precision issues #106

aaime opened this issue Apr 19, 2018 · 3 comments
Assignees
Milestone

Comments

@aaime
Copy link
Contributor

aaime commented Apr 19, 2018

I have a dataset with just two EPSG 4326 points having the following coordinates:

  • -66.16667 18.66667
  • -66.71667 18.00126

The BBOX tests sample those points, get the overall bbox, and then use geomatrics-tgeotk Extends.evenlopeAsGML method to turn that into a BBOX usable for a filter. Unfortunately the method formats with just 2 decimal digits (definitely not enough for geographic coordinates) and ends up building a request as follows:

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs/2.0" count="10" service="WFS"
                startIndex="0"
                version="2.0.0">
   <wfs:Query xmlns:ns97="http://www.opengeospatial.org/projects/initiatives/geoedgeplugfest"
              typeNames="ns97:port_p">
      <fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0">
         <fes:BBOX>
            <fes:ValueReference xmlns:tns="http://www.opengeospatial.org/projects/initiatives/geoedgeplugfest">tns:wkb_geometry</fes:ValueReference>
            <gml:Envelope xmlns:gml="http://www.opengis.net/gml/3.2" srsName="urn:ogc:def:crs:EPSG::4326">
               <gml:lowerCorner>-66.71 18</gml:lowerCorner>
               <gml:upperCorner>-66.16 18.66</gml:upperCorner>
            </gml:Envelope>
         </fes:BBOX>
      </fes:Filter>
   </wfs:Query>
</wfs:GetFeature>

The first point is not captured by the request as it sits slightly north of the bounds, while the second sits slightly west of the bounds. No features get captured, and the test end up failing.
Unfortunately the method does not allow customizing the precision, I guess the only approach would be to expand the extends a bit before formatting them. I'll follow up with a pull request.

@dstenger
Copy link
Contributor

Thank you for reporting. We will do further investigation.

@aaime
Copy link
Contributor Author

aaime commented Apr 19, 2018

I already have a fix, I'm writing tests for it

@dstenger dstenger assigned aaime and unassigned dstenger and lgoltz Apr 19, 2018
aaime added a commit to aaime/ets-wfs20 that referenced this issue Apr 19, 2018
@aaime
Copy link
Contributor Author

aaime commented Apr 19, 2018

Tentative fix here: #107 (works for me)

@dstenger dstenger assigned dstenger, lgoltz and keshavnangare and unassigned aaime Apr 20, 2018
dstenger added a commit that referenced this issue May 7, 2018
#106, BBOX tests can fail due to precision issues
@dstenger dstenger added this to the 1.29 milestone May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants