[Geoserver-users] Geoserver CSS Module

Good Day all. I am still having trouble with the Geoserver CSS Module with large CSS files.

I have two smaller CSS files that process nicely and produce expected SLD, but when I combine them, they produce a humungus 84K line sld

I am certain I am missing something, or have I have possibly hit a limitation of the CSS module.

ANy help or suggestions are very much appreciated.

The files are available at http://markware.net/css.zip

osmph_polys.csss (4 seconds to process) (160 lines)
osmph_polys.sld ( result = 2895 lines)

osmph_polys_landuse.csss (5 seconds to process) (357 lines)
osmph_polys_lamduse.sld ( result = 1209 lines)

osmph_polys_combined.csss ( 9 minutes to process, 100% cpu, 100% java Container Memory) (500 lines)
osmph_polys_combined.sld (result = 80,440 lines)

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

I expect you are producing a “power set” between when you combine your two files, this is often done by:

  1. only using rules to style
  2. doing your theme based on more than one aspect of your data
  • example; theme based on scale and attribute
  • example: theme based on two attributes
  • example: theme based on scale and several attributes

You can notice this if your resulting SLD has many rules that accomplish the same thing, except at a different scale (or with a different attribute combination).

Recommendation:

  1. Use rules for scale first! Since that only works for rules.

If you need to “break up the party” you can set up a group layer with several child layers - each child layer configured with CSS for a a different scale. Clients can draw the group layer and GeoServer will draw the appropriate child based on scale. This also has the key advantage of allowing you to draw simplified datasets when zoomed out which is a killer optimisation technique.

This approach will prevent a power set based on differences of scale, you are stuck with some duplicate configuration but you would get that anyway as you optimise performance.

  1. Use a combination of rules and symbology encoding functions when theming based on more that one attribute. This is especially useful when the aspect you are theming is contained like font size or polygon color.

