I am new to GeoServer. I have a PostGIS database and GeoServer setup. How can I query the database using the GeoServer/ Boundless SDK?

I have OpenGeo Suite 4.6 and I am trying to query the database in a custom WPS process. I don't want to directly connect to the database but use GeoServer SDK somehow to query the db.

  • 1
    This is a huge topic, much more than can be answered here. Can you provide a specific scenario - what your overall goal is, what you've already done, what you still need to accomplish, and what you tried and didn't work (plus what happened instead). Also versions might be useful. – BradHards May 14 '15 at 21:15

Rather than leaping direct to WPS you might find you can get what you need out of the GeoServer SQL View feature.

It allows you to write some arbitrary SQL and bind some query parameters into it, so the query becomes a dynamic thing you can manipulate from your client web code. So you can change filters, change the tables it hits, etc, all from the web client. Works for 90% of what most folks want direct SQL access for. If you want maps you can hit the view as a WMS and if you want features you can hit it as a WFS returning GeoJSON for ease of integration into your web app.

Not the answer you're looking for? Browse other questions tagged or ask your own question.