dazuma/rgeo — Issue #18: MultiPoint parsing requires parentheses around Points
Author: dark-panda
Created: 2011-12-16 18:15:14+00:00
State: open

Although the OGC spec itself [1] appears to require that Points in a MultiPoint are surrounded by parentheses, actual implementations in the wild seem to make them optional. The following are both parsed successfully by GEOS and PostGIS for instance:

```sql
select ST_AsText('MULTIPOINT (0 0, 2 3)');
-- => MULTIPOINT(0 0,2 3)

select ST_AsText('MULTIPOINT ((0 0), (2 3))');
-- => MULTIPOINT(0 0,2 3)
```

```ST_AsText``` and ```ST_AsEWKT``` also output MultiPoints without parentheses. SQL Server apparently accepts both formats as well [2], although I can't confirm that directly.

RGeo appears to require the parentheses and will throw an exception without them:

```ruby
RGeo::Cartesian.factory.parse_wkt('MULTIPOINT (0 0, 2 3)')
# => RGeo::Error::ParseError: :begin expected but 0.0 found.
```

While it might not be strictly kosher according to the OGC specs, the fact is that these parentheses are used in the wild, so it might be prudent to have RGeo recognize both formats as well.

[1] http://www.opengeospatial.org/standards/sfa
[2] http://postgis.refractions.net/pipermail/postgis-users/2011-January/028586.html