Here is an example of recode from a workshop I am doing at foss4g this year:

  • {
    fill:[
    recode(mapcolor9,
    1,‘#8dd3c7’, 2,‘#ffffb3’, 3,‘#bebada’,
    4,‘#fb8072’, 5,‘#80b1d3’, 6,‘#fdb462’,
    7,‘#b3de69’, 8,‘#fccde5’, 9,‘#d9d9d9’)
    ];
    stroke: gray;
    stroke-width: 0.5;
    }

The alternative is:

[mapcolor9=1] {
fill: #8dd3c7;
}
[mapcolor9=2] {
fill: #ffffb3;
}
[mapcolor9=3] {
fill: #bebada;
}
[mapcolor9=4] {
fill: #fb8072;
}
[mapcolor9=5] {
fill: #80b1d3;
}
[mapcolor9=6] {
fill: #fdb462;
}
[mapcolor9=7] {
fill: #b3de69;
}
[mapcolor9=8] {
fill: #fccde5;
}
[mapcolor9=9] {
fill: #d9d9d9;
}

  • {
    stroke: gray;
    stroke-width: 0.5;
    }

Now if you imagine doing this with scale rules as well the power set idea is clear:

  1. With mapcolor9 rules and 5 zoom levels we have 45 SLD rules generated
  2. With mapcolor9 recode function and 5 zoom levels we have 5 SLD rules generated

Hope that helps Mark.

If you want to attend the workshop it is here: https://2014.foss4g.org/schedule/workshops/
Both the docs.geoserver.org and foss4g websites are down for me right now, hopefully they will be back when you get this.

···

Jody Garnett

On Wed, Jun 25, 2014 at 12:40 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Good Day all. I am still having trouble with the Geoserver CSS Module with large CSS files.

I have two smaller CSS files that process nicely and produce expected SLD, but when I combine them, they produce a humungus 84K line sld

I am certain I am missing something, or have I have possibly hit a limitation of the CSS module.

ANy help or suggestions are very much appreciated.

The files are available at http://markware.net/css.zip

osmph_polys.csss (4 seconds to process) (160 lines)
osmph_polys.sld ( result = 2895 lines)

osmph_polys_landuse.csss (5 seconds to process) (357 lines)
osmph_polys_lamduse.sld ( result = 1209 lines)

osmph_polys_combined.csss ( 9 minutes to process, 100% cpu, 100% java Container Memory) (500 lines)
osmph_polys_combined.sld (result = 80,440 lines)

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================


Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft


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

Hi Jody, Thanks so much.

I am definitely styling on Scale and Attribute, for example

[landuse=‘forest’][@scale>60000][@scale<100000]{

z-index: 30;
stroke: #CBEBB6;
fill: #CBEBB6, url(“http://icons.markware.net/geoserver/icons/img/areas/forest.png”);
fill-size: 20px;

}
[landuse=‘forest’][@scale<60000]{

z-index: 30;
stroke: #CBEBB6;
fill: #CBEBB6, url(“http://icons.markware.net/geoserver/icons/img/areas/forest.png”);
fill-size: 30px;

}

[landuse=‘commercial’][@scale<1000000] {
z-index: 40;

stroke: #5F9EA0;
fill: #87CEFA, url(“http://icons.markware.net/geoserver/icons/img/areas/commercial.png”);
stroke-width: 0.5px;
fill-opacity: 0.75;
label: [name];
font-size: 10px;
font-fill: #000000;

}
(I use scale a lot to change the colors or graphic fills, and have a ton of poly attributes to style)

I use z-index a lot to get the featuretypestyles in the right order.

I need to get my head out of SLD thinking … I think that is my biggest issue.

I would love to attend your workshop, but I am quite remote in the philippines so it is not practical for me, unfortunately. It is a loong way to travel, but I do avidly look forward to the published papers

Regards

Mark

···

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

On Wed, Jun 25, 2014 at 12:17 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

I expect you are producing a “power set” between when you combine your two files, this is often done by:

  1. only using rules to style
  2. doing your theme based on more than one aspect of your data
  • example; theme based on scale and attribute
  • example: theme based on two attributes
  • example: theme based on scale and several attributes

You can notice this if your resulting SLD has many rules that accomplish the same thing, except at a different scale (or with a different attribute combination).

Recommendation:

  1. Use rules for scale first! Since that only works for rules.

If you need to “break up the party” you can set up a group layer with several child layers - each child layer configured with CSS for a a different scale. Clients can draw the group layer and GeoServer will draw the appropriate child based on scale. This also has the key advantage of allowing you to draw simplified datasets when zoomed out which is a killer optimisation technique.

This approach will prevent a power set based on differences of scale, you are stuck with some duplicate configuration but you would get that anyway as you optimise performance.

  1. Use a combination of rules and symbology encoding functions when theming based on more that one attribute. This is especially useful when the aspect you are theming is contained like font size or polygon color.

Here is an example of recode from a workshop I am doing at foss4g this year:

  • {
    fill:[
    recode(mapcolor9,
    1,‘#8dd3c7’, 2,‘#ffffb3’, 3,‘#bebada’,
    4,‘#fb8072’, 5,‘#80b1d3’, 6,‘#fdb462’,
    7,‘#b3de69’, 8,‘#fccde5’, 9,‘#d9d9d9’)
    ];
    stroke: gray;
    stroke-width: 0.5;
    }

The alternative is:

[mapcolor9=1] {
fill: #8dd3c7;
}
[mapcolor9=2] {
fill: #ffffb3;
}
[mapcolor9=3] {
fill: #bebada;
}
[mapcolor9=4] {
fill: #fb8072;
}
[mapcolor9=5] {
fill: #80b1d3;
}
[mapcolor9=6] {
fill: #fdb462;
}
[mapcolor9=7] {
fill: #b3de69;
}
[mapcolor9=8] {
fill: #fccde5;
}
[mapcolor9=9] {
fill: #d9d9d9;
}

  • {
    stroke: gray;
    stroke-width: 0.5;
    }

Now if you imagine doing this with scale rules as well the power set idea is clear:

  1. With mapcolor9 rules and 5 zoom levels we have 45 SLD rules generated
  2. With mapcolor9 recode function and 5 zoom levels we have 5 SLD rules generated

Hope that helps Mark.

If you want to attend the workshop it is here: https://2014.foss4g.org/schedule/workshops/
Both the docs.geoserver.org and foss4g websites are down for me right now, hopefully they will be back when you get this.

Jody Garnett

On Wed, Jun 25, 2014 at 12:40 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Good Day all. I am still having trouble with the Geoserver CSS Module with large CSS files.

I have two smaller CSS files that process nicely and produce expected SLD, but when I combine them, they produce a humungus 84K line sld

I am certain I am missing something, or have I have possibly hit a limitation of the CSS module.

ANy help or suggestions are very much appreciated.

The files are available at http://markware.net/css.zip

osmph_polys.csss (4 seconds to process) (160 lines)
osmph_polys.sld ( result = 2895 lines)

osmph_polys_landuse.csss (5 seconds to process) (357 lines)
osmph_polys_lamduse.sld ( result = 1209 lines)

osmph_polys_combined.csss ( 9 minutes to process, 100% cpu, 100% java Container Memory) (500 lines)
osmph_polys_combined.sld (result = 80,440 lines)

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================


Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft


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

Hi Jody, in thinking through your remarks, in my last response would this
be a better approach to the example I gave?

[landuse='forest'][@scale>60000][@scale<100000]{
  fill-size: 20px;
}
[landuse='forest'][@scale<60000]{
  fill-size: 30px;
}
[landuse='commercial'][@scale<1000000] {
  z-index: 40;
  stroke: #5F9EA0;
  fill: #87CEFA, url("
http://icons.markware.net/geoserver/icons/img/areas/commercial.png&quot;\);
  stroke-width: 0.5px;
  fill-opacity: 0.75;
  label: [name];
  font-size: 10px;
  font-fill: #000000;
}

[landuse='forest']{
  z-index: 30;
  stroke: #CBEBB6;
  fill: #CBEBB6, url("
http://icons.markware.net/geoserver/icons/img/areas/forest.png&quot;\);
  }

Regards

Mark

Hi Jody, another example, (In case anyone else is struggling like me and needs an example)

Could I improve on this any way?

(I am trying to get a fill at 5M-1M with no graphic, then a graphic and a fill color at lower zoom levels, and labelling at < 100K)

/* @title forest 5M - 1M */
[landuse=‘forest’][@scale>1000000][@scale<5000000]
{
fill: #CBEBB6;
}

/* @title forest 1M - 100K */
[landuse=‘forest’][@scale>100000][@scale<1000000]
{
fill-size: 15px;
}

/* @title forest 100K - 60K */
[landuse=‘forest’][@scale>60000][@scale<100000]
{
fill-size: 20px;
font-size: 11px;
label: [name];
}

/* @title forest 6K - 0K */
[landuse=‘forest’][@scale<60000]
{
fill-size: 30px;
font-size: 12px;
label: [name];
}

[landuse=‘forest’]{
z-index: 30;
stroke-width: 0.75px;
fill-opacity: 0.75, 0.50;
font-fill: #eeeeee;
stroke: #CBEBB6;
fill: #CBEBB6, url(“http://icons.markware.net/geoserver/icons/img/areas/forest.png”);
}

Regards

Mark Cupitt

···

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

On Wed, Jun 25, 2014 at 12:42 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Hi Jody, in thinking through your remarks, in my last response would this be a better approach to the example I gave?

[landuse=‘forest’][@scale>60000][@scale<100000]{
fill-size: 20px;
}
[landuse=‘forest’][@scale<60000]{
fill-size: 30px;
}
[landuse=‘commercial’][@scale<1000000] {
z-index: 40;
stroke: #5F9EA0;
fill: #87CEFA, url(“http://icons.markware.net/geoserver/icons/img/areas/commercial.png”);
stroke-width: 0.5px;
fill-opacity: 0.75;
label: [name];
font-size: 10px;
font-fill: #000000;
}

[landuse=‘forest’]{
z-index: 30;
stroke: #CBEBB6;
fill: #CBEBB6, url(“http://icons.markware.net/geoserver/icons/img/areas/forest.png”);
}

Regards

Mark

I suppose I am just confused about the use of z-index there - I usually use a z-index 1 or 2 (and then only if needed based on funny overlapping - like simulating line casing, or ensuring that a polygon outline is drawn separately overtop of the fill).

I recommend trying very simple examples like this and reviewing the SLD that is produced.

···

Jody Garnett

On Wed, Jun 25, 2014 at 2:42 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Hi Jody, in thinking through your remarks, in my last response would this be a better approach to the example I gave?

[landuse=‘forest’][@scale>60000][@scale<100000]{
fill-size: 20px;
}
[landuse=‘forest’][@scale<60000]{
fill-size: 30px;
}
[landuse=‘commercial’][@scale<1000000] {
z-index: 40;
stroke: #5F9EA0;
fill: #87CEFA, url(“http://icons.markware.net/geoserver/icons/img/areas/commercial.png”);
stroke-width: 0.5px;
fill-opacity: 0.75;
label: [name];
font-size: 10px;
font-fill: #000000;
}

[landuse=‘forest’]{
z-index: 30;
stroke: #CBEBB6;
fill: #CBEBB6, url(“http://icons.markware.net/geoserver/icons/img/areas/forest.png”);
}

Regards

Mark

Hi Jody,

FYI, I tried the recode function, it is excellent, however, it does not reproduce this

stroke: #000000, #4169E1;

using …

stroke:[
recode(highway,
‘motorway’, ‘#000000, #4169E1

)];

Which is sad … that would be killer …

Cheers
Mark

···

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

On Wed, Jun 25, 2014 at 5:59 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

I suppose I am just confused about the use of z-index there - I usually use a z-index 1 or 2 (and then only if needed based on funny overlapping - like simulating line casing, or ensuring that a polygon outline is drawn separately overtop of the fill).

I recommend trying very simple examples like this and reviewing the SLD that is produced.

Jody Garnett

On Wed, Jun 25, 2014 at 2:42 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Hi Jody, in thinking through your remarks, in my last response would this be a better approach to the example I gave?

[landuse=‘forest’][@scale>60000][@scale<100000]{
fill-size: 20px;
}
[landuse=‘forest’][@scale<60000]{
fill-size: 30px;
}
[landuse=‘commercial’][@scale<1000000] {
z-index: 40;
stroke: #5F9EA0;
fill: #87CEFA, url(“http://icons.markware.net/geoserver/icons/img/areas/commercial.png”);
stroke-width: 0.5px;
fill-opacity: 0.75;
label: [name];
font-size: 10px;
font-fill: #000000;
}

[landuse=‘forest’]{
z-index: 30;
stroke: #CBEBB6;
fill: #CBEBB6, url(“http://icons.markware.net/geoserver/icons/img/areas/forest.png”);
}

Regards

Mark

Hi Jody, I am using the z-index as follows

In the polygon styling:
water z-index: 50;
forest z-index: 40;
national parks z-index: 30;

This should ensure that river polys are drawn over the top of forests and both drawn over the top of National Parks

The docs to not specify any magnitudes for it, and it appears to be a way of grouping styles within a feature type style and ordering the featuretypestyle so the rendering is as required.

For roads, I am using the following CSS

stroke: #000000, #3CB371;

stroke-width: 5.0px, 3.0px;

which forces two draws of the line. the first at #0000 5px, then drawn again with #3CB371 at 3px to give the thinner line with a black casing.

I do use z-index on the roads to ensure that motorways are drawn on top of trunks, which are drawn on top of primary’s, which are drawn on top of secondary’s, etc

Cheers

Mark

···

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

On Wed, Jun 25, 2014 at 5:59 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

I suppose I am just confused about the use of z-index there - I usually use a z-index 1 or 2 (and then only if needed based on funny overlapping - like simulating line casing, or ensuring that a polygon outline is drawn separately overtop of the fill).

I recommend trying very simple examples like this and reviewing the SLD that is produced.

Jody Garnett

On Wed, Jun 25, 2014 at 2:42 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Hi Jody, in thinking through your remarks, in my last response would this be a better approach to the example I gave?

[landuse=‘forest’][@scale>60000][@scale<100000]{
fill-size: 20px;
}
[landuse=‘forest’][@scale<60000]{
fill-size: 30px;
}
[landuse=‘commercial’][@scale<1000000] {
z-index: 40;
stroke: #5F9EA0;
fill: #87CEFA, url(“http://icons.markware.net/geoserver/icons/img/areas/commercial.png”);
stroke-width: 0.5px;
fill-opacity: 0.75;
label: [name];
font-size: 10px;
font-fill: #000000;
}

[landuse=‘forest’]{
z-index: 30;
stroke: #CBEBB6;
fill: #CBEBB6, url(“http://icons.markware.net/geoserver/icons/img/areas/forest.png”);
}

Regards

Mark

I don’t think you did that correctly - you were trying to provide two expressions right - for different z-indexs? So keep using two expressions:

stroke: [recode(highway, ‘motorway’, ‘#000000’)], [recode(highway, ‘motorway’, ‘#4169E1’)]

···

Jody Garnett

On Wed, Jun 25, 2014 at 8:33 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Hi Jody,

FYI, I tried the recode function, it is excellent, however, it does not reproduce this

stroke: #000000, #4169E1;

using …

stroke:[
recode(highway,
‘motorway’, ‘#000000, #4169E1

)];

Which is sad … that would be killer …

Cheers

Mark

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

On Wed, Jun 25, 2014 at 5:59 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

I suppose I am just confused about the use of z-index there - I usually use a z-index 1 or 2 (and then only if needed based on funny overlapping - like simulating line casing, or ensuring that a polygon outline is drawn separately overtop of the fill).

I recommend trying very simple examples like this and reviewing the SLD that is produced.

Jody Garnett

On Wed, Jun 25, 2014 at 2:42 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Hi Jody, in thinking through your remarks, in my last response would this be a better approach to the example I gave?

[landuse=‘forest’][@scale>60000][@scale<100000]{
fill-size: 20px;
}
[landuse=‘forest’][@scale<60000]{
fill-size: 30px;
}
[landuse=‘commercial’][@scale<1000000] {
z-index: 40;
stroke: #5F9EA0;
fill: #87CEFA, url(“http://icons.markware.net/geoserver/icons/img/areas/commercial.png”);
stroke-width: 0.5px;
fill-opacity: 0.75;
label: [name];
font-size: 10px;
font-fill: #000000;
}

[landuse=‘forest’]{
z-index: 30;
stroke: #CBEBB6;
fill: #CBEBB6, url(“http://icons.markware.net/geoserver/icons/img/areas/forest.png”);
}

Regards

Mark

On Wed, Jun 25, 2014 at 4:40 AM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Good Day all. I am still having trouble with the Geoserver CSS Module with
large CSS files.

I have two smaller CSS files that process nicely and produce expected SLD,
but when I combine them, they produce a humungus 84K line sld

I am certain I am missing something, or have I have possibly hit a
limitation of the CSS module.

ANy help or suggestions are very much appreciated.

The files are available at http://markware.net/css.zip

osmph_polys.csss (4 seconds to process) (160 lines)
osmph_polys.sld ( result = 2895 lines)

osmph_polys_landuse.csss (5 seconds to process) (357 lines)
osmph_polys_lamduse.sld ( result = 1209 lines)

osmph_polys_combined.csss ( 9 minutes to process, 100% cpu, 100% java
Container Memory) (500 lines)
osmph_polys_combined.sld (result = 80,440 lines)

Hi,
is it possible to share some of these long css styles?
I'm working on a java version of the css parser/translator (the current one
is written in scala)
and addressing directly the issue of large css styles by building an
efficient "filtered power set"
generator.

I'm still not done with the translator, so I cannot give you something to
try out, but it would
be nice to have some complex css styles to work against as tests

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 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 Andrea, no problem, I will just fix the recode as Jody suggested, that is a great way to do things and keeps the code small so woudl be good for you to test. I can alos give you my first cut as well, that is a little more traditions. Will zip them up and send them a bit later on.
Cheers
Mark Cupitt

···

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

On Wed, Jun 25, 2014 at 7:56 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Wed, Jun 25, 2014 at 4:40 AM, Mark Cupitt <markcupitt@anonymised.com84…> wrote:

Good Day all. I am still having trouble with the Geoserver CSS Module with large CSS files.

I have two smaller CSS files that process nicely and produce expected SLD, but when I combine them, they produce a humungus 84K line sld

I am certain I am missing something, or have I have possibly hit a limitation of the CSS module.

ANy help or suggestions are very much appreciated.

The files are available at http://markware.net/css.zip

osmph_polys.csss (4 seconds to process) (160 lines)
osmph_polys.sld ( result = 2895 lines)

osmph_polys_landuse.csss (5 seconds to process) (357 lines)
osmph_polys_lamduse.sld ( result = 1209 lines)

osmph_polys_combined.csss ( 9 minutes to process, 100% cpu, 100% java Container Memory) (500 lines)
osmph_polys_combined.sld (result = 80,440 lines)

Hi,
is it possible to share some of these long css styles?
I’m working on a java version of the css parser/translator (the current one is written in scala)
and addressing directly the issue of large css styles by building an efficient “filtered power set”
generator.

I’m still not done with the translator, so I cannot give you something to try out, but it would
be nice to have some complex css styles to work against as tests

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 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 Wed, Jun 25, 2014 at 2:35 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Hi Andrea, no problem, I will just fix the recode as Jody suggested, that
is a great way to do things and keeps the code small so woudl be good for
you to test. I can alos give you my first cut as well, that is a little
more traditions. Will zip them up and send them a bit later on.

Yep, having both versions would be great

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 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 Jody, that appears to have worked Ok (It generates two LineSymbolizers), thanks heaps for pointing that out.
Cheers
Mark

···

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

On Wed, Jun 25, 2014 at 7:42 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

I don’t think you did that correctly - you were trying to provide two expressions right - for different z-indexs? So keep using two expressions:

stroke: [recode(highway, ‘motorway’, ‘#000000’)], [recode(highway, ‘motorway’, ‘#4169E1’)]

Jody Garnett

On Wed, Jun 25, 2014 at 8:33 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Hi Jody,

FYI, I tried the recode function, it is excellent, however, it does not reproduce this

stroke: #000000, #4169E1;

using …

stroke:[
recode(highway,
‘motorway’, ‘#000000, #4169E1

)];

Which is sad … that would be killer …

Cheers

Mark

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

On Wed, Jun 25, 2014 at 5:59 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

I suppose I am just confused about the use of z-index there - I usually use a z-index 1 or 2 (and then only if needed based on funny overlapping - like simulating line casing, or ensuring that a polygon outline is drawn separately overtop of the fill).

I recommend trying very simple examples like this and reviewing the SLD that is produced.

Jody Garnett

On Wed, Jun 25, 2014 at 2:42 PM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Hi Jody, in thinking through your remarks, in my last response would this be a better approach to the example I gave?

[landuse=‘forest’][@scale>60000][@scale<100000]{
fill-size: 20px;
}
[landuse=‘forest’][@scale<60000]{
fill-size: 30px;
}
[landuse=‘commercial’][@scale<1000000] {
z-index: 40;
stroke: #5F9EA0;
fill: #87CEFA, url(“http://icons.markware.net/geoserver/icons/img/areas/commercial.png”);
stroke-width: 0.5px;
fill-opacity: 0.75;
label: [name];
font-size: 10px;
font-fill: #000000;
}

[landuse=‘forest’]{
z-index: 30;
stroke: #CBEBB6;
fill: #CBEBB6, url(“http://icons.markware.net/geoserver/icons/img/areas/forest.png”);
}

Regards

Mark

Hi Andrea, how did you go on the css module? Would be keen to try it if you need a tester?

Cheers

Mark

···

Regards

Mark Cupitt

“If we change the world, let it bear the mark of our intelligence”

Hire Me on Freelancer

See me on Open StreetMap

See me on LinkedIn

See me on StackExchange

===============================================================================================
The contents of this email are intended only for the individual(s) to whom it is addressed and may contain
confidential or privileged information. If you are not the intended recipient, you must not disclose, copy, distribute,
or use the contents of this email. If you have received this email in error, please notify the sender immediately and
delete the email and any attachments.

===============================================================================================

On Wed, Jun 25, 2014 at 7:56 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Wed, Jun 25, 2014 at 4:40 AM, Mark Cupitt <markcupitt@anonymised.com> wrote:

Good Day all. I am still having trouble with the Geoserver CSS Module with large CSS files.

I have two smaller CSS files that process nicely and produce expected SLD, but when I combine them, they produce a humungus 84K line sld

I am certain I am missing something, or have I have possibly hit a limitation of the CSS module.

ANy help or suggestions are very much appreciated.

The files are available at http://markware.net/css.zip

osmph_polys.csss (4 seconds to process) (160 lines)
osmph_polys.sld ( result = 2895 lines)

osmph_polys_landuse.csss (5 seconds to process) (357 lines)
osmph_polys_lamduse.sld ( result = 1209 lines)

osmph_polys_combined.csss ( 9 minutes to process, 100% cpu, 100% java Container Memory) (500 lines)
osmph_polys_combined.sld (result = 80,440 lines)

Hi,
is it possible to share some of these long css styles?
I’m working on a java version of the css parser/translator (the current one is written in scala)
and addressing directly the issue of large css styles by building an efficient “filtered power set”
generator.

I’m still not done with the translator, so I cannot give you something to try out, but it would
be nice to have some complex css styles to work against as tests

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 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