Hi, again I tried altering your example (
http://demo1.geo-solutions.it/playground/styles/displace.sld ) using
different marker sizes without luck. What I'am doing wrong :-)
-Håvard
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>Attribute-based point</Name>
<UserStyle>
<Title>GeoServer SLD Cook Book: Attribute-based point</Title>
<FeatureTypeStyle>
<Rule>
<Name>SmallPop</Name>
<Title>1 to 50000</Title>
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>income_200</ogc:PropertyName>
<ogc:Literal>50000</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
<TextSymbolizer>
<Label><![CDATA[ ]]></Label>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFF00</ogc:Literal>
</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">
<ogc:Literal>#FF0000</ogc:Literal>
</CssParameter>
<CssParameter name="stroke-width">
<ogc:Literal>2</ogc:Literal>
</CssParameter>
</Stroke>
</Mark>
<Opacity>
<ogc:Literal>1.0</ogc:Literal>
</Opacity>
<Size>
<ogc:Literal>5</ogc:Literal>
</Size>
</Graphic>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0.5</AnchorPointX>
<AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
</PointPlacement>
</LabelPlacement>
<VendorOption name="maxDisplacement">16</VendorOption>
</TextSymbolizer>
</Rule>
<Rule>
<Name>MediumPop</Name>
<Title>50000 to 100000</Title>
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyName>income_200</ogc:PropertyName>
<ogc:Literal>50000</ogc:Literal>
</ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>income_200</ogc:PropertyName>
<ogc:Literal>100000</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:And>
</ogc:Filter>
<TextSymbolizer>
<Label><![CDATA[ ]]></Label>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFF00</ogc:Literal>
</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">
<ogc:Literal>#FF0000</ogc:Literal>
</CssParameter>
<CssParameter name="stroke-width">
<ogc:Literal>2</ogc:Literal>
</CssParameter>
</Stroke>
</Mark>
<Opacity>
<ogc:Literal>1.0</ogc:Literal>
</Opacity>
<Size>
<ogc:Literal>8</ogc:Literal>
</Size>
</Graphic>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0.5</AnchorPointX>
<AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
</PointPlacement>
</LabelPlacement>
<VendorOption name="maxDisplacement">16</VendorOption>
</TextSymbolizer>
</Rule>
<Rule>
<Name>LargePop</Name>
<Title>Greater than 100000</Title>
<ogc:Filter>
<ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyName>income_200</ogc:PropertyName>
<ogc:Literal>100000</ogc:Literal>
</ogc:PropertyIsGreaterThanOrEqualTo>
</ogc:Filter>
<TextSymbolizer>
<Label><![CDATA[ ]]></Label>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFF00</ogc:Literal>
</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">
<ogc:Literal>#FF0000</ogc:Literal>
</CssParameter>
<CssParameter name="stroke-width">
<ogc:Literal>2</ogc:Literal>
</CssParameter>
</Stroke>
</Mark>
<Opacity>
<ogc:Literal>1.0</ogc:Literal>
</Opacity>
<Size>
<ogc:Literal>10</ogc:Literal>
</Size>
</Graphic>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0.5</AnchorPointX>
<AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
</PointPlacement>
</LabelPlacement>
<VendorOption name="maxDisplacement">16</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
2011/9/22 Andrea Aime <[email protected]>:
> 2011/9/22 Håvard Wahl Kongsgård <[email protected]>:
>> Hi, I have a problem with overlapping points(identical XY). Googling I
>> found that Arcgis has a useful tool "Disperse Markers" which expands
>> clustered(overlapping points)
>> http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1313&pid=1306&topicname=Disperse_Markers_(Cartography)
>> . Is a similar feature available in geoserver/openlayers for expanding
>> point clusters on the fly? The math behind it must be very simple, so
>> the alternative is to created a new geom in postigs with expanded
>> clusters.
>
> There is a little trick you can employ. Text symbolizers in GeoServer
> can be associated
> to a graphic, which in the original intention was the "road plate", a
> background graphic
> that would be moved along with the label
>
> Now, if your label is empty space you can use label displacement to
> actually move away
> the points in a controlled way.
> The downside if you want is that if a new position cannot be found,
> not even by moving
> it around within the specified distance, the point won't be painted at all.
>
> Here is an example map with cities:
> http://demo1.geo-solutions.it/playground/GeoSolutions/wms?LAYERS=GeoSolutions%3Acities&STYLES=stars&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-0.59257250976506,38.661416015626,24.887332275391,51.617299804688&WIDTH=649&HEIGHT=330
>
> and here is the same with the trick above:
> http://demo1.geo-solutions.it/playground/GeoSolutions/wms?LAYERS=GeoSolutions%3Acities&STYLES=displace&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-0.59257250976506,38.661416015626,24.887332275391,51.617299804688&WIDTH=649&HEIGHT=330
>
> I guess you'll need to play a bit with it to get it right, but it may work.
> The full style is here:
> http://demo1.geo-solutions.it/playground/styles/displace.sld
>
> Cheers
> Andrea
>
>
> --
> -------------------------------------------------------
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax: +39 0584 962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -------------------------------------------------------
>
------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook
in minutes. BlackBerry App World™ now supports Android™ Apps
for the BlackBerry® PlayBook™. Discover just how easy and simple
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users