FeatureServer -- RESTful Geographic Feature Storage

Project Info

Documentation

Demos

Related Projects

Related Info



The same geographic feature in OpenLayers and Google Earth, served from FeatureServer.

FeatureServer is an implementation of a RESTful Geographic Feature Service. (What is REST?) Using standard HTTP methods, you can fetch a representation of a feature or a collection of features, add new data to the service, or delete data from the service. Use it as an aggregator -- post your GeoRSS feeds to it, and then browse them using WFS. Use it as a translator: use the OGR DataSource to load a shapefile and open it in Google Earth. Use it in any way you like. This software is made available under an open source license by MetaCarta.

Download 1.12: .tar.gz, .zip | Full (with simplejson, wsgiref, paste libraries): .tar.gz, .zip | Changelog | Demo of FeatureServer in OpenLayers | Manual JSON Editing Demo | Upload/Edit KML

To set up your own FeatureServer:

FeatureServer supports multiple methods for input, output, and storage.

DataSource (Storage)

Service (Input/Output)

Setup

FeatureServer can be configured to use one of three different server configurations:

REST service

FeatureServer is a RESTful feature server implementation. What does this mean? It means that you use different HTTP methods to interact with the server, rather than creating long URL strings which don't really encapsulate what you want.

Adding data or updating entries in FeatureServer is done in a RESTful manner. Rather than create a long URL string, features can be retrieved by a URL identified by their ID and the output format as an extension, a la:

http://example.com/featureserver.cgi/scribble/1.atom
http://example.com/featureserver.cgi/scribble/1.kml
http://example.com/featureserver.cgi/scribble/1.gml
http://example.com/featureserver.cgi/scribble/1.json

To create data, simply POST GeoJSON, KML, or GeoRSS to the service:

curl -d @content-file http://example.com/featureserver.cgi/layer/create.json

To delete, use the DELETE method on the feature you wish to remove:

curl -X DELETE http://example.com/featureserver.cgi/layer/1.json

For querying you often want a subset of features: you can specify a maximum number of features using maxfeatures, bbox, or using the queryable attribute to specify a list of parameters which should be used for attribute queries:

http://example.com/featureserver.cgi/simple?bbox=-180,-90,0,0
http://example.com/featureserver.cgi/simple?maxfeatures=10
http://example.com/featureserver.cgi/simple?queryable=title,description&title=My%20Feature&description=Fun