WFS style issue

233 views
Skip to first unread message

Tania Kirov

unread,
Aug 31, 2010, 2:39:06 AM8/31/10
to openscales-dev
Hello,
I have defined my layers and their default styles (using style
descriptors) in GEO Server. I have a WMS object for my base map which
gets the default style from GEO Server properly. The issue is that the
feature layers that I have defined as WFS are not getting the right
styles. I would like to specify the name of the style I want to use
for each WFS but I do not see how to do it. I can either put the style
as “point” and then it gets Style.getDefaultPointStyle() or if I leave
it blank I do not see the feature at all as the WFS object defines a
new Style() object without any Rule.

This is a part of the config xml file that pass to the
org.openscales.core.configuration.Configuration


<Layers>
<WMS name="Brisbane"
url="http://msdvmw04:8080/geoserver/wms"

layers="mincom:australia_administrative,mincom:australia_natural,mincom:australia_highway"
format="image/png"
isBaseLayer="true"
transparent="true"
maxExtent="150,-45,154,-9"
projection="EPSG:4326"/>
<WFS name="WORKORDER"
url="http://msdvmw04:8080/geoserver/wfs"
typename="mincom:GISVWORKORDER"
projection="EPSG:4326"
version="1.1.0"
useCapabilities="true"
capabilitiesVersion="1.1.0"
style="Point"/>

How can I let my feature layers use the styles that I have defined in
GEO Server for them?
Thank you
Regards,
Tania

Romaric Pascal

unread,
Aug 31, 2010, 5:33:05 AM8/31/10
to opensca...@googlegroups.com
Hi !

I'm afraid there is no built-in way to fetch your style on the Geoserver and have them used by your WFS layer to render your features (SLD parsing is not implemented yet). 

The good news is that the style API is really close to the SLD specifications (Style/Rules/Symbolizers, ...) so it shouldn't be too much of a burden to implement the following when loading the application (depending on how complex is your style) : 
 - request the SLD from your Geoserver
 - parse the XML to generate OpenScales Style object
 - give the generated style to your layer.

As a last resort, you could consider changing your WFS layer to a WMS one (so that Geoserver does the rendering), but that means loosing the client-side advantages of WFS (interaction with the features).

If you have any questions regarding these two solutions, feel free to ask ;)

Cheers !

Rhum



2010/8/31 Tania Kirov <tania...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "openscales-dev" group.
To post to this group, send email to opensca...@googlegroups.com.
To unsubscribe from this group, send email to openscales-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openscales-dev?hl=en.


Tania Kirov

unread,
Sep 1, 2010, 2:24:31 AM9/1/10
to openscales-dev
Thanks for the reply Rhum !

I’m not sure how to do the first step : “request the SLD from your
Geoserver”.
I make only one WMS request, for the base map, which has nothing to do
with the styles that I’ll be after.
Do I need to make an additional WMS requests for every layer that I
want to obtain the style for?

Regards,
Tania

Tania Kirov

unread,
Sep 28, 2010, 2:09:19 AM9/28/10
to openscales-dev


Could anybody help with finding out how to obtain the sld files from
GEO Server ?
If I do a WMS request it returns an image, I cannot find any
attributes of the WFS request that might bring back the sld file

Thanks

Romaric Pascal

unread,
Sep 28, 2010, 4:54:26 AM9/28/10
to opensca...@googlegroups.com
Hi !

There are two ways you can obtain the SLD files from a Geoserver. The first one is to use the GetStyles operation of the WMS protocol, as defined in http://portal.opengeospatial.org/files/?artifact_id=1188.

The second solution is to use Geoserver REST extension http://docs.geoserver.org/stable/en/user/extensions/rest/index.html to access the styles.

Either way will get you a SLD file (XML) you'll have to parse and transform into OpenScales Style objects. Hopefully, the architecture of the style API of OpenScales is quite close to SLD structure, which should simplify the process.

Regards.
Rhum



2010/9/28 Tania Kirov <tania...@gmail.com>

Munna

unread,
Apr 2, 2012, 7:59:09 AM4/2/12
to opensca...@googlegroups.com
Hello Romaric,
I am also facing the same problem, i wanted to change the styles of the WFS point layer. 

I have defined WFS layer.
I am not getting where i have to define the style.
this is my code..
<os:Map id="fxmap1" height="100%" width="100%" >

<os:WMS name="KarnatakaState" 
layers=" nurc:mosaic
format="image/jpeg" 
isBaseLayer="true">
</os:WMS>

<os:WFS name="AWSPOINTS" 
typename="Final:1sep11" 
projection="EPSG:4326" 
version="1.0.0" 
useCapabilities="true" 
capabilitiesVersion="1.0.0" 
style="{Style.getDefaultPointStyle()}">
</os:WFS>
</os:Map>

my WFS layer contains the rainfall information. I wanted to set a 4 rules for the quantity of rainfall and i need to show 4 jpeg image as the points for 4 rules,
 like for 
