[Geojson] FeatureCollection in FeatureCollection?

Christopher Schmidt crschmidt at metacarta.com
Wed Oct 29 13:31:59 PDT 2008


On Wed, Oct 29, 2008 at 08:07:05PM +0100, Henrik Hjelte wrote:
> Hello,
> 
> According to the specs,
> 1. You can not have a nested FeatureCollection in a FeatureCollection.
> 2. You can not have a Feature in a Feature.
> This is strange to me.
> 
> Consider this case:
> I have a map with a LineString that represents a route between two cities.
> Also I have a FeatureCollection of gas stations (Features).
> 
> I want to save this as one unit of geoJson.
> Naturally I would make it into a FeatureCollection.
> But a FeatureCollection can only contain Features, since quoting 2.3:
> >> """ Each element in the array is a feature object as defined above. """
> 
> Lets try that,
> I can put the LineString in a Feature, easy.
> But I can not put the FeatureCollection of gas stations in a Feature.

Why is it important that the gas stations are a FeatureCollection? I'd
simply make a FeatureCollection with one line, and multiple gas
stations. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the GeoJSON mailing list