开发者

Is there an extensible SQL like query language that is safe for exposing via a public API?

开发者 https://www.devze.com 2022-12-24 05:36 出处:网络
I want to expose some spatial (and a few non-spatial) datasets via a public API. The backend store will either be PostgreSQL/PostGIS, sqlite/spatialite, or CouchDB/GeoCouch.

I want to expose some spatial (and a few non-spatial) datasets via a public API. The backend store will either be PostgreSQL/PostGIS, sqlite/spatialite, or CouchDB/GeoCouch.

My goal is to find a some, preferably standard, way to allow people to make complex spatial queries against the data. I would like it to be a simple GET based request. The idea is to allow safe SQL type queries, without allowing unsafe ones. I would rather modify something th开发者_StackOverflow中文版at is off the shelf than doing the entire thing myself. I specifically want to support requesting specific fields from a table; joining results; and spatial functions that are already implemented by the underlying datastore.

Ideas anyone?


Have a look at CQL in geoserver (and other places such as geotools). It is a safe way to filter the results and doesn't expose raw SQL.

http://docs.codehaus.org/display/GEOTDOC/14+CQL

If you want you could also implement the CQL language in a servlet or something like that. It would be relatively simple to do through geotools.


I think I found what I was looking for: odata, Microsoft's newly released specification.

0

精彩评论

暂无评论...
验证码 换一张
取 消