Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only single layer of line marker displayed #13

Open
pvgenuchten opened this issue Sep 26, 2019 · 5 comments
Open

only single layer of line marker displayed #13

pvgenuchten opened this issue Sep 26, 2019 · 5 comments
Labels
SLD Issues related to SLD style (GeoServer)

Comments

@pvgenuchten
Copy link
Contributor

pvgenuchten commented Sep 26, 2019

On a multilayered line marker, only the first symbol layer is included in sld, i'm not sure if the multilayered line marker case is available in terms of sld spec, or implemented as such in geoserver

geostyler:

                    "kind": "Line",
                    "opacity": 1.0,
                    "perpendicularOffset": 1,
                    "graphicStroke": [
                        {
                            "opacity": 1,
                            "rotate": 0.0,
                            "kind": "Mark",
                            "color": "#ffffff",
                            "wellKnownName": "square",
                            "size": 11.3385826773,
                            "strokeColor": "#000000",
                            "strokeWidth": 1
                        },
                        {
                            "opacity": 1,
                            "rotate": 0.0,
                            "kind": "Mark",
                            "color": "#2395ff",
                            "wellKnownName": "square",
                            "size": 3.7795275591,
                            "strokeColor": "#000000",
                            "strokeWidth": 1
                        }
                    ],
                    "graphicStrokeInterval": 22.6771653546,
                    "graphicStrokeOffset": 1

SLD

<?xml version="1.0" ?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd">
  <NamedLayer>
    <Name>double-layered-line-marker</Name>
    <UserStyle>
      <Title>double-layered-line-marker</Title>
      <FeatureTypeStyle>
        <Rule>
          <Name>mr</Name>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>THEMA</ogc:PropertyName>
              <ogc:Literal>mr</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#ffffff</CssParameter>
              <CssParameter name="stroke-width">4.762204724466</CssParameter>
              <CssParameter name="stroke-opacity">1.0</CssParameter>
              <CssParameter name="stroke-linejoin">bevel</CssParameter>
              <CssParameter name="stroke-linecap">square</CssParameter>
            </Stroke>
            <PerpendicularOffset>1</PerpendicularOffset>
          </LineSymbolizer>
          <LineSymbolizer>
            <Stroke>
              <GraphicStroke>
                <Graphic>
                  <Mark>
                    <WellKnownName>square</WellKnownName>
                    <Fill>
                      <CssParameter name="fill">#ffffff</CssParameter>
                    </Fill>
                    <Stroke>
                      <CssParameter name="stroke">#000000</CssParameter>
                      <CssParameter name="stroke-width">1</CssParameter>
                    </Stroke>
                  </Mark>
                  <Opacity>1</Opacity>
                  <Size>11.3385826773</Size>
                  <Rotation>0.0</Rotation>
                </Graphic>
              </GraphicStroke>
              <CssParameter name="stroke-dasharray">11.3385826773 22.6771653546</CssParameter>
              <CssParameter name="stroke-dashoffset">1</CssParameter>
            </Stroke>
            <PerpendicularOffset>1</PerpendicularOffset>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Screen Shot 2019-09-26 at 11 10 54

double-layered-line-marker.qgz.zip

@pvgenuchten pvgenuchten changed the title only single layer of line marker converted only single layer of line marker displayed Sep 26, 2019
@pvgenuchten pvgenuchten added the SLD Issues related to SLD style (GeoServer) label Sep 26, 2019
@volaya
Copy link
Contributor

volaya commented Sep 30, 2019

I think this is a limitation of SLD. I could not find any docs or example about how to add several symbol layers for a line marker. Maybe @jodygarnett can confirm that. For now, the styler library just takes the first one of the symbol layers and ignore the rest

@volaya
Copy link
Contributor

volaya commented Sep 30, 2019

Checking the code, I see that I had already found a solution for that, by adding multiple line symbolizers, one for each symbol layer. However, there was an error in the code that prevented that solution to be applied. Should be working now

@pvgenuchten
Copy link
Contributor Author

Yes this could work, however currently the positioning of the 2 marks is a bit off, probably because they have different size, which would require different margins?

image
polyline-multilayer.qgz.zip

@pvgenuchten
Copy link
Contributor Author

pvgenuchten commented Oct 1, 2019

my impression is that:
(sym A size + sym A dash) should be the same as (sym B size + sym B dash)
B offset should be (0.5sym A size + sym A dash)+0.5sym b size

@volaya
Copy link
Contributor

volaya commented Oct 2, 2019

right, there is some offset. Not sure how to easily fix that. One of the symbol layers should be taken as the reference, and move the other ones according to its size...

GeoSander pushed a commit that referenced this issue Dec 8, 2021
* Install submodules in setup.py

* Create worflow to notify camptocamp/lyrx2sld on updates

* Add custom event type

* added support for HSV colors in arcgis format

* added library version

* some changes to style2style

* add version to SLD output

* added mapping for esri fonts markers

* Delete notify.yaml

* Add GitHub Action to notify lyrx2sld on updates

* Update notify.yaml

* Update notify.yaml

* fix for hatch fill from arcgis format

* Update mapping of ESRI symbols

* fixed case of no color value in arcgis format

* handle case of possible missing fieldValues in arcgis format

* fixed case of missing halo symbol in arcgis format

* correctly handle case of CIMUniqueValueRenderer with no groups

* support for CIMPictureMarker

* handle icons on style2style.py

This changes the return from togeostyler and fromgestyler methods for all formts

* handle case of missing label property in arcgis format

* show error on empty geostyler result

* added support for CIMClassBreaksRenderer

* prevent exception if rgb values are float in arcgis format

* round dash definition values when float values are used in arcgis format

* fixed issue with when arcgis style has no else rule

* fied cmyk2rgb conversion and usage of scale dependency for labels

* minor fixes for lyrx2geostyler conversion

* invert order of symbolizers when converting from lyrx into geostyler

* Reverse symbol order

* Typo

* reverted support for z-ordering

* removed unused method

* LYRX: don't convert outline of polygons to line symbolizer

* fixed dashed outlines and hatched fills in lyrx2geostyler conversion

* added support for concatenated strings from lyrx format

* removed unused code

* fixed concatenation of strings in labels in arcgis format

* added support for rotation in lyrx to geostyler conversion

Also, this commit fixes the handling of min/max scale denominators

* Fix rotation sign

* Add support for symbol transparency (#10)

* support whereClause in conversion of labels from lyrx (#11)

* Improve symbol support (#13)

* Use symbol fill color, refine opacity support

* Use stroke width, default to 0

* Default symbol fill color to white

* Add support for null value comparison (#14)

GEO-4833

* do not add polygon fill if not present in lyrx source

* added support for CIMGrayColor in lyrx

* added partial support for CIMVectorMarker

* correctly add 'group' vendor option in sld output

* fixed halos and class breaks in lyrx->geostyler conversion

* removed workflows

Co-authored-by: Cécile Vuilleumier <cecile.vuilleumier@camptocamp.com>
GeoSander pushed a commit that referenced this issue Mar 29, 2023
* Use symbol fill color, refine opacity support

* Use stroke width, default to 0

* Default symbol fill color to white
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SLD Issues related to SLD style (GeoServer)
Projects
None yet
Development

No branches or pull requests

2 participants