Serving and filtering #GeoJSON from #GeoServer

The nice thing about setting up something like GeoServer, which is so feature rich, is when you need to pivot based on the demands of a new project, the technical infrastructure is already there, just waiting to be configured or turned on.

The case today: feature services.  Someone wants to use my existing infrastructure in a new application.  I typically serve tile services.  One checkbox to enable WFS; a couple clicks to see an example GeoJSON request, and


Ah.  That wasn’t so bad.  But wait, we need to filter the request!  GeoServer offers CQL and ECQL:

http://localhost:8080/geoserver/cm/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=cm:parks&outputFormat=json&cql_filter=(res=’Mildreds Favorite Park”)

Oops, I also need it reprojected on the fly to Google Mercator:

http://localhost:8080/geoserver/cm/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=cm:parks&outputFormat=json&cql_filter=(res=’Mildreds Favorite Park”)&srsName=EPSG:3857

Not too bad for a feature I hadn’t needed until today… .

One thought on “Serving and filtering #GeoJSON from #GeoServer

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s