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

Does the parser support UnitOfMeasure? #892

Open
ghost opened this issue Sep 26, 2023 · 4 comments
Open

Does the parser support UnitOfMeasure? #892

ghost opened this issue Sep 26, 2023 · 4 comments
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Sep 26, 2023

Hello,
I wonder whether the parser supports uom in the Symbolizer element,
I got a SLD 1.1 style containing this LineSymbolizer

          <se:LineSymbolizer uom="http://www.opengeospatial.org/se/units/metre">
            <se:Stroke>
              <se:SvgParameter name="stroke">#333333</se:SvgParameter>
              <se:SvgParameter name="stroke-width">1600</se:SvgParameter>
              <se:SvgParameter name="stroke-linejoin">round</se:SvgParameter>
              <se:SvgParameter name="stroke-linecap">round</se:SvgParameter>
            </se:Stroke>
          </se:LineSymbolizer>

and I get verrrry wide lines so that the screen is filled. Another LineSymbolizer in the same style without uom and a small width works fine.
I read the SLD style and wrote it to a MB Style and displayed it in MapLibre.

@ghost ghost added the question Further information is requested label Sep 26, 2023
@ghost ghost assigned jansule and KaiVolland Sep 26, 2023
@KaiVolland
Copy link
Contributor

KaiVolland commented Sep 27, 2023

Yes, you can pass it to the constructor of the Parser: https://github.com/geostyler/geostyler-sld-parser/blob/master/src/SldStyleParser.ts#L61-L68

It requires SLDVersion to be set to 1.1.0.

But i'm actually not sure if the mapbox-styler-parser already supports this.

You might also want to try your style in the demo.

@ghost
Copy link
Author

ghost commented Sep 27, 2023

Thanks. I tried setting the version to 1.1.0. The symbolizerUnits setting is a global setting in the ctor, right?
My style has a per symbolizer setting (some use it and some not). That works in geostyler preview.
The SLDparser readStyle output has a 1600 width and no hint of a changed unit. should there be a unit member somewhere?

I tried the demo, changed the format to SLD 1.1, the units to meter and increased the width to 100 but I got a very wide line. Looks as if it doesn't work here, too.

@KaiVolland
Copy link
Contributor

KaiVolland commented Sep 27, 2023

Ok. We will leave this issue open then. This feature is more or less in an experimental stage.
Would be helpful if you could open a PR with a failing SLD example in /data/slds/1.1.

@ghost
Copy link
Author

ghost commented Sep 27, 2023

PR is #893 for symbolizer-specific SLD. Paste it into the demo to see the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
No open projects
Status: Todo
Development

No branches or pull requests

2 participants