[GeoJSON] Aligning implementations

Tim Schaub noreply at geocartic.com
Tue Apr 10 11:25:19 PDT 2007


Chris Holmes wrote:
> 
>  {
>     'id': '2',
>     'default_geom': 'building'
>     'properties': {
>       'owner': 'Pete'
>       'lot':      {'type': 'Polygon', ...},
>       'building': {'type': 'Polygon', ...},
>     }
> }
> 

Ok, I don't think there is any reason to assume that there are 
limitations in any language (feature.properties[feature.default_geom] 
has an equivalent anywhere).

CASE 1
If every GeoJSON feature data structure looked like:

{
     'id': string,
     'geometry': object,
     'properties': object
}

Everybody would have one lookup for the geometry (think of it as the 
default_geometry if you like): feature.geometry (or equivalent).

Then you could extend this by shoving a bunch of additional geometries 
in the properties object.  And your application has to be configured to 
know that feature.properties.lot and feature.properties.building (or 
equivalent) are going to return geometries.

CASE 2
On the other hand, if the feature data structure looked like the 
lot/building example above, everybody would have two lookups to get the 
geometry (feature.properties[feature.default_geom] or equivalent).  And
your application still has to be configured to know that 
feature.properties.lot and feature.properties.building (or equivalent) 
are going to return geometries.

So, in summary, CASE 1 gives everybody a single lookup for geometry and 
you can extend GeoJSON and configure your application to know about 
building and lot.  CASE 2 gives everybody two lookups for geometry and 
you have to configure your application to know about building and lot.

Is there an advantage to CASE 2 that I am not seeing?

Tim


More information about the geojson mailing list