Dear Wiki user, You have subscribed to a wiki page or wiki category on "Marmotta Wiki" for change notification.
The "MARMOTTA-584/UserDocumentation" page has been changed by Francisco Sumba: https://wiki.apache.org/marmotta/MARMOTTA-584/UserDocumentation?action=diff&rev1=9&rev2=10 || Aranjuez @es || || Arcones @es || - === Relate === - Returns true if the spatial relationship between geom1 and geom2 corresponds to one with acceptable values for the specified pattern-matrix. Otherwise, this function returns false. Pattern-matrix represents a [[https://en.wikipedia.org/wiki/DE-9IM|DE-9IM]] intersection pattern consisting of T (true) and F (false) values. The spatial reference system for geom1 is used for spatial calculations. - - '''Syntax:''' ''geof:relate(geom1, geom2, pattern-matrix)'' - - '''Sample Query''' - {{{ - PREFIX geoes: <http://geo.marmotta.es/ontology#> - PREFIX geo: <http://www.opengis.net/ont/geosparql#> - PREFIX geof: <http://www.opengis.net/def/function/geosparql/> - - SELECT DISTINCT ?labelRios - WHERE { - ?subject a <http://geo.marmotta.es/ontology#provincia>. - ?subject rdfs:label "Madrid"@es. - ?subject geoes:hasExactGeometry ?geo. - ?geo geo:asWKT ?wkt. - - ?subject2 a <http://geo.marmotta.es/ontology#rio>. - ?subject2 rdfs:label ?labelRios. - ?subject2 geoes:hasExactGeometry ?geo2. - ?geo2 geo:asWKT ?wkt2. - - FILTER (geof:relate(?wkt, ?wkt2, 'T********')) - } - }}} - - As result of this query we get the rivers that intersects the Madrid province. This ''T********'' pattern-matrix means intersection. - - || '''''labelRios''''' || - || Río Manzanares @es || - || Río Tajuña @es || - || Río Henares @es || - || Río Alberche @es || - || Río Algodor @es || - || Río Tajo @es || - || Río Guadarrama @es || - || Río Jarama @es || - === Touches === Returns TRUE if the geometries have at least one point in common, but their interiors do not intersect. @@ -370, +331 @@ '''Sample Query''' {{{ + PREFIX geoes: <http://geo.marmotta.es/ontology#> + PREFIX geo: <http://www.opengis.net/ont/geosparql#> + PREFIX geof: <http://www.opengis.net/def/function/geosparql/> + PREFIX units: <http://www.opengis.net/def/uom/OGC/1.0/> + + SELECT DISTINCT ?wktA (geof:boundary(?wktA) as ?boundary) + WHERE { + ?subject a <http://geo.marmotta.es/ontology#municipio>. + ?subject rdfs:label "Madrid"@es. + ?subject geoes:hasExactGeometry ?geo. + ?geo geo:asWKT ?wktA. + } }}} + + As result of this query we get the boundary of Madrid province. In graphics you can see [[ https://en.wikipedia.org/wiki/Well-known_text#Geometric_Objects| WKT (Well Known text)]] drawn in open layers. + + || '''''?wktA'''''|| '''''?boundary''''' || + || {{attachment:boundary_wktA.png|?wktA|width=200}} || {{attachment:boundary_boundary.png|?boundary |width=200}} || === Buffer === This function returns a geometric object that represents all Points whose distance from geom1 is less than or equal to the radius measured in units. Calculations are in the spatial reference system of geom1. @@ -379, +357 @@ '''Sample Query''' {{{ + PREFIX geoes: <http://geo.marmotta.es/ontology#> + PREFIX geo: <http://www.opengis.net/ont/geosparql#> + PREFIX geof: <http://www.opengis.net/def/function/geosparql/> + PREFIX units: <http://www.opengis.net/def/uom/OGC/1.0/> + + SELECT DISTINCT ?provinceA ?wktA (geof:buffer(?wktA, 2, units:meter) as ?buffer) + WHERE { + ?subject a <http://geo.marmotta.es/ontology#municipio>. + ?subject rdfs:label ?provinceA. + ?subject rdfs:label "Ruanes" @es. + ?subject geoes:hasExactGeometry ?geo. + ?geo geo:asWKT ?wktA. + } }}} === Convex Hull === @@ -434, +425 @@ As result of this query we get a geometric object that represents the difference among the rivers ''"Río Ebro"'' and ''"Río Matarraña"'' of Spain. In graphics you can see [[ https://en.wikipedia.org/wiki/Well-known_text#Geometric_Objects| WKT (Well Known text)]] drawn in open layers. || '''''?wkt'''''|| '''''?wkt2''''' || '''''?difference''''' || - || {{attachment:difference_wkt.png|?wkt|width=200}} || {{attachment:difference_wkt2.png|?convexHull|width=200}} || {{attachment:difference_difference.png|?convexHull|width=200}} || + || {{attachment:difference_wkt.png|?wkt|width=200}} || {{attachment:difference_wkt2.png|?wkt2 |width=200}} || {{attachment:difference_difference.png|?difference |width=200}} || === Distance === Returns the shortest distance in units between any two Points in the two geometric objects as calculated in the spatial reference system of geom1. @@ -491, +482 @@ As result of this query we get a bounding box of Madrid. In graphics you can see [[ https://en.wikipedia.org/wiki/Well-known_text#Geometric_Objects| WKT (Well Known text)]] drawn in open layers. || '''''?wkt'''''|| '''''?envelope''''' || - || {{attachment:evelope_wkt.png|?wkt|width=200}} || {{attachment:envelope_envelope.png|?convexHull|width=200}} || + || {{attachment:evelope_wkt.png|?wkt|width=200}} || {{attachment:envelope_envelope.png|?envelope |width=200}} || + + === Get SRID === + Returns the spatial reference system URI for geom. + + '''Syntax:''' ''geof:getSRID(geom)'' + + '''Sample Query''' + {{{ + PREFIX geoes: <http://geo.marmotta.es/ontology#> + PREFIX geo: <http://www.opengis.net/ont/geosparql#> + PREFIX geof: <http://www.opengis.net/def/function/geosparql/> + PREFIX units: <http://www.opengis.net/def/uom/OGC/1.0/> + + SELECT DISTINCT ?provinceMadrid (geof:getSRID(?wkt) as ?getSRID) + WHERE { + ?subject a <http://geo.marmotta.es/ontology#provincia>. + ?subject rdfs:label ?provinceMadrid. + ?subject rdfs:label "Madrid"@es. + ?subject geoes:hasExactGeometry ?geo. + ?geo geo:asWKT ?wkt. + } + }}} + + As result of this query we get spacial reference for Madrid province. + + || '''''provinceMadrid''''' || '''''getSRID''''' || + || Madrid @es || 4326 ^^xsd:integer || === Intersection === This function returns a geometric object that represents all Points in the intersection of geom1 with geom2. Calculations are in the spatial reference system of geom1. @@ -500, +518 @@ '''Sample Query''' {{{ + PREFIX geoes: <http://geo.marmotta.es/ontology#> + PREFIX geo: <http://www.opengis.net/ont/geosparql#> + PREFIX geof: <http://www.opengis.net/def/function/geosparql/> + + SELECT DISTINCT ?wktA ?wktB (geof:intersection(?wktA,?wktB) as ?intersection) + WHERE { + ?subject a <http://geo.marmotta.es/ontology#provincia>. + ?subject rdfs:label "Madrid"@es. + ?subject geoes:hasExactGeometry ?geo. + ?geo geo:asWKT ?wktA. + + ?subject2 a <http://geo.marmotta.es/ontology#municipio>. + ?subject2 rdfs:label "Ajalvir" @es. + ?subject2 geoes:hasExactGeometry ?geo2. + ?geo2 geo:asWKT ?wktB. + } }}} + + As result of this query we get an intersection between Madrid province and Ajalvir town. In graphics you can see [[ https://en.wikipedia.org/wiki/Well-known_text#Geometric_Objects| WKT (Well Known text)]] drawn in open layers. + + || '''''?wktA'''''|| '''''?wtkB''''' || '''''?intersection''''' || '''''Madrid ∩ Ajalvir''''' || + || {{attachment:intersection_wktA.png|?wktA |width=200}} || {{attachment:intersection_wktB.png|?wtkB |width=200}} || {{attachment:intersection_intersection.png|?intersection |width=200}} || {{attachment:intersection_Madrid_i_Ajalvir.png|?Madrid ∩ Ajalvir|width=200}} || + + === Relate === + Returns true if the spatial relationship between geom1 and geom2 corresponds to one with acceptable values for the specified pattern-matrix. Otherwise, this function returns false. Pattern-matrix represents a [[https://en.wikipedia.org/wiki/DE-9IM|DE-9IM]] intersection pattern consisting of T (true) and F (false) values. The spatial reference system for geom1 is used for spatial calculations. + + '''Syntax:''' ''geof:relate(geom1, geom2, pattern-matrix)'' + + '''Sample Query''' + {{{ + PREFIX geoes: <http://geo.marmotta.es/ontology#> + PREFIX geo: <http://www.opengis.net/ont/geosparql#> + PREFIX geof: <http://www.opengis.net/def/function/geosparql/> + + SELECT DISTINCT ?labelRios + WHERE { + ?subject a <http://geo.marmotta.es/ontology#provincia>. + ?subject rdfs:label "Madrid"@es. + ?subject geoes:hasExactGeometry ?geo. + ?geo geo:asWKT ?wkt. + + ?subject2 a <http://geo.marmotta.es/ontology#rio>. + ?subject2 rdfs:label ?labelRios. + ?subject2 geoes:hasExactGeometry ?geo2. + ?geo2 geo:asWKT ?wkt2. + + FILTER (geof:relate(?wkt, ?wkt2, 'T********')) + } + }}} + + As result of this query we get the rivers that intersects the Madrid province. This ''T********'' pattern-matrix means intersection. + + || '''''labelRios''''' || + || Río Manzanares @es || + || Río Tajuña @es || + || Río Henares @es || + || Río Alberche @es || + || Río Algodor @es || + || Río Tajo @es || + || Río Guadarrama @es || + || Río Jarama @es || + === Sym Difference === This function returns a geometric object that represents all Points in the set symmetric difference of geom1 with geom2. Calculations are in the spatial reference system of geom1. @@ -508, +587 @@ '''Sample Query''' {{{ + PREFIX geoes: <http://geo.marmotta.es/ontology#> + PREFIX geo: <http://www.opengis.net/ont/geosparql#> + PREFIX geof: <http://www.opengis.net/def/function/geosparql/> + + SELECT DISTINCT ?wktA ?wktB (geof:symDifference(?wktA,?wktB) as ?symDifference) + WHERE { + ?subject a <http://geo.marmotta.es/ontology#provincia>. + ?subject rdfs:label "Madrid"@es. + ?subject geoes:hasExactGeometry ?geo. + ?geo geo:asWKT ?wktA. + + ?subject2 a <http://geo.marmotta.es/ontology#municipio>. + ?subject2 rdfs:label "Ajalvir" @es. + ?subject2 geoes:hasExactGeometry ?geo2. + ?geo2 geo:asWKT ?wktB. + } }}} + + + As result of this query we get symmetric difference between Madrid province and Ajalvir town. In graphics you can see [[ https://en.wikipedia.org/wiki/Well-known_text#Geometric_Objects| WKT (Well Known text)]] drawn in open layers. + + || '''''?wktA'''''|| '''''?wtkB''''' || '''''?symDifference''''' || + || {{attachment:symDifference_wktA.png|?wktA|width=200}} || {{attachment:symDifference_wktB.png|?wktB|width=200}} || {{attachment:symDifference_symDifference.png|? symDifference |width=200}} || === Union === This function returns a geometric object that represents all Points in the union of geom1 with geom2. Calculations are in the spatial reference system of geom1. @@ -517, +618 @@ '''Sample Query''' {{{ - }}} + PREFIX geoes: <http://geo.marmotta.es/ontology#> + PREFIX geo: <http://www.opengis.net/ont/geosparql#> + PREFIX geof: <http://www.opengis.net/def/function/geosparql/> + SELECT DISTINCT ?wktA ?wktB (geof:union(?wktA,?wktB) as ?union) + WHERE { + ?subject a <http://geo.marmotta.es/ontology#provincia>. + ?subject rdfs:label "Madrid"@es. + ?subject geoes:hasExactGeometry ?geo. + ?geo geo:asWKT ?wktA. + + ?subject2 a <http://geo.marmotta.es/ontology#provincia>. + ?subject2 rdfs:label "Barcelona" @es. + ?subject2 geoes:hasExactGeometry ?geo2. + ?geo2 geo:asWKT ?wktB. + } + }}} + + As result of this query we get the union between Madrid and Barcelona provinces. In graphics you can see [[ https://en.wikipedia.org/wiki/Well-known_text#Geometric_Objects| WKT (Well Known text)]] drawn in open layers. + + || '''''?wktA'''''|| '''''?wtkB''''' || '''''?union''''' || + || {{attachment:union_wktA.png|?wktA|width=200}} || {{attachment:union_wktB.png|?wktB|width=200}} || {{attachment:union_union.png|?union|width=200}} || +
