If you really only want one label per polygon, globally, then you can also
do some processing to condense each polygon to a single point for labelling
purposes.  If your polygons are bigger than your map viewer this can result
in unlabelled polygons for particular viewing areas though, so usually this
technique should be limited to zoom levels where your features generally fit
inside your viewport.

The SLD code would look something like:

<TextSymbolizer>
   <Label>
      <ogc:Function name="centroid">
         <ogc:Literal>the_geom</ogc:Literal>
      </ogc:Function>
   </Label>
   <Fill>
      <CssParameter name="fill">#000000</CssParameter>
   </Fill>
</TextSymbolizer>

Hope this helps.

--
David Winslow
OpenGeo - http://opengeo.org/

On Mon, Nov 15, 2010 at 8:34 AM, Andrea Aime
<andrea.a...@geo-solutions.it>wrote:

> On Mon, Nov 15, 2010 at 1:29 PM, Sasikumar Kanniyappan
> <arcdevelo...@gmail.com> wrote:
> > Hello List,
> >
> >               I am trying to display single label for each polygon, but
> am
> > getting multiple label for single polygon. After several searches, I came
> to
> > know about the "On the fly meta tiler" will resolve multiple label issue.
> So
> > I implemented the "On the fly meta tiler" in my application, by adding
> > TILED=yes&TILESORIGIN=x,y along with WMS request.The thing is the label
> got
> > reduced but still getting multiple label for single polygon and not able
> to
> > display single label for each polygon. Can anyone help me on this?
>
> Stop using tiled requests. Really, it's the only way to make duplicate
> labels
> go away, meta tiles reduce the problem, the more the bigger they are,
> but at the meta tiles borders you'll always get duplicate labels.
>
> Now, in theory it would be possible to run a gigantic preprocessor that
> lays out the positions of all the labels for all the zoom levels, but that
> has never been done and still assumes you're always playing with
> the same layers (e.g., like Google does)
>
> For the rest of the world, use tiling and tile caches for your base layers,
> and dynamic wms requests for every overlay and anything that
> requires labels.
>
> Cheers
> Andrea
>
> -----------------------------------------------------
> Ing. Andrea Aime
> Senior Software Engineer
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584962313
> fax:     +39 0584962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -----------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Centralized Desktop Delivery: Dell and VMware Reference Architecture
> Simplifying enterprise desktop deployment and management using
> Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
> client virtualization framework. Read more!
> http://p.sf.net/sfu/dell-eql-dev2dev
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to