irstv/H2GIS — pull request #52 by agouge (2013-11-26 14:34:09+00:00)
Title: [#8] Add convert functions except `ST_Force2D`, `ST_Force3D`

Here we add the following convert functions:

* `ST_Holes`
* `ST_InteriorPoint`
* `ST_PointsToLine`
* `ST_ToMultiLine`
* `ST_ToMultiPoint`
* `ST_ToMultiSegments`

#### Comparison with GDMS/PostGIS

* Add `ST_Holes`

This looks complicated in PostGIS. Something like:
```mysql
SELECT AsText(InteriorRingN(
GeometryN(geom, gn.n),
NumInteriorRings(GeometryN(geom, gn.n))))
AS geometryOfHole FROM areas,
generate_series(1, 1000) gn(n)
WHERE NumGeometries(geom) >= gn.n
AND NumInteriorRings(GeometryN(geom,gn.n)) > 0
```

See here:
http://lists.osgeo.org/pipermail/postgis-users/2007-August/016829.html

* Add `ST_InteriorPoint`

*Note*: PostGIS calls this `ST_PointOnSurface`. See also
`ST_Point_Inside_Circle`.

* Add `ST_PointsToLine`

*Note*: This is called `ST_MakeLine` in PostGIS. There are three versions:
```java
geometry ST_MakeLine(geometry set pointfield);
geometry ST_MakeLine(geometry point1, geometry point2);
geometry ST_MakeLine(geometry[] point_array);
```

For now, we only have the equivalent of (1) on (Multi)Points. For
MultiPoints, PostGIS has a separate function:
```java
geometry ST_LineFromMultiPoint(geometry aMultiPoint);
```

* Add `ST_ToMultiLine`

This seems to be possible in PostGIS only by doing something like
```mysql
SELECT ST_Multi(ST_Union(the_geom)) FROM myTable;
```

* Add `ST_ToMultiPoint`

*Note*: The only way this seems to be possible in PostGIS is via
```mysql
SELECT ST_Multi(ST_Union(the_geom)) FROM myTable
```

* Add `ST_ToMultiSegments`

This seems to be complicated in PostGIS. See
http://stackoverflow.com/questions/7595635/how-to-convert-polygon-data-into-line-segments-using-postgis

See #8.