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, 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))


  <Thing type="A">
  <Thing type="B">

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.

1 Answer 1


Thanks to @chrisis over at Stack Overflow, answer there: https://stackoverflow.com/questions/46681809/ogc-filter-specification-in-xpath

"You might want to take a look at expath.org/spec/geo . I know BaseX implements these functions and I think eXist does as well."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.