[Geoserver-users] Multipolygons in SDL files

Hi

I'm trying to display a map based on a large amount of multipolygons from my
postgres/postgis server.

When i display them using the polygon style, everything is colored red and
the outlines of the polygons are shown correct. However I'm interested in
getting the polygons drawn with some color and the background beeing
white/transparent.

I've been looking at a lot of different SDL files but can't seem to find any
which use the multipolygons.

Do you know how to structure the SDL file so the geoserver can display
multipolygons?

The Image is get is the following

http://www.nabble.com/file/p12094211/wms.png

Rolf
--
View this message in context: http://www.nabble.com/Multipolygons-in-SDL-files-tf4249621.html#a12094211
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Rolf,

There is no specific style for multi polygons. Its all done with a
PolygonSymbolizer. To get a transparent polygons all you have to do is
leave off the "Fill" element. So something like:

<PolygonSymbolizer>
     <Stroke>
        <CssParameter name="stroke">#FF0000</CssParameter>
        <CssParameter name="stroke-width">1</CssParameter>
     </Stroke>
</PolygonSymbolizer>

-Justin

RolfKristensen wrote:

Hi

I'm trying to display a map based on a large amount of multipolygons from my
postgres/postgis server.

When i display them using the polygon style, everything is colored red and
the outlines of the polygons are shown correct. However I'm interested in
getting the polygons drawn with some color and the background beeing
white/transparent.

I've been looking at a lot of different SDL files but can't seem to find any
which use the multipolygons.

Do you know how to structure the SDL file so the geoserver can display
multipolygons?

The Image is get is the following

http://www.nabble.com/file/p12094211/wms.png

Rolf

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

This will only show the outline of the polygons.
as follows:
http://www.nabble.com/file/p12121998/2.png

However the output, I'm looking for, should look something like this:
http://www.nabble.com/file/p12121998/3.png

Rolf

Justin Deoliveira-4 wrote:

Hi Rolf,

There is no specific style for multi polygons. Its all done with a
PolygonSymbolizer. To get a transparent polygons all you have to do is
leave off the "Fill" element. So something like:

<PolygonSymbolizer>
     <Stroke>
        <CssParameter name="stroke">#FF0000</CssParameter>
        <CssParameter name="stroke-width">1</CssParameter>
     </Stroke>
</PolygonSymbolizer>

-Justin

RolfKristensen wrote:

Hi

I'm trying to display a map based on a large amount of multipolygons from
my
postgres/postgis server.

When i display them using the polygon style, everything is colored red
and
the outlines of the polygons are shown correct. However I'm interested in
getting the polygons drawn with some color and the background beeing
white/transparent.

I've been looking at a lot of different SDL files but can't seem to find
any
which use the multipolygons.

Do you know how to structure the SDL file so the geoserver can display
multipolygons?

The Image is get is the following

http://www.nabble.com/file/p12094211/wms.png

Rolf

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Multipolygons-in-SDL-files-tf4249621.html#a12121998
Sent from the GeoServer - User mailing list archive at Nabble.com.

RolfKristensen ha scritto:

This will only show the outline of the polygons.
as follows:
http://www.nabble.com/file/p12121998/2.png

However the output, I'm looking for, should look something like this:
http://www.nabble.com/file/p12121998/3.png

That is pretty much strange, the red color in the background
should be there only if there is:
* a big polygon that covers all of the area
* a linestring or multilinestring mixed among the multipolygons
   that is being filled anyways as the SLD spec mandates (the
   spec says that if a polygon symbolizer is applied to a linestring,
   that one has to be closed and treated as a polygon fill wise).

If the latter is the case, you either avoid to mix different
geometry types in the same column (some databases allow this)
or you can use the following filter to make sure the fill is
applied only to polygons:

<Rule>

   <ogc:Filter>
     <ogc:Or>
       <ogc:PropertyIsEqualTo>
         <ogc:Function name="geometryType">
           <ogc:PropertyName>geomColumn</ogc:PropertyName>
         </ogc:Function>
         <ogc:Literal>Polygon</ogc:Literal>
       </ogc:PropertyIsEqualTo>
       <ogc:PropertyIsEqualTo>
         <ogc:Function name="geometryType">
           <ogc:PropertyName>geomColumn</ogc:PropertyName>
         </ogc:Function>
         <ogc:Literal>Multipolygon</ogc:Literal>
       </ogc:PropertyIsEqualTo>
     </ogc:Or>
    </ogc:Filter>

   <PolygonSymbolizer>
     ...
</Rule>

Hope this helps. If not, can you send me a sample of your data
so that I can try to reproduce this behaviour?

Cheers
Andrea

Hi again

It was a polygon in the data which was destroyingmy picture.

Thanks for the help.

Rolf

aaime wrote:

RolfKristensen ha scritto:

This will only show the outline of the polygons.
as follows:
http://www.nabble.com/file/p12121998/2.png

However the output, I'm looking for, should look something like this:
http://www.nabble.com/file/p12121998/3.png

That is pretty much strange, the red color in the background
should be there only if there is:
* a big polygon that covers all of the area
* a linestring or multilinestring mixed among the multipolygons
   that is being filled anyways as the SLD spec mandates (the
   spec says that if a polygon symbolizer is applied to a linestring,
   that one has to be closed and treated as a polygon fill wise).

If the latter is the case, you either avoid to mix different
geometry types in the same column (some databases allow this)
or you can use the following filter to make sure the fill is
applied only to polygons:

<Rule>

   <ogc:Filter>
     <ogc:Or>
       <ogc:PropertyIsEqualTo>
         <ogc:Function name="geometryType">
           <ogc:PropertyName>geomColumn</ogc:PropertyName>
         </ogc:Function>
         <ogc:Literal>Polygon</ogc:Literal>
       </ogc:PropertyIsEqualTo>
       <ogc:PropertyIsEqualTo>
         <ogc:Function name="geometryType">
           <ogc:PropertyName>geomColumn</ogc:PropertyName>
         </ogc:Function>
         <ogc:Literal>Multipolygon</ogc:Literal>
       </ogc:PropertyIsEqualTo>
     </ogc:Or>
    </ogc:Filter>

   <PolygonSymbolizer>
     ...
</Rule>

Hope this helps. If not, can you send me a sample of your data
so that I can try to reproduce this behaviour?

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Multipolygons-in-SDL-files-tf4249621.html#a12127934
Sent from the GeoServer - User mailing list archive at Nabble.com.