[GeoJSON] Point as list of one point, or list of coords

Christopher Schmidt crschmidt at metacarta.com
Thu Apr 12 07:40:09 PDT 2007


On Thu, Apr 12, 2007 at 07:43:12AM -0600, Sean Gillies wrote:
> Christopher Schmidt wrote:
> > Two different representations are possible for point:
> > 
> >  [x,y]
> > 
> >  [[x,y]]
> > 
> > The former possibly makes more sense, but the latter means that any
> > geometry type can be transformed like so:
> > 
> > coords = " ".join(map(lambda x: ",".join(map(str, x)),
> >                      geometry['coordinates']))
> > 
> > Note that this also supports 3/4 d geometries. 
> > 
> > I'm strongly in favor of the latter, speaking as an implementor. 
> > 
> > Regards,
> 
> Then we'd have uniformity across points, line strings, and rings, but do 
> we want to unify with polygons as well and make everything an array of 
> arrays of arrays? That would begin to get awkward.

I wasn't under the impression that we were looking at polygons as an
array of rings, I thought they were just a single ring. In any case, my 
answer to that is 'no', but my opinion on points stands. :)  

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the GeoJSON mailing list