-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #896 from astroidex/master
added new help files for geometry functions
- Loading branch information
Showing
20 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ) → POINT(6 50)</pre> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
float → radius of buffer | ||
|
||
<h4>Example</h4> | ||
<pre> buffer($geometry, 10.5 ) → returns a polygon</pre> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> centroid($geometry) → returns a point geometry</pre> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> geomToWKT( combine( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5 )' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4, 2 1 )' )) ) → 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 )' )) ) → returns LINESTRING(3 3, 4 4, 6 6, 2 1) </pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'POINT( 0.5 0.5 )' )) → 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)' )) → returns 0</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> geomToWKT( convexHull( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 4 10)' )) ) → returns POLYGON((3 3,4 10,4 4,3 3)) </pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> crosses( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre> | ||
<pre> crosses( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 0</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> geomToWKT( difference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4)' )) ) → returns LINESTRING(4 4, 5 5)</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → 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)' )) → returns 1</pre> | ||
<pre> disjoint( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'POINT(4 4)' )) → returns 0</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> distance( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(4 8)' )) → returns 4</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → 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>') → returns a geometry</pre> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → Well-Known Text (WKT) representation of a geometry | ||
|
||
<h4>Example</h4> | ||
<pre> geomFromWKT( 'POINT(4 5)' ) → returns a geometry</pre> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry of your current feature | ||
|
||
<h4>Example</h4> | ||
<pre> geomToWKT( $geometry ) → POINT(6 50)</pre> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> geomToWKT( intersection( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 )' )) ) → returns LINESTRING(3 3, 4 4)</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> intersects( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre> | ||
<pre> intersects( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'POINT(5 5)' )) → returns 0</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> overlaps( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 5 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre> | ||
<pre> overlaps( geomFromWKT( 'LINESTRING(0 0 , 1 1)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 0</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> geomToWKT( symDifference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 8 8)' )) ) → returns LINESTRING(5 5, 8 8)</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> touches( geomFromWKT( 'LINESTRING(5 3 , 4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre> | ||
<pre> touches( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) → returns 0</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> geomToWKT( union( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) ) → returns MULTIPOINT(4 4, 5 5)</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 → geometry | ||
geometry → geometry | ||
|
||
<h4>Example</h4> | ||
<pre> within( geomFromWKT( 'POINT( 0.5 0.5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) → returns 1</pre> | ||
<pre> within( geomFromWKT( 'POINT( 5 5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) → returns 0</pre> |