[GeoJSON] Aligning implementations
Chris Holmes
cholmes at openplans.org
Mon Apr 9 19:15:40 PDT 2007
I think that feels a bit hacky for me. If we're going for easy access
to the geometry, then we should actually have easy access to the
geometry. With the envelope client implementors would never be sure if
they were getting the real geometry or not.
I would still like a way to include more than one geometry. I can think
of two ideas.
1) if you want to include two geometries with specific property names
then you just put them as properties. One of them will be a duplicate
of whichever you put as the default.
2) For the one you picked as the default, instead of putting the full
geometry twice, for the one listed in properties you can just say
'default_geometry' or some such, which will signify the property is the
geometry one above.
I can't say I'm a _huge_ fan of either. But I'd like some way to
include more than one geometries so this doesn't break my software when
someone tries to serve it up from their db.
I suppose the other thing we could do is flip around where we put the
default, and the 'geometry' top level field gives you the name of the
geometry property.
{
'id': '2',
'default_geom': 'building'
'properties': {
'owner': 'Pete'
'lot': {'type': 'Polygon', ...},
'building': {'type': 'Polygon', ...},
}
}
I'm not sure if that actually makes it super easy to look up in
javascript though - if you do that is there an easy shortcut call to make?
feature.property(feature.default_geom.value()) or some sort of shortcut
call like that?
Chris
>
> Easy access to the geometry is the only justification (for me). A
> top-level geometry wouldn't preclude putting other geometries in the
> properties object under other names.
>
> What would you think about an envelope attribute at the root that could
> also serve as "the" geometry for the common, simple cases? Rewrite my
> previous example as:
>
> {
> 'id': '1',
> 'envelope': {
> 'type': 'Point', # Envelope of all geometries is a point
> 'coordinates': [...],
> }
> 'properties': {...}
> }
>
> and that's a degraded case of your more complex one:
>
> {
> 'id': '2',
> 'envelope': {
> 'type': 'Polygon',
> 'coordinates': [[...]],
> }
> 'properties': {
> 'lot': {'type': 'Polygon', ...},
> 'building': {'type': 'Polygon', ...},
> }
> }
>
> Cheers,
> Sean
>
--
Chris Holmes
The Open Planning Project
http://topp.openplans.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cholmes.vcf
Type: text/x-vcard
Size: 282 bytes
Desc: not available
URL: <http://lists.geojson.org/pipermail/geojson-geojson.org/attachments/20070409/473d412d/attachment-0005.vcf>
More information about the GeoJSON
mailing list