[Geoserver-users] Could PointSymbolizer have VendorOption spaceAround

In same scale, different area has different number of poi. In city, it is
thick, but in town it is sparse.
So Could PointSymbolizer have VendorOption spaceAround just like
TextSymbolizer ? Or is there another way to solve this problem. Neither too
many nor too little buildings in one area.
--
View this message in context: http://www.nabble.com/Could-PointSymbolizer-have-VendorOption-spaceAround-tp22553063p22553063.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

shane_china ha scritto:

In same scale, different area has different number of poi. In city, it is
thick, but in town it is sparse.
So Could PointSymbolizer have VendorOption spaceAround just like
TextSymbolizer ? Or is there another way to solve this problem. Neither too
many nor too little buildings in one area.

Hmm... doing so would require some heavy lifting in the renderer code,
we should start keeping track of the areas that have been rendered
so far.
Please open an improvement request on jira.codehaus.org.

As for a workaround, well, our TextSymbolizer accepts a Graphics
inside of it, which is used to properly draw road shields, that
is, a graphic symbol with an overlapping label.

Here is an example:

<TextSymbolizer>
   <Geometry>
     <ogc:PropertyName>gen_1</ogc:PropertyName>
   </Geometry>
   <Label>
     <ogc:PropertyName>statehighway</ogc:PropertyName>
   </Label>

   <Font>
     <CssParameter name="font-family">Times New Roman</CssParameter>
     <CssParameter name="font-weight">Bold</CssParameter>
     <CssParameter name="font-size">10</CssParameter>

   </Font>

   <LabelPlacement>
     <PointPlacement>
       <AnchorPoint>
         <AnchorPointX>0.5</AnchorPointX>
         <AnchorPointY>0.5</AnchorPointY>
       </AnchorPoint>
     </PointPlacement>
   </LabelPlacement>

   <Fill>
     <CssParameter name="fill">#000000</CssParameter>
   </Fill>

   <Graphic>
     <ExternalGraphic>
       <OnlineResource xlink:href="circle_shield.gif"/>
       <Format>image/gif</Format>
     </ExternalGraphic>
     <Size>23</Size>
   </Graphic>

   <VendorOption name="group">yes</VendorOption>
   <VendorOption name="spaceAround">5</VendorOption>

</TextSymbolizer>

I guess that if you specify an empty label but use
a non empty shield you'll get what you want... but I did
not try, so let me know if this works.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Thank you for your answers. It works.
But both graphic and label I want. How do I make the label not overlapping
the graphic?
This question is similar to anther of mine. Could "<ExternalGraphic>" in
"<PointSymbolizer>" have "<PointPlacement>"?

I know one method for questions above, make the graphic higher and leave the
added space transparent.

Is there any better solution?
--
View this message in context: http://www.nabble.com/Could-PointSymbolizer-have-VendorOption-spaceAround-tp22553063p22557686.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

shane_china ha scritto:

Thank you for your answers. It works.
But both graphic and label I want. How do I make the label not overlapping
the graphic?
This question is similar to anther of mine. Could "<ExternalGraphic>" in
"<PointSymbolizer>" have "<PointPlacement>"?

I know one method for questions above, make the graphic higher and leave the
added space transparent.

Is there any better solution?

Ah no, for this case I have no quick solution. Maybe you can modify
your image so that it has some transparent space on top.
Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Thank you.
It seems that the only method is to change my image.
--
View this message in context: http://www.nabble.com/Could-PointSymbolizer-have-VendorOption-spaceAround-tp22553063p22571165.html
Sent from the GeoServer - User mailing list archive at Nabble.com.