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

Support for topological ordering of curves #26

Open
ttho opened this issue Oct 13, 2016 · 2 comments
Open

Support for topological ordering of curves #26

ttho opened this issue Oct 13, 2016 · 2 comments
Assignees

Comments

@ttho
Copy link
Contributor

ttho commented Oct 13, 2016

Add "sorting algorithm" to SortProperty like below.

Open issues:
How to order disconnected strings (e.g. random?)
Other algorithms? e.g. North to South and then East to West?
Support for other geometry types?

  <Query typeNames="aixm:RouteSegment">
      <fes:Filter>
      ...
      </fes:Filter>
      <fes:SortBy>
         <fes-te:SortProperty>
            <fes:ValueReference>aixm:curveExtent</fes:ValueReference>
            <fes:SortOrder>ASC</fes:SortOrder>
            <fes-te:Algorithm>TOPOLOGICAL</fes-te:Algorithm>
         </fes-te:SortProperty>
      </fes:SortBy>
   </Query>

Add this to WFS-TE for now, but contact SWG when done, because it's not temporality-specific.

@ttho
Copy link
Contributor Author

ttho commented Nov 18, 2016

Other sort algorithms could be LONGITUDE_LATITUDE and LATITUDE_LONGITUDE, which can be applied to points only, meaning: points are ordered by their numerical value of the longitude first, then latitude (1). However, this approach is not feasible, as its extensibility is poor. Longitude and latitude are not defined for a lot of projected SRSs, and there may be more than two axes, e.g. elevation.

Preferred alternative:
The ordinate extraction is done in the value reference by custom XPath functions like this:

<fes:ValueReference>geo:latitude(geo:start(curveExtent))</fes:ValueReference>

Here, geo:start() extracts the starting point of a curve geometry. Alternatives: geo:end() or geo:middle().

If the order is latitude, then longitude, multiple SortProperty have to be combined which is already supported by the WFS/FES standard.

If spatial objects of different SRSs are to be compared, a coordinate transformation has to be applied first. This could also be modeled by a custom XPath function:

<fes:ValueReference>geo:latitude(geo:transform(geo:start(curveExtent), "urn:ogc:def:crs:EPSG::4326"))</fes:ValueReference>

Complete example:
"Order [the route segments] topologically, then by their WGS84 longitude value and then by their WGS84 latitude value":

<Query typeNames="aixm:RouteSegment">
      <fes:Filter>
      ...
      </fes:Filter>
      <fes:SortBy>
         <fes:SortProperty>
            <fes:ValueReference>aixm:curveExtent</fes:ValueReference>
            <fes:SortOrder>ASC</fes:SortOrder>
            <fes:Algorithm>TOPOLOGICAL</fes:Algorithm>
         </fes:SortProperty>
         <fes:SortProperty>
            <fes:ValueReference>geo:longitude(geo:transform(geo:start(curveExtent), "urn:ogc:def:crs:EPSG::4326"))</fes:ValueReference>
            <fes:SortOrder>ASC</fes:SortOrder>
         </fes:SortProperty>
         <fes:SortProperty>
            <fes:ValueReference>geo:latitude(geo:transform(geo:start(curveExtent), "urn:ogc:def:crs:EPSG::4326"))</fes:ValueReference>
            <fes:SortOrder>ASC</fes:SortOrder>
         </fes:SortProperty>
      </fes:SortBy>
   </Query>

Open questions:
How to extract elevation? geo:elevation() - only defined for 2.5D curves and surfaces? How to define the elevation SRS?

Is there previous work in that area, e.g. in GeoAPI?

@porosnie
Copy link

Issue raised to OGC: http://ogc.standardstracker.org/show_request.cgi?id=436

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

2 participants