[GeoJSON] A first implementation

Chris Holmes cholmes at openplans.org
Mon Mar 19 17:29:14 PDT 2007


Ok, I threw together a quick implementation.  It's easy to change the 
details, and I probably haven't really captured discussion up to this 
point, but I thought it'd be easier to throw something up that clients 
could try to his.

http://sigma.openplans.org:8080/geoserver/wfs?request=GetCapabilities 
now has 'json' as an output format, so you can request any layer there 
with 'outputformat=json'  If anyone has a GeoServer and wants to try it 
locally I wrote it as a plug-in, I can email you the jar and you just 
drop it in.

The output can probably be summed up by:

{
   "features":[{
      "id":"alaska.1",
       "the_geom":{
         "type":"MultiPolygon",
         "members":[{
            "type":"Polygon",
            "exterior":{
               "type":"LinearRing",
               "coordinates":[-129.83,3.46,...,-95.47,21.51]
            }
         }]
       },
       "AREA":1759683.875,
       "PERIMETER":6689.362,
       "DESCRIPTION":"Alaska"
    }]
}

I left out SRS stuff (or I'm assuming a 4326 default).

Here are a few sample requests.  On the ones I include a maxfeature you 
probably want to use it or you'll get 6000 features.  If anyone wants to 
hit against more than 6000 features let me know, and I can raise it. 
The road layer has millions of features, if anyone wants to test seriously.

Point:
http://sigma.openplans.org:8080/geoserver/wfs?request=GetFeature&typename=gnis&maxfeatures=2&outputformat=json

LineString:
http://sigma.openplans.org:8080/geoserver/wfs?request=GetFeature&typename=roads&maxfeatures=2&outputformat=json

MultiPoint:
http://sigma.openplans.org:8080/geoserver/wfs?request=GetFeature&typename=topp:tasmania_cities&outputformat=json

MultiLine:
http://sigma.openplans.org:8080/geoserver/wfs?request=GetFeature&typename=tasmania_roads&outputformat=json

MultiPolygon:
http://sigma.openplans.org:8080/geoserver/wfs?request=GetFeature&typename=poly_landmarks&outputformat=json&maxfeatures=2

Chris

-- 
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/20070319/c1ee1660/attachment.vcf>


More information about the GeoJSON mailing list