0

I've got some XML documents which conform to a known schema which include geometries in GML format.

I'm looking to perform validation on the XML using XSD and Schematron validation, but I'll need some way of performing spatial queries within the Xpath language (I presume via extension functions).

I was wondering if anyone is aware of a standard for implementation I can use, or indeed if someone has already done this - I've come up empty on google.

As an example (representative only, only attempting to demonstrate the xpath part of the question (which is the question really - the fact I'm aiming to use it in schematron is moot))

My XML:

<Things>
  <Thing type="A">
    <Geometry>...GML...</Geometry>
  </Thing>
  <Thing type="B">
    <Geometry>...GML...</Geometry>
  </Thing>
</Things>

Xpath to return things of type A which spatially intersect with things of type B (again, I'm making up a function extension namespace and a (pretty dumb) function to give an example of what I'm trying to accomplish):

/Things/Thing[@type='A' and geo:has-intersection(Geometry, /Things/Thing[@type='B']/Geometry)] 

As this seems somewhere between development and GIS, I've cross posted on GIS and StackOverflow.

GHC
  • 2,658
  • 5
  • 30
  • 35
  • 1
    You might want to take a look at http://expath.org/spec/geo . I know BaseX implements these functions and I think eXist does as well. – chrisis Oct 11 '17 at 07:54
  • @chrisis Thank you - do you want to post that as an answer so I can accept it and close the question? – GHC Oct 11 '17 at 09:01

1 Answers1

1

The EXPath Geo Module defines functions on simple OGC geometries. I believe there are several implementations but the only one I'm familiar with is BaseX.

chrisis
  • 1,983
  • 5
  • 20
  • 17