[Geoserver-users] Ability to filter datastore by attribute prior to serving as WMS

Hi all.
I'm in the process of getting up to speed in GeoServer.

I've got a PostGis database with a very long spatially enabled table.
Entries in this table are grouped according to an single field (a
foreign key).

From the GeoServer tutorial it just appears possible

to include this whole table as a single dataset - but that would
contain all of my data. I just want to plot one group at a time, and don't
wish to store each 'group' of data in its own table.

Am I missing something, is it possible for a WMS client to request
a filtered version of this table (filtered according to my foreign
key)?
cheers,
Ian

Hi Ian,

You can supply a filter in the request.
CQL_FILTER has the simplest syntax.

Could be something like this:

http://localhost:8080/geoserver/wms/request=getMap&........&CQL_FILTER=COLUMNNAME = VALUE

Let me know if you need more help then this fast short answer.

Cheers Kris

-----Original Message-----
From: Ian Mayo [mailto:ianmayo@anonymised.com]
Sent: Thursday, April 02, 2009 9:23 AM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] Ability to filter datastore by attribute prior toserving as WMS

Hi all.
I'm in the process of getting up to speed in GeoServer.

I've got a PostGis database with a very long spatially enabled table.
Entries in this table are grouped according to an single field (a
foreign key).

From the GeoServer tutorial it just appears possible

to include this whole table as a single dataset - but that would
contain all of my data. I just want to plot one group at a time, and don't
wish to store each 'group' of data in its own table.

Am I missing something, is it possible for a WMS client to request
a filtered version of this table (filtered according to my foreign
key)?
cheers,
Ian

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Ian Mayo ha scritto:

Am I missing something, is it possible for a WMS client to request
a filtered version of this table (filtered according to my foreign
key)?

A second alternative is to create views in the database, configure
their metadata (geometry_columns), and have GeoServer serve them
directoy (this road is the preferred one if you ever need to make
joins)

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hi,

If the foreign key column is not suitable for grouping with CQL_FILTER you can alternatively make views in PostGIS and publish them as separate WMS layers.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: Kris Geusebroek [mailto:kgeusebroek@anonymised.com]
Lähetetty: to 2.4.2009 10:30
Vastaanottaja: Ian Mayo; geoserver-users@lists.sourceforge.net
Aihe: Re: [Geoserver-users] Ability to filter datastore by attributeprior toserving as WMS

Hi Ian,

You can supply a filter in the request.
CQL_FILTER has the simplest syntax.

Could be something like this:

http://localhost:8080/geoserver/wms/request=getMap&........&CQL_FILTER=COLUMNNAME = VALUE

Let me know if you need more help then this fast short answer.

Cheers Kris

-----Original Message-----
From: Ian Mayo [mailto:ianmayo@anonymised.com]
Sent: Thursday, April 02, 2009 9:23 AM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] Ability to filter datastore by attribute prior toserving as WMS

Hi all.
I'm in the process of getting up to speed in GeoServer.

I've got a PostGis database with a very long spatially enabled table.
Entries in this table are grouped according to an single field (a
foreign key).

From the GeoServer tutorial it just appears possible

to include this whole table as a single dataset - but that would
contain all of my data. I just want to plot one group at a time, and don't
wish to store each 'group' of data in its own table.

Am I missing something, is it possible for a WMS client to request
a filtered version of this table (filtered according to my foreign
key)?
cheers,
Ian

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

thanks for that Andrea, but it happens that Kris' guidance exactly
meets what I was looking for.

thanks again,
Ian

On Thu, Apr 2, 2009 at 8:34 AM, Andrea Aime <aaime@anonymised.com> wrote:

Ian Mayo ha scritto:

Am I missing something, is it possible for a WMS client to request
a filtered version of this table (filtered according to my foreign
key)?

A second alternative is to create views in the database, configure
their metadata (geometry_columns), and have GeoServer serve them
directoy (this road is the preferred one if you ever need to make
joins)

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

--
Ian Mayo
PlanetMayo Ltd

Aah, a supplemental question for the group.

I've managed to filter my data and display it in OpenLayers - it's
just great, thanks.

Does anybody know if it's possible to apply a similar filter in NASA
WorldWind? I've tried supplying WorldWind with my composite WMS query
string that includes the layer name and CQL filter, but it just
returns the full list of available geoserver layers.

cheers,
Ian

On Thu, Apr 2, 2009 at 8:30 AM, Kris Geusebroek <kgeusebroek@anonymised.com> wrote:

Hi Ian,

You can supply a filter in the request.
CQL_FILTER has the simplest syntax.

Could be something like this:

http://localhost:8080/geoserver/wms/request=getMap&........&CQL_FILTER=COLUMNNAME = VALUE

Let me know if you need more help then this fast short answer.

Cheers Kris

Ian Mayo ha scritto:

Aah, a supplemental question for the group.

I've managed to filter my data and display it in OpenLayers - it's
just great, thanks.

Does anybody know if it's possible to apply a similar filter in NASA
WorldWind? I've tried supplying WorldWind with my composite WMS query
string that includes the layer name and CQL filter, but it just
returns the full list of available geoserver layers.

From what I can see Worldwind is doing a GetCapabilities request
there. WMS filtering is not part of the WMS standard, so you usually
cannot have it in a client you don't have control of (i.e., you
don't control how the requests are being made).

To support Worldwind I think you'll have to create views for
each subset, register them separately, so that Worldwind will
see them as separate layers.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Andrea,
thanks very much for your guidance - even if it isn't what I wanted to hear....

On Fri, Apr 3, 2009 at 2:19 PM, Andrea Aime <aaime@anonymised.com> wrote:

To support Worldwind I think you'll have to create views for
each subset, register them separately, so that Worldwind will
see them as separate layers.

unfortunately I'll have one data table containing many, many groups of
data - it won't be an option to create a view for each dataset.

I guess my ultimate solution is to modify or extend WorldWind to
support an optional query paramer.

thanks again,
Ian