-
Notifications
You must be signed in to change notification settings - Fork 7
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
[GEOS-11324] MapML vector style classes #362
[GEOS-11324] MapML vector style classes #362
Conversation
d8f691c
to
8f69db5
Compare
@prushforth this PR attempts to translate SLDs into CSS and apply it to the geometries, however, for what I've tried, we have little to play with. Basic line styles are working, the color of point symbolizes goes through, but for example the fill of polygon does not seem to be applied, and using fill or background-color does not seem to make a difference. To test, set a layer in "features" mode, without tiling. Do you have a list of CSS properties the client can work with? |
Not really - we are copying classes from the map-feature onto the svg <g> and child <path> that renders it, and including styles in the preceding sibling element as actual <style> elements. The new viewer will work better, I hope. I will test it later today (I'm at work right now and unable to build geoserver or do much useful work beyond email). It's going to be a case of updating the viewer to work with the new GeoServer capabilities in all likelihood, as we haven't had a ready source of vector data before this work. I will submit a PR to GeoServer main today that I hope to have finished by Friday, but which contains the 0.13.x version of the viewer. |
I apologize that our documentation of this feature is not up to date - that's my fault. It's also an area that we haven't had much call to work on, but having a ready source of styled vector content will definitely help motivate us and will shape the viewer's future capabilities. |
4473fa4
to
81f1e0f
Compare
No worries at all. It was straightforward to move the style class identifier up to the feature. The latest push is ready for your testing. |
Also, please note that there was a naming collision in Feature - the featuretype was being written to a "clazz" attribute that was aliased to "class". I changed that alias to "featuretype-class". |
That's by design, in SLD each symbolizer paints on top of the previous one, to generate visual effects like cased roads, complex symbols and the like. Can this be achieved without duplicating features? |
I think so, just put the symbolizers in the class attribute in order of rendering? |
Correct. It currently generates a feature for every symbolizer that is
applicable.
…On Thu, Mar 14, 2024 at 1:54 PM Peter Rushforth ***@***.***> wrote:
I believe the features are being duplicated - once for each symbolizer
perhaps?:
image.png (view on web)
<https://github.com/geosolutions-it/geoserver/assets/2437285/e6a368c5-67d4-412c-b030-1bedb44348d8>
—
Reply to this email directly, view it on GitHub
<#362 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHRJZ4WNTBM7H3THQ5VAEPDYYHP4FAVCNFSM6AAAAABEJJKCE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJYGAYTQOJVGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That's surprising... so I can put a stroke twice, with two different colors and two different sizes, to get an effect like this one: In CSS that's not possible, the second stroke definition would overwrite the first. Is SVG working differently? |
Our renderer is generating SVG so its the renderer that is doing the duplication. Part of the goal of this project is to find the limits of what is possible on the Web, especially in CSS wrt maps and push that as a change request. |
Should I delimit multiple classes with spaces, similar to CSS?
…On Thu, Mar 14, 2024 at 2:00 PM Peter Rushforth ***@***.***> wrote:
Can this be achieved without duplicating features?
Is SVG working differently?
Our renderer is generating SVG so its the renderer that is doing the
duplication. Part of the goal of this project is to find the limits of what
is possible on the Web, especially in CSS wrt maps and push that as a
change request.
—
Reply to this email directly, view it on GitHub
<#362 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHRJZ4UGTWCE3QLQM3WKRIDYYHQT7AVCNFSM6AAAAABEJJKCE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJYGAZTAOJUHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Yes, please |
Done and pushed. Please note that the latest push will convert the
geometry type to another type if the first symbolizer type does not match
what is found in the featuresource. Let me know if that is the right
approach or if you want me to remove that functionality and leave the
geometry type as is.
…On Thu, Mar 14, 2024 at 2:04 PM Peter Rushforth ***@***.***> wrote:
Should I delimit multiple classes with spaces, similar to CSS?
Yes, please
—
Reply to this email directly, view it on GitHub
<#362 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHRJZ4X6WLU7ZRCE644DZHLYYHRBNAVCNFSM6AAAAABEJJKCE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJYGAZTONRZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Actually, one more question: For the feature representation, should there
be a way to pass scale denominators/zoom layering information to the client
from the SLD Rules? If so where would you want to put that information in
the XML?
On Thu, Mar 14, 2024 at 2:46 PM Joseph Miller ***@***.***>
wrote:
… Done and pushed. Please note that the latest push will convert the
geometry type to another type if the first symbolizer type does not match
what is found in the featuresource. Let me know if that is the right
approach or if you want me to remove that functionality and leave the
geometry type as is.
On Thu, Mar 14, 2024 at 2:04 PM Peter Rushforth ***@***.***>
wrote:
> Should I delimit multiple classes with spaces, similar to CSS?
>
> Yes, please
>
> —
> Reply to this email directly, view it on GitHub
> <#362 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AHRJZ4X6WLU7ZRCE644DZHLYYHRBNAVCNFSM6AAAAABEJJKCE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJYGAZTONRZHA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
It's a good question, and I'm not sure I fully understand it. We think CSS will have a major role in deciding (at least, applying specified rules for) the scale / zoom ranges within which a feature should be rendered and with what properties. However that is getting out beyond the forseeable horizon. In the meantime, we spent A LOT of time working on the <map-feature zoom="..." min="..." max="..."> attributes. The So, long story short, we might eventually want to create a <map-link media="..."> attribute that contains a CSS media query that pertains to the map zoom to allow the viewer to automatically select which <map-link> to load based on the viewer zoom situation. In other words, no action is required at this time! I think! |
It seems this one is ready to become a PR for the official repository. Can you confirm? |
Good to go! |
cde6456
to
a1af45d
Compare
bb08ea6
to
8f13959
Compare
started on point sld conversion started on point radius size First pass at line styles added fill opacity added logging added tests and fixed issues for style visitor cleanup added cql-filter to sld filter test cleanup class text assigned class to features and added geom conversion added some comments and logging added tests and point to polygon cleanup fixed issue with null styles switched to midpoint moved style class to geometry and cleaned up style text spacing fixed test with new style spacing and leading dot moved class identifier to feature switched to one feature per symbolizer removed featuretype-class population misc cleanup more cleanup
8f13959
to
6d5e056
Compare
Joe - thanks for working on the scale-dependent symbolizers. I have tried it locally (rebased on main, actually). The following modified style rules for the states shapefile's population.sld (CBMTILE projection): <Rule>
<Title>> 4M</Title>
<!-- like a linesymbolizer but with a fill too -->
<ogc:Filter>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>PERSONS</ogc:PropertyName>
<ogc:Literal>4000000</ogc:Literal>
</ogc:PropertyIsGreaterThan>
</ogc:Filter>
<MinScaleDenominator>2000</MinScaleDenominator>
<MaxScaleDenominator>5000000</MaxScaleDenominator> <PolygonSymbolizer>
<Fill>
<!-- CssParameters allowed are fill (the color) and fill-opacity -->
<CssParameter name="fill">#4df7ff</CssParameter>
<CssParameter name="fill-opacity">0.7</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
<Rule>
<Title>> 4M</Title>
<!-- like a linesymbolizer but with a fill too -->
<ogc:Filter>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>PERSONS</ogc:PropertyName>
<ogc:Literal>4000000</ogc:Literal>
</ogc:PropertyIsGreaterThan>
</ogc:Filter>
<MinScaleDenominator>5000000</MinScaleDenominator>
<PolygonSymbolizer>
<Fill>
<!-- CssParameters allowed are fill (the color) and fill-opacity -->
<CssParameter name="fill">#4D4DFF</CssParameter>
<CssParameter name="fill-opacity">0.7</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule> works like this in the style previewer: Recording.2024-03-17.100519.mp4but the max scale denominator does not work quite as it does in the openlayers style preview: Recording.2024-03-17.101108.mp4 |
If I reverse the order of the rules it seems that it only picks up and applies the first rule. |
Found the bug. I was breaking out of the rule loop instead of
continuing to the next iteration (ugggh). Please pull and try again.
Joe
…On Sun, Mar 17, 2024 at 11:01 AM Peter Rushforth ***@***.***> wrote:
If I reverse the order of the rules it seems that it only picks up and
applies the first rule.
—
Reply to this email directly, view it on GitHub
<#362 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHRJZ4TRJQAA3RDSMSKZRR3YYWV5VAVCNFSM6AAAAABEJJKCE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGUYDANZRHA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
It works much better now! Thanks for your quick action. Probably won't get another look at it until tonight/tomorrow. |
Checklist
main
branch (backports managed later; ignore for branch specific issues).For core and extension modules:
[GEOS-XYZWV] Title of the Jira ticket
.