[Geojson] FW: Features without geometry

Andrew Turner ajturner at highearthorbit.com
Wed Oct 3 07:37:52 PDT 2007


On 10/3/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> On Wed, Oct 03, 2007 at 08:15:40AM -0400, Andrew Turner wrote:
> > So, I'm still not clear if/how GeoJSON is used to just 'add'
> > geographic content to larger/richer JSON content.
>
> The GeoJSON geometry objects can be used in any other JSON.

Yeah, that's all I'm asking for in clarification - and probably
include in the documentation as well - to illustrate how it can be
used to "add to" existing JSON.

>
> > Can an example be
> > added for clarity - b/c I will definitely be mixing geographic &
> > non-geographic content together.
>
> I mentioned this on IRC, but if you can provide a use case -- specific
> example JSON that you don't understand how to add geo to -- then I'll
> give an example of how I would do it.

Here was my example from the previous thread on the same discussion.
It has 2 posts, one with geometry and another without any geometry. In
addition, I've added a bounding box to describe the area the posts
talk about.

{
 "blog" : {
   "posts" : [
     {
       "type" : "atom:item",
       "atom:summary": "post 1",
       "atom:description" : "i love blogging"},
     {
       "type" : "atom:item",
       "atom:summary": "post 2 from CA",
       "atom:description" : "i love geoblogging in California"
       "location" : {
         "type", "Point",
         "coordinates": [-120, 40]
       }
     },
   ],
   "location" : {
       "type", "Box",
       "coordinates": [[-121, 39], [-119, 41]]
     }
   }
 }
}

>
> > Also - regarding omitting vs. null geometry. KML ... valid without any
> > geometry element
>
> It is?
>
> "In KML, a <Placemark> can contain one or more geometry elements, such
> as a LineString, Polygon, or Model."
> -- http://code.google.com/apis/kml/documentation/kml_tut.html

According to the 'spec':
"Elements Specific to Placemark
    * 0 or one <Geometry> elements"
http://code.google.com/apis/kml/documentation/kml_tags_21.html#placemark

>
>
> > and RSS/Atom both are
> > valid without any geometry element.
>
> JSON is valid without any geometry element. GeoJSON is not. Atom is
> valid without geometry: GeoRSS is not 'georss' without the geometry.
> (Unless there is a claim that every RSS feed on the web is 'valid
> GeoRSS' :))

No, but including GeoRSS namespace doesn't require that every <entry>
or <item> have a <georss> element. So you can have a valid GeoRSS feed
(brings in the namespace) without any geometry. Same with KML.

>
> > So it seems odd that GeoJSON would
> > break that mold to require a null-geometry.
>
> I don't think it's breaking the mold, so far as I can tell.
>
> Nothing is preventing anyone from using the following JSON:
>
> {
>   "type": "Feature",
>   "properties": {"foo":"bar"}
> }
>
> But calling that GeoJSON seems strange to me.

Right, my point is that GeoJSON isn't *the* format, it is an
*extension* to a JSON format that provides Geographic features. So
instead of saying it *is* GeoJSON, I want to say my JSON document
*has* GeoJSON.

>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>


-- 
Andrew Turner
ajturner at highearthorbit.com      42.2774N x 83.7611W
http://highearthorbit.com              Ann Arbor, Michigan, USA
Introduction to Neogeography - http://oreilly.com/catalog/neogeography



More information about the GeoJSON mailing list