2

If anyone please, could gimme me a hand on this question. I have a web sql client that the user can write a sql statement and I want to sent it via WFS to geoserver, run it, and based on the results, to mark on map what I have found.

So, I know that the geoserver supports views and I can send parameters to a view, but, Isn't it possible to send my custom sql query directly to the geoserver?

david_p
  • 1,783
  • 1
  • 19
  • 34
DiLIVIO
  • 21
  • 2
  • The standard way in WFS (and other OGC services) is to use filters. This MapServer document hopefully helps you to start playing with them http://mapserver.org/ogc/filter_encoding.html. This is good start for GeoServer http://suite.opengeo.org/opengeo-docs/geoserver/filter/ – user30184 Dec 12 '14 at 19:16

1 Answers1

2

Yes, sort of. You can't send arbitrary SQL to GeoServer, but you can use a subset of SQL with the CQL_FILTER parameter.

http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html

With CQL you can do filtering including intersects and attribute filtering. For more complicated queries you might have to write a custom WPS process.

stuporglue
  • 603
  • 4
  • 9