[Geoserver-users] R: Q: map single row from PostGIS with WMS

Interesting issue.

I have a similar problem to solve just these days: to publish a map (with Geoserver, of course :wink: from a FeatureType styled with SLD, but where a single feature has to be highlighted.

I was thinking to solve this with an inline SLD: as per OGC specs, you can specify a style (an SLD document) directly into the WMS request URL. In this SLD I can put a filter based on the single feature id I'm interested (and I can style it in a different way, you can simply hide all the rest of the layer).

A question to the list: can I have the feature layer styled with its default SLD, and having added to this the SLD specified in the WMS URL? I mean, the resulting map should take into consideration both styles (inline and default).

Cheers,

Fabio

-----Messaggio originale-----
Da: geoserver-users-bounces@lists.sourceforge.net
[mailto:geoserver-users-bounces@lists.sourceforge.net] Per
conto di Just van den Broecke
Inviato: venerdì 23 febbraio 2007 15.36
A: geoserver-users@lists.sourceforge.net
Oggetto: [Geoserver-users] Q: map single row from PostGIS with WMS

Hi,

I need a GeoServer recipe for the following scenario. I have
the following sources:

- PostGIS table containing routes with unique id and a
geometry column as OGC LINESTRING
- remote WMS serving background maps

I need to configure/construct a request (WMS/WFS?) that draws
a single row (route) on a background map. The server should
do all the rendering.

Using GS 1.5.0rc1 I have been able to configure the PostGIS "route"
datasource and local GeoTIFF map data. I can render these as
layers using WMS requests. But I can't figure out how to
select a single row
(route) using WMS. I can select a row using WFS and
ogc-filter but that outputs GML. I also can calculate the
bbox extent of a single route. So two questions remain:

1- how to configure a remote WMS where GeoServer acts as proxy
2- how to (server-side) render a single PostGIS row on a map
served by the remote WMS

Any ideas (WMC?,custom WFS Outputformat?)/suggestions welcome ! best,

--Just

Just van den Broecke
http://www.justobjects.nl
The Netherlands

--------------------------------------------------------------
-----------
Take Surveys. Earn Cash. Influence the Future of IT Join
SourceForge.net's Techsay panel and you'll get the chance to
share your opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge
&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Thanks for the quick reply! That may do the trick. My next question on this is: will a Rule with a ogc-filter (like below) actually translate to a PostGIS query or is filtering applied in-process after all features in bbox have been returned ?

<Rule>
.
<ogc:Filter>
   <ogc:PropertyIsEqualTo>
     <ogc:PropertyName>ID</ogc:PropertyName>
     <ogc:Literal>12345</ogc:Literal>
   </ogc:PropertyIsEqualTo>
</ogc:Filter>

best,

Just

Fabio Da Soghe wrote:

Interesting issue.

I have a similar problem to solve just these days: to publish a map (with Geoserver, of course :wink: from a FeatureType styled with SLD, but where a single feature has to be highlighted.

I was thinking to solve this with an inline SLD: as per OGC specs, you can specify a style (an SLD document) directly into the WMS request URL. In this SLD I can put a filter based on the single feature id I'm interested (and I can style it in a different way, you can simply hide all the rest of the layer).

A question to the list: can I have the feature layer styled with its default SLD, and having added to this the SLD specified in the WMS URL? I mean, the resulting map should take into consideration both styles (inline and default).

Cheers,

Fabio

-----Messaggio originale-----
Da: geoserver-users-bounces@lists.sourceforge.net [mailto:geoserver-users-bounces@lists.sourceforge.net] Per conto di Just van den Broecke
Inviato: venerdì 23 febbraio 2007 15.36
A: geoserver-users@lists.sourceforge.net
Oggetto: [Geoserver-users] Q: map single row from PostGIS with WMS

Hi,

I need a GeoServer recipe for the following scenario. I have the following sources:

- PostGIS table containing routes with unique id and a geometry column as OGC LINESTRING
- remote WMS serving background maps

I need to configure/construct a request (WMS/WFS?) that draws a single row (route) on a background map. The server should do all the rendering.

Using GS 1.5.0rc1 I have been able to configure the PostGIS "route" datasource and local GeoTIFF map data. I can render these as layers using WMS requests. But I can't figure out how to select a single row
(route) using WMS. I can select a row using WFS and ogc-filter but that outputs GML. I also can calculate the bbox extent of a single route. So two questions remain:

1- how to configure a remote WMS where GeoServer acts as proxy
2- how to (server-side) render a single PostGIS row on a map served by the remote WMS

Any ideas (WMC?,custom WFS Outputformat?)/suggestions welcome ! best,

--Just

Just van den Broecke
http://www.justobjects.nl
The Netherlands

--------------------------------------------------------------
-----------
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge
&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--

--Just

Just van den Broecke just@anonymised.com
Just Objects B.V. tel +31 65 4268627 Skype: justb4
The Netherlands http://www.justobjects.nl

On 2/23/07, Just van den Broecke <just@anonymised.com> wrote:

Thanks for the quick reply! That may do the trick. My next question on
this is: will a Rule with a ogc-filter (like below) actually translate
to a PostGIS query or is filtering applied in-process after all features
in bbox have been returned ?

<Rule>
.
<ogc:Filter>
   <ogc:PropertyIsEqualTo>
     <ogc:PropertyName>ID</ogc:PropertyName>
     <ogc:Literal>12345</ogc:Literal>
   </ogc:PropertyIsEqualTo>
</ogc:Filter>

best,

Just

Using this example, all features in the bbox will be returned, and
then filtered. To filter geometries on the Postgis side, look into
using the "filter=" parameter in your request (that is not a part of
the wms specification document, if I am correct):

http://jira.codehaus.org/browse/GEOS-529

Alexander Petkov wrote:

On 2/23/07, Just van den Broecke <just@anonymised.com> wrote:

Thanks for the quick reply! That may do the trick. My next question on
this is: will a Rule with a ogc-filter (like below) actually translate
to a PostGIS query or is filtering applied in-process after all features
in bbox have been returned ?

<Rule>
.
<ogc:Filter>
   <ogc:PropertyIsEqualTo>
     <ogc:PropertyName>ID</ogc:PropertyName>
     <ogc:Literal>12345</ogc:Literal>
   </ogc:PropertyIsEqualTo>
</ogc:Filter>

best,

Just

Using this example, all features in the bbox will be returned, and
then filtered. To filter geometries on the Postgis side, look into
using the "filter=" parameter in your request (that is not a part of
the wms specification document, if I am correct):

http://jira.codehaus.org/browse/GEOS-529

Whoops, should have finished reading the list before I sent my mail.

Note I think we're doing datastore filtering of SLD's now, I believe we got a fix in a bit ago for that. So the SLD should turn it in to a PostGIS query, I believe. I could be wrong though.

Chris

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,45df09fa200291804284693!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

My guess would be that you can't mix SLD with default styling. If you had the default SLD and the custom one you could pass both in - you can specify a layer twice, with different SLDs or styles:

LAYERS=roads,roads&STYLE=blue,red

And can do that with a list of SLDs. But you can't do both.

Unfortunately we don't have GetStyle implemented, or you could grab the default that way.

What I would do is just make two WMS requests, one with the default, one with the inline SLD. I don't believe performance should suffer all that much, and it's the kind of thing WMS was designed for - to overlay different requests, in this case they're just coming from the same server.

best regards,

Chris

Fabio Da Soghe wrote:

Interesting issue.

I have a similar problem to solve just these days: to publish a map (with Geoserver, of course :wink: from a FeatureType styled with SLD, but where a single feature has to be highlighted.

I was thinking to solve this with an inline SLD: as per OGC specs, you can specify a style (an SLD document) directly into the WMS request URL. In this SLD I can put a filter based on the single feature id I'm interested (and I can style it in a different way, you can simply hide all the rest of the layer).

A question to the list: can I have the feature layer styled with its default SLD, and having added to this the SLD specified in the WMS URL? I mean, the resulting map should take into consideration both styles (inline and default).

Cheers,

Fabio

-----Messaggio originale-----
Da: geoserver-users-bounces@lists.sourceforge.net [mailto:geoserver-users-bounces@lists.sourceforge.net] Per conto di Just van den Broecke
Inviato: venerdì 23 febbraio 2007 15.36
A: geoserver-users@lists.sourceforge.net
Oggetto: [Geoserver-users] Q: map single row from PostGIS with WMS

Hi,

I need a GeoServer recipe for the following scenario. I have the following sources:

- PostGIS table containing routes with unique id and a geometry column as OGC LINESTRING
- remote WMS serving background maps

I need to configure/construct a request (WMS/WFS?) that draws a single row (route) on a background map. The server should do all the rendering.

Using GS 1.5.0rc1 I have been able to configure the PostGIS "route" datasource and local GeoTIFF map data. I can render these as layers using WMS requests. But I can't figure out how to select a single row
(route) using WMS. I can select a row using WFS and ogc-filter but that outputs GML. I also can calculate the bbox extent of a single route. So two questions remain:

1- how to configure a remote WMS where GeoServer acts as proxy
2- how to (server-side) render a single PostGIS row on a map served by the remote WMS

Any ideas (WMC?,custom WFS Outputformat?)/suggestions welcome ! best,

--Just

Just van den Broecke
http://www.justobjects.nl
The Netherlands

--------------------------------------------------------------
-----------
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge
&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,45df0013193207785049143!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Chris Holmes ha scritto:

My guess would be that you can't mix SLD with default styling. If you had the default SLD and the custom one you could pass both in - you can specify a layer twice, with different SLDs or styles:

LAYERS=roads,roads&STYLE=blue,red

If you need "red" layer to contain just a feature, use the FILTER=...
or the new CQL_FILTER=... parameters to filter the second layer so that
it contains just a feature.
CQL_FILTER is a bit new, and I still have to change its parsing a little, FILTER=... uses the same syntax as a WFS GET GetFeature request
(that is, a list of URL-encoded OGC filters, such as (<Filter>...</Filter)(<Filter>...</Filter>) where ( and ) act as
separators).
Both do work fine on 1.5.0rc1, do not really work in neither 1.4.0/1.4.1 releases.

Cheers
Andrea