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

[GEOT-6503] Extend SLD to support background fill specification at the UserStyle level #2775

Merged
merged 1 commit into from
Feb 3, 2020

Conversation

aaime
Copy link
Member

@aaime aaime commented Jan 27, 2020

SLD background support with MBStyle leveraging it to get simpler, more reliable background layer.

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

For all pull requests:

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.
  • The changes are not breaking the build in downstream projects using SNAPSHOT dependencies, GeoWebCache and GeoServer.

The following are required only for core and extension modules (they are welcomed, but not required, for unsupported modules):

  • There is a ticket in Jira describing the issue/improvement/feature (a notable exemptions is, changes not visible to end users)
  • PR for bug fixes and small new features are presented as a single commit
  • Commit message must be in the form "[GEOT-XYZW] Title of the Jira ticket"
  • New unit tests have been added covering the changes
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • This PR passes the QA checks (QA checks results will be reported by travis-ci after opening this PR)
  • Documentation has been updated accordingly.

Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.


/** The background Fill , if any, <code>null</code> otherwise */
public default Fill getBackground() {
return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exciting you went for Fill

if (firstStyle.getBackground() != null) {
Paint background = styleFactory.getPaint(firstStyle.getBackground(), null, null);
graphics.setPaint(background);
graphics.fill(paintArea);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to make the image transparent, before applying your fill, in case the fill has some transparency effects?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, StreamingRenderer is given a Graphic2D, it should not alter what was done before on it (could have been used for overlay on top of other stuff for example). It should be simple and predictable, just do what it was asked to do (apply the background).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks that makes sense

Copy link
Member

@ianturton ianturton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. A fill definitely sounds like a good plan.

@aaime aaime force-pushed the sld_background branch 3 times, most recently from a4409d9 to 8daa5d3 Compare January 29, 2020 15:22
@aaime aaime marked this pull request as ready for review January 29, 2020 15:23
@aaime
Copy link
Member Author

aaime commented Jan 29, 2020

@ianturton @jodygarnett docs and tests completed, ready for actual review.

@aaime aaime changed the title Sld background [GEOT-6503] Extend SLD to support background fill specification at the UserStyle level Jan 29, 2020
@jodygarnett jodygarnett mentioned this pull request Feb 1, 2020
15 tasks
Copy link
Contributor

@dromagnoli dromagnoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
I have just reported a trivial typo, but is not a blocker for the approval :-)

StyledLayerDescriptor sld,
BackgroundMBLayer background,
FilterFactory2 ff) {
// Background does not use a source; construct a user later with a world extent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a minor TYPO here... layer instead of later

Copy link
Member

@jodygarnett jodygarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this out earlier and am keen to see it go ahead.

Andrea are you in position to update the checklist and merge?

@aaime aaime merged commit 87c989a into geotools:master Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants