[GeoJSON] AsJSON(geometry)

Paul Ramsey pramsey at refractions.net
Sat Mar 17 15:37:27 PDT 2007


> I'm not sure how polygons and multipolygons should be expressed, but I 
> think that simpler geometries should be no more complex than
> 
>    {"type": "point", "value": [x1, x2, x3]}
>    {"type": "line",  "value": [[x11, x12, x13], ..., [xN1, xN2, xN3]]}

Rather than "line", "linestring" so it matches SFSQL WKT.

> One object with no children. Coordinates as arrays of numbers.
> 
> In my own work, I'm going to need multipoints before polygons or 
> multipolygons, and so that's what I've been thinking about lately. 
> Perhaps multi types would have geometry "members":
> 
>    {"type": "multipoint", "members": [
>      {"type": "point", ...},
>      {"type": "point", ...}
>      ]
>    }

I think that's needlessly fluffy. Once you know the typology, you can 
deal with anonymous arrays-of-arrays perfectly well. The only exception 
is GeometryCollection... do you want to handle anonymous collections?

Which brings out the possibility of beyond-SFSQL types.  CurveString, 
CompoundCurve, CurvePolygon, from ISO SQL/MM. Interest there?

Paul


-- 

   Paul Ramsey
   Refractions Research
   http://www.refractions.net
   pramsey at refractions.net
   Phone: 250-383-3022
   Cell: 250-885-0632



More information about the GeoJSON mailing list