Rule1 is rainfall 0 to 25 rain1.jpeg
Rule2 is rainfall 25 to 50 rain2.jpeg
Rule3 is rainfall 50 to 75 rain4.jpeg 
Rule4 is rainfall 75 to 100 rain5.jpeg

my WFS layer contains data as,

name       lat        long     rainfall
A             13         70        15
B             14         70        80
C             15         70        30
D             16         70        58
E             13.5      70        70

Thanks in advance........

On Tuesday, September 28, 2010 2:24:26 PM UTC+5:30, Romaric Pascal wrote:
Hi !

There are two ways you can obtain the SLD files from a Geoserver. The first one is to use the GetStyles operation of the WMS protocol, as defined in http://portal.opengeospatial.org/files/?artifact_id=1188.

The second solution is to use Geoserver REST extension http://docs.geoserver.org/stable/en/user/extensions/rest/index.html to access the styles.

Either way will get you a SLD file (XML) you'll have to parse and transform into OpenScales Style objects. Hopefully, the architecture of the style API of OpenScales is quite close to SLD structure, which should simplify the process.

Regards.
Rhum



2010/9/28 Tania Kirov <tania...@gmail.com>


Could anybody help with finding out how to obtain the sld files from
GEO Server ?
If I do a WMS request it returns an image, I cannot find any
attributes of the WFS request that might bring back the sld file

Thanks

--
You received this message because you are subscribed to the Google Groups "openscales-dev" group.
To post to this group, send email to openscales-dev@googlegroups.com.
To unsubscribe from this group, send email to openscales-dev+unsubscribe@googlegroups.com.

WillPetty

unread,
Apr 2, 2012, 8:19:45 AM4/2/12
to opensca...@googlegroups.com
I implemented a Rest calls to get the geoserver styles... but had no idea about the GetStyles operation....Thanks
-Will



nanda kishor

unread,
Apr 3, 2012, 1:28:35 AM4/3/12
to opensca...@googlegroups.com, WillPetty
@ Will,

HI, can you guide me how to implement the REST calls to get the GeoServer styles in the OpenScales. 
I am using GeoServer 2.1.3, OpenScales 1.1.4 and Flex 3.. for the same rules in the previous mail..

Thanks in Advance,

Munna..


On Mon, Apr 2, 2012 at 5:49 PM, WillPetty <willpe...@gmail.com> wrote:
I implemented a Rest calls to get the geoserver styles... but had no idea about the GetStyles operation....Thanks
-Will

--
You received this message because you are subscribed to the Google Groups "openscales-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openscales-dev/-/AUoDh9va4wYJ.

To post to this group, send email to opensca...@googlegroups.com.
To unsubscribe from this group, send email to openscales-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openscales-dev?hl=en.



--

- Regards
  NANDA KISHOR.K.S
  M.Tech (RS & GIS)
  09738120522
  09986715366


WillPetty

unread,
Apr 3, 2012, 9:42:24 AM4/3/12
to opensca...@googlegroups.com
the Rest calls I have made are actually done through a remote Object in flex to a java back end EJB.

So the url request is done in java.

If your not looking at implementing the call in Java, I would take a look at the GetStyle operation.

-Will

nanda kishor

unread,
Apr 3, 2012, 10:05:19 AM4/3/12
to opensca...@googlegroups.com
@ Will,

Thank you for replying,

  Sir, 
 I  am not implementing the call in java. 

regards,
 munna

--
You received this message because you are subscribed to the Google Groups "openscales-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openscales-dev/-/dxPlTSS7vvsJ.

To post to this group, send email to opensca...@googlegroups.com.
To unsubscribe from this group, send email to openscales-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openscales-dev?hl=en.

WillPetty

unread,
Apr 12, 2012, 1:15:06 PM4/12/12
to opensca...@googlegroups.com

I'm also interesting in doing something like this.
I'm not sure it's possible to set style rules based on feature attributes, since it seems the feature attributes are not accessible until after the layer is drawn on the map.

-Will

WillPetty

unread,
Apr 13, 2012, 11:02:54 AM4/13/12
to opensca...@googlegroups.com
Hi Romaric,

As i understand it Geoserver can use things like a TextSymbolizer to show a feature as a attributes text... lets say Elevation for example(shown here)..........But the I'm not sure that is possible in Openscales, as the feature attributes are not available until they are already drawn on the map.

Any idea how one would implement  something like this?

basically what I'm saying is I'm not sure if theres a way to implement sld code like the following in openscales rules:

<TextSymbolizer>
  <Label>
    <ogc:Function name="numberFormat">
      <ogc:Literal>##</ogc:Literal>
      <ogc:PropertyName>ELEVATION</ogc:PropertyName>
    </ogc:Function>
  </Label>
</TextSymbolizer>


Thanks, Will

Rhum



2010/8/31 Tania Kirov <tania...@gmail.com>
To post to this group, send email to openscales-dev@googlegroups.com.
To unsubscribe from this group, send email to openscales-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages