[Geoserver-users] styling multiple geometries

Hi,

I have a layer with a linestring and point columns. I need to style a linestring with an attribute “prog” and an arrow (following line). In the same layer I have to render the point as well that is in a separate column with attribute “label_closer” and the_geom_closer geometry.

I followed suggestion from
http://docs.geoserver.org/stable/en/user/styling/sld-tipstricks/mixed-geometries.html

here is the result.

Inline images 2

the label near the arrow is not the “prog” attribute (that is missing) but the label_closer that should be rendered on point instead. Attached the full sld.

thanks

  • Antonio

multi.sld (5.62 KB)

Hi Antonio,
I think you should specify the geometry to use not only on LineSymbolizer and PointSymbolizer, but also on TextSymbolizer(s), to let GeoServer know where to put the label, which geometry to use as a center point.

Thanks.

image.png

···

2013/1/14 Antonio Parrotta <antonioparrotta@anonymised.com>

Hi,

I have a layer with a linestring and point columns. I need to style a linestring with an attribute “prog” and an arrow (following line). In the same layer I have to render the point as well that is in a separate column with attribute “label_closer” and the_geom_closer geometry.

I followed suggestion from
http://docs.geoserver.org/stable/en/user/styling/sld-tipstricks/mixed-geometries.html

here is the result.

Inline images 2

the label near the arrow is not the “prog” attribute (that is missing) but the label_closer that should be rendered on point instead. Attached the full sld.

thanks

  • Antonio

Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only – learn more at:
http://p.sf.net/sfu/learnmore_122412


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Morning Mauro,

it worked as you suggested. Appreciate. I added a second point and now the “prog” attribute is not displayed over the arrow (linestring). Second question is that now it is really slow. With this mixed points styling it is really unusable, navigate/zooming takes 10-20 seconds the layer to be displayed. Is there anything I can do to improve performance?

Thanks

  • Antonio

image.png

···

2013/1/14 Antonio Parrotta <antonioparrotta@anonymised.com84…>

Hi,

I have a layer with a linestring and point columns. I need to style a linestring with an attribute “prog” and an arrow (following line). In the same layer I have to render the point as well that is in a separate column with attribute “label_closer” and the_geom_closer geometry.

I followed suggestion from
http://docs.geoserver.org/stable/en/user/styling/sld-tipstricks/mixed-geometries.html

here is the result.

Inline images 2

the label near the arrow is not the “prog” attribute (that is missing) but the label_closer that should be rendered on point instead. Attached the full sld.

thanks

  • Antonio

Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only – learn more at:
http://p.sf.net/sfu/learnmore_122412


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

I got it working with sld attachet but is has become really slow. Geoserver starts to make heavy use of HD with apparently no reason. If I remove both points styling it works speedy Would you please give me some hints? The layer is actualy a view on a postgres DB

Thanks

  • Antonio

image.png

multi.sld (7.79 KB)

···

2013/1/14 Antonio Parrotta <antonioparrotta@anonymised.com84…>

Hi,

I have a layer with a linestring and point columns. I need to style a linestring with an attribute “prog” and an arrow (following line). In the same layer I have to render the point as well that is in a separate column with attribute “label_closer” and the_geom_closer geometry.

I followed suggestion from
http://docs.geoserver.org/stable/en/user/styling/sld-tipstricks/mixed-geometries.html

here is the result.

Inline images 2

the label near the arrow is not the “prog” attribute (that is missing) but the label_closer that should be rendered on point instead. Attached the full sld.

thanks

  • Antonio

Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only – learn more at:
http://p.sf.net/sfu/learnmore_122412


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

On Wed, Jan 16, 2013 at 9:29 PM, Antonio Parrotta <antonioparrotta@…84…> wrote:

I got it working with sld attachet but is has become really slow. Geoserver starts to make heavy use of HD with apparently no reason. If I remove both points styling it works speedy Would you please give me some hints? The layer is actualy a view on a postgres DB

The reason is likely that you’re trying to put into the map way too many labels, and GeoServer has to accumulate
all of them in memory in order to perform conflict resolution. Either that, or the database view is heavy and
PostgreSQL is strugglying getting the data out of the disk.

Labelling must always be accompained with some scale limitation to avoid having too many labels
end up on screen, or in the conflict resolution engine

See also:
http://demo.geo-solutions.it/share/foss4g2011/gs_steroids_sgiannec_foss4g2011.pdf

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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


Hello Andrea,

I tried to use scaledenominator but with few features (less than 100 ) it takes very long. I would investigate further but have no time right now, so I switched to use style in JS openlayers by implementing this solution

http://gis.stackexchange.com/questions/30901/label-in-the-middle-of-linestring-in-openlayers

thanks for the support

  • Antonio

On 18 January 2013 08:55, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Wed, Jan 16, 2013 at 9:29 PM, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

I got it working with sld attachet but is has become really slow. Geoserver starts to make heavy use of HD with apparently no reason. If I remove both points styling it works speedy Would you please give me some hints? The layer is actualy a view on a postgres DB

The reason is likely that you’re trying to put into the map way too many labels, and GeoServer has to accumulate
all of them in memory in order to perform conflict resolution. Either that, or the database view is heavy and
PostgreSQL is strugglying getting the data out of the disk.

Labelling must always be accompained with some scale limitation to avoid having too many labels
end up on screen, or in the conflict resolution engine

See also:
http://demo.geo-solutions.it/share/foss4g2011/gs_steroids_sgiannec_foss4g2011.pdf

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

mob: +39 339 8844549

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


On Fri, Jan 18, 2013 at 2:41 PM, Antonio Parrotta <antonioparrotta@…84…> wrote:

Hello Andrea,

I tried to use scaledenominator but with few features (less than 100 ) it takes very long. I would investigate further but have no time right now, so I switched to use style in JS openlayers by implementing this solution

http://gis.stackexchange.com/questions/30901/label-in-the-middle-of-linestring-in-openlayers

thanks for the support

Ok. For the future, it would be useful if you could open a jira with the sld used and a data
dump big enough to reproduce the problem

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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


Hello Andrea,

I switched to materialized views, well, it works like a charm. Thanks for your support.

Cheers

  • Antonio

On 18 January 2013 16:07, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Jan 18, 2013 at 2:41 PM, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

Hello Andrea,

I tried to use scaledenominator but with few features (less than 100 ) it takes very long. I would investigate further but have no time right now, so I switched to use style in JS openlayers by implementing this solution

http://gis.stackexchange.com/questions/30901/label-in-the-middle-of-linestring-in-openlayers

thanks for the support

Ok. For the future, it would be useful if you could open a jira with the sld used and a data
dump big enough to reproduce the problem

Cheers

Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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


Hi All,

I have a minor issue with styling a “followline” layer. I included rules reported below in the style and it works fine. The only problem I see is that in my layer tree I have three white icons for the followline layer. I suspect that these white icons are there because of the styling rules. How can I get rid of them?

thanks you all,

Antonio
the Rules:

trafdir W 20000.0 the_geom → Lucida Sans 18 #FF0000 true false trafdir A 20000.0 the_geom ← Lucida Sans 18 #FF0000 true false trafdir T 20000.0 the_geom ⇄ Lucida Sans 18 #a4bdc5 true false
  • Antonio

On 21 January 2013 22:45, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

Hello Andrea,

I switched to materialized views, well, it works like a charm. Thanks for your support.

Cheers

  • Antonio

On 18 January 2013 16:07, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Jan 18, 2013 at 2:41 PM, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

Hello Andrea,

I tried to use scaledenominator but with few features (less than 100 ) it takes very long. I would investigate further but have no time right now, so I switched to use style in JS openlayers by implementing this solution

http://gis.stackexchange.com/questions/30901/label-in-the-middle-of-linestring-in-openlayers

thanks for the support

Ok. For the future, it would be useful if you could open a jira with the sld used and a data
dump big enough to reproduce the problem

Cheers

Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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


Yes, each rule produces a separate legend.

If the rule differ in only a few elements based on an attribute condition, you can “invert the logic”, and use a function to select the appropriate symbology value. The Recode transformation function is probably the most elegant way of doing this:

http://docs.geoserver.org/latest/en/user/styling/sld-tipstricks/transformation-func.html#recode

On Tue, Jan 29, 2013 at 6:55 AM, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

Hi All,

I have a minor issue with styling a “followline” layer. I included rules reported below in the style and it works fine. The only problem I see is that in my layer tree I have three white icons for the followline layer. I suspect that these white icons are there because of the styling rules. How can I get rid of them?

thanks you all,

Antonio
the Rules:

trafdir W 20000.0 the_geom → Lucida Sans 18 #FF0000 true false trafdir A 20000.0 the_geom ← Lucida Sans 18 #FF0000 true false trafdir T 20000.0 the_geom ⇄ Lucida Sans 18 #a4bdc5 true false
  • Antonio

On 21 January 2013 22:45, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

Hello Andrea,

I switched to materialized views, well, it works like a charm. Thanks for your support.

Cheers

  • Antonio

On 18 January 2013 16:07, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Jan 18, 2013 at 2:41 PM, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

Hello Andrea,

I tried to use scaledenominator but with few features (less than 100 ) it takes very long. I would investigate further but have no time right now, so I switched to use style in JS openlayers by implementing this solution

http://gis.stackexchange.com/questions/30901/label-in-the-middle-of-linestring-in-openlayers

thanks for the support

Ok. For the future, it would be useful if you could open a jira with the sld used and a data
dump big enough to reproduce the problem

Cheers

Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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



Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only – learn more at:
http://p.sf.net/sfu/learnnow-d2d


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hello Martin,

that was exactly what I needed for, thanks a lot. It works!!

cheers

  • Antonio

On 29 January 2013 18:08, Martin Davis <mtnclimb@anonymised.com> wrote:

Yes, each rule produces a separate legend.

If the rule differ in only a few elements based on an attribute condition, you can “invert the logic”, and use a function to select the appropriate symbology value. The Recode transformation function is probably the most elegant way of doing this:

http://docs.geoserver.org/latest/en/user/styling/sld-tipstricks/transformation-func.html#recode

On Tue, Jan 29, 2013 at 6:55 AM, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

Hi All,

I have a minor issue with styling a “followline” layer. I included rules reported below in the style and it works fine. The only problem I see is that in my layer tree I have three white icons for the followline layer. I suspect that these white icons are there because of the styling rules. How can I get rid of them?

thanks you all,

Antonio
the Rules:

trafdir W 20000.0 the_geom → Lucida Sans 18 #FF0000 true false trafdir A 20000.0 the_geom ← Lucida Sans 18 #FF0000 true false trafdir T 20000.0 the_geom ⇄ Lucida Sans 18 #a4bdc5 true false
  • Antonio

On 21 January 2013 22:45, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

Hello Andrea,

I switched to materialized views, well, it works like a charm. Thanks for your support.

Cheers

  • Antonio

On 18 January 2013 16:07, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Jan 18, 2013 at 2:41 PM, Antonio Parrotta <antonioparrotta@anonymised.com> wrote:

Hello Andrea,

I tried to use scaledenominator but with few features (less than 100 ) it takes very long. I would investigate further but have no time right now, so I switched to use style in JS openlayers by implementing this solution

http://gis.stackexchange.com/questions/30901/label-in-the-middle-of-linestring-in-openlayers

thanks for the support

Ok. For the future, it would be useful if you could open a jira with the sld used and a data
dump big enough to reproduce the problem

Cheers

Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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



Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft

MVPs and experts. ON SALE this month only – learn more at:
http://p.sf.net/sfu/learnnow-d2d


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users