5
votes
Accepted
Is there "label wrap on character" option in GeoServer GeoCSS?
I don't think this is currently possible in GeoServer, there is an autoWrap vendor option that allows you to specify a maximum width in pixels for a label but that breaks on white space not a ...
5
votes
Accepted
Combine attribute and zoom based style in GeoServer using CSS styling
Staying close to your current attempt, this seems to work:
* {
label: [No];
mark: symbol(circle);
[@sd >0][@sd <=6000]{ mark-size: 50m; font-size: 25;};
[@sd > 6000] [@...
4
votes
Accepted
Installing GeoServer extensions via pom file?
The querylayer jar is self contained, the css one has a number of other jars it depends onto (parboiled, asm, and so on), that is probably the reason why one works and the other does not.
4
votes
Accepted
Geoserver CSS line with different colors
The trick is to draw three dashed lines offset from each other so that a complete line is drawn. So first you draw a red dashed line with 3 pixel dashes and 6 pixel spaces, then an blue line with a 3 ...
4
votes
New line in Label ,CSS Geoserver
I've never tried it in CSS but in SLD you would use a CDATA block containing the new line:
<ogc:PropertyName>Name_1</ogc:PropertyName><![CDATA[
]]><ogc:PropertyName>Name_2&...
3
votes
Accepted
Dynamic CSS Style (CSS sld) to pass environment and property name variable
There is a filter function called "property" that can resolve a property based on the name it has been provided.
So something like this may work:
[ FEATURECLA = env('X', 'temp_min_deg_c) ] &...
2
votes
Accepted
GeoServer CSS Styling should be able to filter by type?
I believe this has little to do with CSS per se, it's just that the attribute checking happens before the FTS are selected out and it's not even considering that the rule would not actually apply to ...
2
votes
How to show single title for double CSS stroke in map legend
At the moment there is no way to show a single title, two SLD feature type styles with two rules are going to be generated no matter what language you use (CSS, ySLD and so on, all translate back to ...
2
votes
Geoserver linestring fill based on attribute value
You can, I would suggest removing the brackets from the [color] with the code as below;
[userid = 1] {
stroke: color;
stroke-width: 3px;
stroke-linecap: round;
z-index: 0, 1;
}
This ...
2
votes
Geoserver dashed line Styling
The CSS Cookbook shows an example of this
* {
stroke: blue;
stroke-width: 3px;
stroke-dasharray: 5 2;
}
2
votes
Accepted
geoserver CSS-Styling call WPS function
The CSS syntax does not allow to use functions with a colon in the middle of the name. Instead of building it as a WPS process, built it as a filter function instead, and you'll be able to give it a ...
2
votes
Accepted
CSS plugin triggers an error on Geoserver
This happened: https://osgeo-org.atlassian.net/browse/GEOS-8524
The ticket has been solved, but in the meantime, you can just remove the old asm 3.1 that was contained in it and it should be back ...
2
votes
Accepted
Legend in Geoserver generates wrong image
CSS is "cascading", so the rules are getting mixed with each other, generating two rules with the same title:
First rule covers 1:1 to 1:15k, and has the label and the stroke
Second rule activates ...
2
votes
Accepted
Geoserver's CSS Styling: using feature id
id is a keyword in CQL, you cannot use it like that. If you have a "id" attribute in your data, and it's visible in GeoServer layer page (e.g., it's not actually the primary key in a database, or you ...
2
votes
Does anyone know how to make OSM national_park style using GeoServer GeoCSS?
Try using stroke-offset, that can be sized in pixels, e.g.:
stroke: gray, green;
stroke-offset: 0, 2;
stroke-width: 1, 2;
2
votes
Accepted
Using GeoServer CSS styling, can you switch off transformation at a certain zoom scale?
CSS eventually gets transformed to SLD, where transformations happen at the FeatureTypeStyle level. So you need to force two separate FeatureTypeStyles.
The translation code does not do it for you, ...
2
votes
Geoserver 2.14.0 CSS styling - how to force label rendering similar to VendorOption "partials"
It seems not to be implemented in the CSS parser so if you wanted to you could (or sponsor someone else to) provide a pull request to implement it.
Update
This is now implemented in GeoTools 26.5 and ...
2
votes
Label Lower Left Corner Of Square Polygon SLD and Geoserver
If you can make sure during preprocessing/querying your data that the lower left corner is always the n-th (e.g. first) point in the geometry data, you could use the pointN function to get this point ...
2
votes
GeoServer CSS Generic Styles
No guarantees, but try to replace "geometry" with the empty string (the empty string indicates the default geometry, whatever its name is, while "geometry" means the actual ...
2
votes
GeoServer flips the WMS v1.3.0 image when applying a heatmap style on a layer with a CRS EPSG:4326
This is intended behaviour, and is required for WMS 1.3.0. Its documented as https://docs.geoserver.org/latest/en/user/services/wms/basics.html#axis-ordering
I would stick with WMS 1.1 unless you need ...
2
votes
Accepted
CSS style option equivalent to <VendorOption name=”inclusion”>mapOnly</VendorOption> in GeoServer
Correct, it still needs implementation. Pull requests welcomed ;-)
1
vote
Accepted
Polygon label parallel to line but inside polygon
You can get something pretty close using a negative buffer on the boundary of the polygon. Here it is in SLD (as I don't have CSS installed currently):
<TextSymbolizer>
<Geometry&...
1
vote
Geoserver 2.14.0 CSS styling - how to force label rendering similar to VendorOption "partials"
In the meantime, support for it has been added (around May 2022).
The property is called "label-partials".
1
vote
Accepted
Geoserver 2.14.0 CSS styling - how to force label rendering similar to VendorOption "partials"
The Geoserver CSS code for VendorOption "partials" for labels is
label-partials: false;
The VendorOptions are available in newer Geoserver versions that utilized newer implementation of ...
1
vote
Accepted
Does anyone know how to make OSM national_park style using GeoServer GeoCSS?
Assuming you want just the tiny one sided buffer you were very close,
what you were missing was the difference function:
fill-geometry: [difference(geom,buffer(geom, -200))];
This should work for you,...
1
vote
GeoServer CSS how to force labels onto map where boundaries are tight or narrow
Check out the label-fit-goodness property, should help:
https://docs.geoserver.org/stable/en/user/styling/css/properties.html
1
vote
GeoServer 2.18. Setting Min & Max Scales
When in doubt check the CSS Styling Cookbook - simply you use the "magic" scale denominator variable (@sd) in a filter.
* {
mark: symbol(circle);
}
:mark {
fill: #CC3300;
}
[@sd ...
1
vote
Hilight object on mouse hover or mouse click events in Geoserver css style
No, it is not possible GeoServer's CSS is for styling the features in a WMS only, so the output is an image and there is no support for :hover.
1
vote
GeoServer CSS Styling variable
* {
fill: [recode(strTrim(name),
'Akmola Region', env('color_Akmola','#6495ED'),
'Aktobe Region', env('color_Aktobe','#B0C4DE'))];
fill-opacity:0.4;
stroke: ...
1
vote
Creating group style file
The SLD can contain multiple < NamedLayer > allowing you to have multiple styles for multiple layers in a single SLD. In Geoserver you can apply a "Style Group" from within the "...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
geoserver-css-module × 57geoserver × 52
sld × 14
css × 9
style × 7
openlayers × 2
openstreetmap × 2
labeling × 1
symbology × 1
line × 1
legend × 1
filter × 1
linestring × 1
color × 1
encoding × 1
null × 1
cql-filter × 1
dynamic × 1
cql × 1
ysld × 1
maven × 1