Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #896 from astroidex/master
added new help files for geometry functions
  • Loading branch information
mach0 committed Sep 15, 2013
2 parents a0ff6d5 + 6ec9e75 commit 4a40300
Show file tree
Hide file tree
Showing 20 changed files with 249 additions and 0 deletions.
12 changes: 12 additions & 0 deletions resources/function_help/$geometry
@@ -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>

13 changes: 13 additions & 0 deletions resources/function_help/buffer
@@ -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>

12 changes: 12 additions & 0 deletions resources/function_help/centroid
@@ -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>

13 changes: 13 additions & 0 deletions resources/function_help/combine
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/contains
@@ -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>
12 changes: 12 additions & 0 deletions resources/function_help/convexHull
@@ -0,0 +1,12 @@
<h3>convexHull function</h3>
Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set.

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

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

<h4>Example</h4>
<pre> geomToWKT( convexHull( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 4 10)' )) ) &rarr; returns POLYGON((3 3,4 10,4 4,3 3)) </pre>
13 changes: 13 additions & 0 deletions resources/function_help/crosses
@@ -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>
12 changes: 12 additions & 0 deletions resources/function_help/difference
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/disjoint
@@ -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>
12 changes: 12 additions & 0 deletions resources/function_help/distance
@@ -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>
12 changes: 12 additions & 0 deletions resources/function_help/geomFromGML
@@ -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>

12 changes: 12 additions & 0 deletions resources/function_help/geomFromWKT
@@ -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>

12 changes: 12 additions & 0 deletions resources/function_help/geomToWKT
@@ -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>

12 changes: 12 additions & 0 deletions resources/function_help/intersection
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/intersects
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/overlaps
@@ -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>
12 changes: 12 additions & 0 deletions resources/function_help/symDifference
@@ -0,0 +1,12 @@
<h3>symDifference function</h3>
Returns a geometry that represents the portions of a and b that do not intersect.

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

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

<h4>Example</h4>
<pre> geomToWKT( symDifference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 8 8)' )) ) &rarr; returns LINESTRING(5 5, 8 8)</pre>
13 changes: 13 additions & 0 deletions resources/function_help/touches
@@ -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>
12 changes: 12 additions & 0 deletions resources/function_help/union
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/within
@@ -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 4a40300

Please sign in to comment.