Skip to content
Permalink
Browse files
added new help files for geometry functions
  • Loading branch information
astroidex committed Sep 15, 2013
1 parent a1a95c1 commit 6adc8746e9ac4c914dfa1eb405c09c3d32908891
@@ -0,0 +1,12 @@
<h3>$geometry function</h3>
Returns the geometry of the current feature. Can be used for processing with other functions.

<h4>Syntax</h4>
<pre>$geometry</pre>

<h4>Arguments</h4>
None

<h4>Example</h4>
<pre> geomToWKT( $geometry ) &rarr; POINT(6 50)</pre>

@@ -0,0 +1,13 @@
<h3>buffer function</h3>
Returns a geometry that represents all points whose distance from this geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this Geometry.

<h4>Syntax</h4>
<pre>geomFromWKT(text)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
float &rarr; radius of buffer

<h4>Example</h4>
<pre> buffer($geometry, 10.5 ) &rarr; returns a polygon</pre>

@@ -0,0 +1,12 @@
<h3>centroid function</h3>
Returns the geometric center of a geometry.

<h4>Syntax</h4>
<pre>centroid(geometry)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry

<h4>Example</h4>
<pre> centroid($geometry) &rarr; returns a point geometry</pre>

@@ -0,0 +1,13 @@
<h3>combine function</h3>
Returns the combination of geometry a and geometry b.

<h4>Syntax</h4>
<pre>combine( geometry a , geometry b)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> geomToWKT( combine( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5 )' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4, 2 1 )' )) ) &rarr; returns MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5)) </pre>
<pre> geomToWKT( combine( geomFromWKT( 'LINESTRING(3 3 , 4 4 )' ) , geomFromWKT( 'LINESTRING(3 3 , 6 6, 2 1 )' )) ) &rarr; returns LINESTRING(3 3, 4 4, 6 6, 2 1) </pre>
@@ -0,0 +1,13 @@
<h3>contains function</h3>
Returns true if and only if no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a.

<h4>Syntax</h4>
<pre>contains( geometry a , geometry a)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'POINT( 0.5 0.5 )' )) &rarr; returns 1</pre>
<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>
@@ -0,0 +1,13 @@
<h3>crosses function</h3>
Returns 1 if the supplied geometries have some, but not all, interior points in common.

<h4>Syntax</h4>
<pre>crosses( $geometry , $geometry)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> crosses( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>
<pre> crosses( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>
@@ -0,0 +1,12 @@
<h3>difference function</h3>
Returns a geometry that represents that part of geometry a that does not intersect with geometry a.

<h4>Syntax</h4>
<pre>difference( geometry a , geometry b)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> geomToWKT( difference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4)' )) ) &rarr; returns LINESTRING(4 4, 5 5)</pre>
@@ -0,0 +1,13 @@
<h3>disjoint function</h3>
Returns 1 if the Geometries do not "spatially intersect" - if they do not share any space together.

<h4>Syntax</h4>
<pre>disjoint( $geometry , $geometry)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> disjoint( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>
<pre> disjoint( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'POINT(4 4)' )) &rarr; returns 0</pre>
@@ -0,0 +1,12 @@
<h3>distance function</h3>
Returns the minimum distance (based on spatial ref) between two geometries in projected units.

<h4>Syntax</h4>
<pre>distance( $geometry , $geometry)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> distance( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(4 8)' )) &rarr; returns 4</pre>
@@ -0,0 +1,12 @@
<h3>geomFromGML function</h3>
Returns a geometry from a GML representation of geometry

<h4>Syntax</h4>
<pre>geomFromGML(text)</pre>

<h4>Arguments</h4>
text &rarr; GML representation of a geometry

<h4>Example</h4>
<pre> geomFromGML( '<gml:LineString srsName="EPSG:4326"><gml:coordinates>4,4 5,5 6,6</gml:coordinates></gml:LineString>') &rarr; returns a geometry</pre>

@@ -0,0 +1,12 @@
<h3>geomFromWKT function</h3>
Returns a geometry created from a Well-Known Text (WKT) representation.

<h4>Syntax</h4>
<pre>geomFromWKT(text)</pre>

<h4>Arguments</h4>
text &rarr; Well-Known Text (WKT) representation of a geometry

<h4>Example</h4>
<pre> geomFromWKT( 'POINT(4 5)' ) &rarr; returns a geometry</pre>

@@ -0,0 +1,12 @@
<h3>geomToWKT function</h3>
Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata.

<h4>Syntax</h4>
<pre>geomToWKT($geometry)</pre>

<h4>Arguments</h4>
$geometry &rarr; geometry of your current feature

<h4>Example</h4>
<pre> geomToWKT( $geometry ) &rarr; POINT(6 50)</pre>

@@ -0,0 +1,12 @@
<h3>intersection function</h3>
Returns a geometry that represents the shared portion of geometry a and geometry b.

<h4>Syntax</h4>
<pre>intersection( geometry a , geometry b)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> geomToWKT( intersection( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 )' )) ) &rarr; returns LINESTRING(3 3, 4 4)</pre>
@@ -0,0 +1,13 @@
<h3>intersects function</h3>
Returns 1 if the geometries spatially intersect (share any portion of space) and 0 if they don't.

<h4>Syntax</h4>
<pre>intersects( $geometry , $geometry)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> intersects( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>
<pre> intersects( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'POINT(5 5)' )) &rarr; returns 0</pre>
@@ -0,0 +1,13 @@
<h3>overlaps function</h3>
Returns 1 if the Geometries share space, are of the same dimension, but are not completely contained by each other.

<h4>Syntax</h4>
<pre>overlaps( $geometry , $geometry)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> overlaps( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 5 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>
<pre> overlaps( geomFromWKT( 'LINESTRING(0 0 , 1 1)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>
@@ -0,0 +1,13 @@
<h3>touches function</h3>
Returns 1 if the geometries have at least one point in common, but their interiors do not intersect.

<h4>Syntax</h4>
<pre>touches( $geometry , $geometry)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> touches( geomFromWKT( 'LINESTRING(5 3 , 4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>
<pre> touches( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) &rarr; returns 0</pre>
@@ -0,0 +1,12 @@
<h3>union function</h3>
Returns a geometry that represents the point set union of the geometries.

<h4>Syntax</h4>
<pre>union( $geometry , $geometry)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> geomToWKT( union( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) ) &rarr; returns MULTIPOINT(4 4, 5 5)</pre>
@@ -0,0 +1,13 @@
<h3>within function</h3>
Returns 1 if the geometry a is completely inside geometry b

<h4>Syntax</h4>
<pre>within( geometry a , geometry b)</pre>

<h4>Arguments</h4>
geometry &rarr; geometry
geometry &rarr; geometry

<h4>Example</h4>
<pre> within( geomFromWKT( 'POINT( 0.5 0.5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) &rarr; returns 1</pre>
<pre> within( geomFromWKT( 'POINT( 5 5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) &rarr; returns 0</pre>

0 comments on commit 6adc874

Please sign in to comment.