[Featureserver] Further docs
yves.moisan at boreal-is.com
Mon Dec 8 11:52:49 EST 2008
Looking at the featureserver web site, it is not clear how to update an
existing feature. Looking in the code, I noticed FS does an update if a
url to an object is specified and an add otherwise. The web site doc is
misleading in a number of ways and here are my suggestions as to
contents it should provide :
ADDING/UPDATING content : POST
curl -d @content-file
"create.json" can be "all.json" or "anything.json", in fact anything
that doesn't go to one particular item in the collection. Just stopping
the url at "layer" will do.
I find "create.json" misleading here because since anything that doesn't
go to a specific object will do a create. It may be because I'm
clueless, but I would expect "create.json" to point to an actual FS
function (e.g. "update.json" ?). Changing the end of the url with e.g.
"1.json" and provided you have an object there the content-file will be
used to update the 1 item. This is worth emphasizing on the web site.
ADDING/UPDATING content : PUT
Commands also work with PUT. Just go :
curl -T content-file ...
For a reason I dont' know, PUT is much slower than POST. But either way
works. My reading on REST suggests using PUT for updates, so that's why
I ended up trying PUTting to FS.
curl -X DELETE http://example.com/featureserver.cgi/layer/1.json
looking at the curl doc, one would expect that -X UPDATE would work too
but AFAICT this is not the case in FeatureServer. Wouldn't it be
clearer (or an interesting alternative) if one could go
curl -X UPDATE
with some content-file reference ?
My 2 cents.
More information about the Featureserver