I am rather new to the geo-spatial open source technology scene (have been
a ESRI guy for many years) and have a question regarding a how to...we are
serving a geospatial data set (michigan counties) using Postgis/postgres
and Open Layers mapping. It is my understanding that the rendering of a
map, style/color fill etc., is done through SLD. It is possible for the
user/client to dictate the sld used in rendering features? Forgive me if I
have this wrong, but a custom SLD that is sent to Geoserver for rendering
in openlayers? Not to sure of the communication order. I have seen
references to "Custom SLD & making a WFS request to construct a SLD" which
sounds like what I am interested in but finding a tutorial on how to do
this has been difficult. Can anyone direct me in the right direction to
learn more on what I need to learn to do this?
My understanding is that you can create SLD xml file at your client-side and
passing both SLD url and style names in OpenLayers through a WMS layer. This
way you could control the rendering of output map from Geoserver. If you are
using WFS layer in OpenLayers then map rendering happens at client-side
within OpenLayers which is probably not using the same rendering syntax as
SLD.
Thanks,
Yingqi
D. Eric Keefauver-2 wrote:
I am rather new to the geo-spatial open source technology scene (have been
a ESRI guy for many years) and have a question regarding a how to...we are
serving a geospatial data set (michigan counties) using Postgis/postgres
and Open Layers mapping. It is my understanding that the rendering of a
map, style/color fill etc., is done through SLD. It is possible for the
user/client to dictate the sld used in rendering features? Forgive me if I
have this wrong, but a custom SLD that is sent to Geoserver for rendering
in openlayers? Not to sure of the communication order. I have seen
references to "Custom SLD & making a WFS request to construct a SLD" which
sounds like what I am interested in but finding a tutorial on how to do
this has been difficult. Can anyone direct me in the right direction to
learn more on what I need to learn to do this?
Ying has it right, just to clarify a bit for you. The easiest option
will be to add your custom sld to geoserver. A tutorial to do this can
be found here:
You can skip the initial part of adding data. Part of adding a style is
giving it a unique name. With this name you can specify the style in a
wms request, something like:
So as Ying stated, you need to configure your open layers map to pass
this parameter and value through. I believe this is one simply by using
the styles: 'myStyle' option to the map layer.
An alternative would be to configure GeoServer to make the new style the
"default" style so that when no style is specified it will rendered by
default.
I hope that helps. Note that none of this is dynamic. However the WMS
protocol does support specifyinga style on the fly as part of a request
with the SLD and SLD_BODY parameters. Not sure if that is what you need
or not.
If you have any more questions or if anything is unclear please ask away.
-Justin
Yingqi wrote:
Eric,
My understanding is that you can create SLD xml file at your client-side and
passing both SLD url and style names in OpenLayers through a WMS layer. This
way you could control the rendering of output map from Geoserver. If you are
using WFS layer in OpenLayers then map rendering happens at client-side
within OpenLayers which is probably not using the same rendering syntax as
SLD.
Thanks,
Yingqi
D. Eric Keefauver-2 wrote:
I am rather new to the geo-spatial open source technology scene (have been
a ESRI guy for many years) and have a question regarding a how to...we are
serving a geospatial data set (michigan counties) using Postgis/postgres
and Open Layers mapping. It is my understanding that the rendering of a
map, style/color fill etc., is done through SLD. It is possible for the
user/client to dictate the sld used in rendering features? Forgive me if I
have this wrong, but a custom SLD that is sent to Geoserver for rendering
in openlayers? Not to sure of the communication order. I have seen
references to "Custom SLD & making a WFS request to construct a SLD" which
sounds like what I am interested in but finding a tutorial on how to do
this has been difficult. Can anyone direct me in the right direction to
learn more on what I need to learn to do this?
I thank you both for your input. Very helpful and a good starting point
for what needs to be done.
Cheers,
Eric
Hi Eric,
Ying has it right, just to clarify a bit for you. The easiest option
will be to add your custom sld to geoserver. A tutorial to do this can
be found here:
You can skip the initial part of adding data. Part of adding a style is
giving it a unique name. With this name you can specify the style in a
wms request, something like:
So as Ying stated, you need to configure your open layers map to pass
this parameter and value through. I believe this is one simply by using
the styles: 'myStyle' option to the map layer.
An alternative would be to configure GeoServer to make the new style the
"default" style so that when no style is specified it will rendered by
default.
I hope that helps. Note that none of this is dynamic. However the WMS
protocol does support specifyinga style on the fly as part of a request
with the SLD and SLD_BODY parameters. Not sure if that is what you need
or not.
If you have any more questions or if anything is unclear please ask away.
-Justin
Yingqi wrote:
Eric,
My understanding is that you can create SLD xml file at your client-side
and
passing both SLD url and style names in OpenLayers through a WMS layer.
This
way you could control the rendering of output map from Geoserver. If you
are
using WFS layer in OpenLayers then map rendering happens at client-side
within OpenLayers which is probably not using the same rendering syntax
as
SLD.
Thanks,
Yingqi
D. Eric Keefauver-2 wrote:
I am rather new to the geo-spatial open source technology scene (have
been
a ESRI guy for many years) and have a question regarding a how to...we
are
serving a geospatial data set (michigan counties) using
Postgis/postgres
and Open Layers mapping. It is my understanding that the rendering of a
map, style/color fill etc., is done through SLD. It is possible for the
user/client to dictate the sld used in rendering features? Forgive me
if I
have this wrong, but a custom SLD that is sent to Geoserver for
rendering
in openlayers? Not to sure of the communication order. I have seen
references to "Custom SLD & making a WFS request to construct a SLD"
which
sounds like what I am interested in but finding a tutorial on how to do
this has been difficult. Can anyone direct me in the right direction to
learn more on what I need to learn to do this?
Eric Keefauver
Research Scientist
Michigan Tech Research Institute (MTRI)
3600 Green Court, Suite 100
Ann Arbor, MI 48105
Phone: 734-913-6862(p)
Fax: 734-913-6880(f)
eric.keefauver@anonymised.com http://www.mtri.org