Discussion:
[Geoserver-users] Labels Burst out of their Polygons
FunkMonkey33
2017-06-29 21:23:03 UTC
Permalink
I've seen a lot of posts like "I want to render a label, even if the polygon
is too small to fit it".My problem is the opposite: I want to make sure that
a label only will render if it fits in its polygon.Supposedly that's the
default behavior, yet here is this:
<Loading Image...> I believe
that a label will render if half of it will fit in the bounding box of the
polygon. In this case, that's not what's happening, as you can see. Also,
I'd really rather have it only render if all of it fits within the polygon,
or at least it's bounding box.Here is my SLD:<?xml version="1.0"
encoding="UTF-8"?> default_polygon Default Polygon
A sample style that draws a polygon base
Green Polygon A polygon with a green fill and a 1 pixel outline
#00B200 0.1 #00B200
1 geom
name Arial 12
normal bold
0.5 0.5
#00B200 2
#000000
true 0.9 60 0



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Labels-Burst-out-of-their-Polygons-tp5326100.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Andrea Aime
2017-06-30 07:29:54 UTC
Permalink
On Thu, Jun 29, 2017 at 11:23 PM, FunkMonkey33 <
Post by FunkMonkey33
I've seen a lot of posts like "I want to render a label, even if the
polygon is too small to fit it". My problem is the opposite: I want to make
sure that a label only will render if it fits in its polygon. Supposedly
that's the default behavior, yet here is this: I believe that a label
will render if half of it will fit in the bounding box of the polygon. In
this case, that's not what's happening, as you can see. Also, I'd really
rather have it only render if all of it fits within the polygon, or at
least it's bounding box. Here is my SLD: default_polygon A sample style
that draws a polygon base A polygon with a green fill and a 1 pixel
outline #00B200 0.1 #00B200 1 geom name Arial 12 normal bold 0.5 0.5
#00B200 2 #000000 true 0.9 60 0
The screenshot reminds me a lot of KML rendering in Google Earth. Did you
just make it look that way, or is that KML indeed?
I'm asking because for KML there is no way to control the relationship
between label size and polygon size, it's the client that decides

Cheers
Andrea
--
Regards,

Andrea Aime

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo Ú consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
FunkMonkey33
2017-06-30 15:32:23 UTC
Permalink
Hi Andrea,

No, it's not KML. It's a basic polygon, coming from GWC/WMS, being served
by postgis. We render it as an ImageMapType class, which is Google Maps'
version of a tile layer.

Aaron



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Labels-Burst-out-of-their-Polygons-tp5326100p5326263.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

Geoserver-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Edward Mac Gillavry
2017-06-30 07:38:54 UTC
Permalink
Hi,

Did you investigate the goodnessOfFit vendor option
(http://docs.geoserver.org/latest/en/user/styling/sld/reference/labeling.html#goodnessoffit).
That way you can nudge the label placement algorithm.

Best,

Edward
Post by FunkMonkey33
I've seen a lot of posts like "I want to render a label, even if the
polygon is too small to fit it". My problem is the opposite: I want to
make sure that a label only will render if it fits in its polygon.
Supposedly that's the default behavior, yet here is this: I believe
that a label will render if half of it will fit in the bounding box of
the polygon. In this case, that's not what's happening, as you can
see. Also, I'd really rather have it only render if all of it fits
default_polygon Default Polygon A sample style that draws a polygon
base Green Polygon A polygon with a green fill and a 1 pixel outline
#00B200 0.1 #00B200 1 geom name Arial 12 normal bold 0.5 0.5 #00B200 2
#000000 true 0.9 60 0
------------------------------------------------------------------------
View this message in context: Labels Burst out of their Polygons
<http://osgeo-org.1560.x6.nabble.com/Labels-Burst-out-of-their-Polygons-tp5326100.html>
Sent from the GeoServer - User mailing list archive
<http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html> at
Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html
https://lists.sourceforge.net/lists/listinfo/geoserver-users
FunkMonkey33
2017-06-30 15:33:56 UTC
Permalink
Hi Edward,

Yes, we did play around with that. You can see in my SLD above that we are
using a value of 0.9 for this. Using 1.0 doesn't help either.

Thanks.

Aaron



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Labels-Burst-out-of-their-Polygons-tp5326100p5326265.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

Geoserver-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Andrea Aime
2017-07-01 08:34:49 UTC
Permalink
Hi,
in this case I encourage you to open a ticket on
https://osgeo-org.atlassian.net/projects/GEOS/summary
The ticket has to be reproducible on a developer machine, so please attach
a sample data set,
the full style, and a request showing the bug in action, against a
supported version of GeoServer (2.10.x or 2.11.x)

Cheers
Andrea


On Fri, Jun 30, 2017 at 5:33 PM, FunkMonkey33 <
Post by FunkMonkey33
Hi Edward,
Yes, we did play around with that. You can see in my SLD above that we are
using a value of 0.9 for this. Using 1.0 doesn't help either.
Thanks.
Aaron
--
View this message in context: http://osgeo-org.1560.x6.
nabble.com/Labels-Burst-out-of-their-Polygons-tp5326100p5326265.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/
userlist-guidelines.html
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Regards,

Andrea Aime

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo Ú consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
Loading...