Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add description for ST_GeometryN, ST_PointN, ST_InteriorRing #192

Merged
merged 2 commits into from
Feb 7, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions docs/dev/ST_GeometryN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,46 @@
layout: docs
title: ST_GeometryN
category: h2spatial/properties
description:
description: Return a element of a <code>GEOMETRYCOLLECTION</code>
prev_section: ST_ExteriorRing
next_section: ST_GeometryType
permalink: /docs/dev/ST_GeometryN/
---

### Signatures
### Signature

{% highlight mysql %}
GEOMETRY ST_GeometryN(GEOMETRY geom,integer i);
{% endhighlight %}

### Description


Returns a element number `i` of a `GEOMETRYCOLLECTION`.

{% include sfs-1-2-1.html %}

### Examples

{% highlight mysql %}
SELECT ST_GeometryN('MULTIPOLYGON(((0 0, 3 -1, 1.5 2, 0 0)),
((1 2, 4 2, 4 6, 1 6, 1 2)))', 1);
-- Answer: POLYGON((0 0, 3 -1, 1.5 2, 0 0))

SELECT ST_GeometryN('MULTILINESTRING((1 1, 1 6, 2 2, -1 2),
(1 2, 4 2, 4 6))', 2);
-- Answer: LINESTRING(1 2, 4 2, 4 6)

SELECT ST_GeometryN('MULTIPOINT((0 0), (1 6), (2 2), (1 2))', 2);
-- Answer: POINT(1 6)

SELECT ST_GeometryN('GEOMETRYCOLLECTION(
MULTIPOINT((4 4), (1 1), (1 0), (0 3)),
LINESTRING(2 6, 6 2), POINT(4 4),
POLYGON((1 2, 4 2, 4 6, 1 6, 1 2)))',3);
-- Answer: POINT(4 4)
{% endhighlight %}

##### See also

* [`ST_NumGeometries`](../ST_NumGeometries)
* <a href="https://github.com/irstv/H2GIS/blob/master/h2spatial/src/main/java/org/h2gis/h2spatial/internal/function/spatial/properties/ST_GeometryN.java" target="_blank">Source code</a>
14 changes: 10 additions & 4 deletions docs/dev/ST_InteriorRingN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,34 @@
layout: docs
title: ST_InteriorRingN
category: h2spatial/properties
description:
description: Return the interior ring of a <code>POLYGON</code>
prev_section: ST_GeometryType
next_section: ST_IsClosed
permalink: /docs/dev/ST_InteriorRingN/
---

### Signatures
### Signature

{% highlight mysql %}
LINESTRING ST_InteriorRing(GEOMETRY geom,integer i);
{% endhighlight %}

### Description


Returns the hole number`i` of a `POLYGON` or Null if parameter is not a `POLYGON`.

{% include sfs-1-2-1.html %}

### Examples
### Example

{% highlight mysql %}
SELECT ST_InteriorRingN('POLYGON((0 0, 10 0, 10 6, 0 6, 0 0),
(1 1, 2 1, 2 5, 1 5, 1 1),
(8 5, 8 4, 9 4, 9 5, 8 5))',2);
-- Answer: LINEARRING(8 5, 8 4, 9 4, 9 5, 8 5)
{% endhighlight %}

##### See also

* [`ST_ExteriorRing`](../ST_ExteriorRing)
* <a href="https://github.com/irstv/H2GIS/blob/master/h2spatial/src/main/java/org/h2gis/h2spatial/internal/function/spatial/properties/ST_InteriorRingN.java" target="_blank">Source code</a>
11 changes: 7 additions & 4 deletions docs/dev/ST_PointN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@
layout: docs
title: ST_PointN
category: h2spatial/properties
description:
description: Return the <code>POINT</code> i of a <code>LINESTRING</code>
prev_section: ST_NumPoints
next_section: ST_PointOnSurface
permalink: /docs/dev/ST_PointN/
---

### Signatures
### Signature

{% highlight mysql %}
POINT ST_PointN(Geometry geometry,integer i);
{% endhighlight %}

### Description


Returns the `POINT` number `i` of a `LINESTRING` or Null if the input parameter is not a `LINESTRING`.

{% include sfs-1-2-1.html %}

### Examples
### Example

{% highlight mysql %}
SELECT ST_PointN('LINESTRING(1 1, 1 6, 2 2, -1 2))', 2);
-- Answer: POINT(1 6)
{% endhighlight %}

##### See also
Expand Down