0

I'm querying two geosparql conform datasets at endpoint http://onto.fel.cvut.cz:7200/sparql trying to get intersectred geometry as result using GeoSPARQL language.

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX databaseTableFVU: <http://onto.fel.cvut.cz/ontologies/town-plan/databaseTableFVU/>
PREFIX databaseTableSSVU: <http://onto.fel.cvut.cz/ontologies/town-plan/databaseTableSSVU/>
PREFIX geosparql: <http://www.opengis.net/ont/geosparql#>
PREFIX common: <http://onto.fel.cvut.cz/ontologies/town-plan/common/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT distinct ?var1 ?var2
WHERE  {
       {
        ?var1 databaseTableFVU:kodfp1_a ?val1.
        ?var1 geosparql:hasGeometry ?geometry1.
        ?geometry1 geosparql:asWKT ?WKT1.
        FILTER(?val1 = "OB" || ?val1 = "OV")
       }
       {
        ?var2 databaseTableSSVU:kod ?val2.
        ?var2 geosparql:hasGeometry ?geometry2.
        ?geometry2 geosparql:asWKT ?WKT2.
        FILTER(?val2 != "BD" && ?val2 != "BQ" && ?val2 != "BRV" && ?val2 != "BRR")
      }
FILTER(geof:sfIntersects(?WKT1, ?WKT2)).
}

I know that this query returns only features, that intersects, but I have no idea how to actually get intersection as geometry representation.

1 Answer 1

1

It is actually not possible with GeoSPARQL.

GeoSPARQL is using java functions that are called by

PREFIX geof: <http://www.opengis.net/def/function/geosparql/>

What I recommend is the creation of your own java function, which can be tremendous if you are not familiar with it.

Your Answer

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

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