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
Allow ExternalGraphic image to be used for GetCapabilities and GetLegendGraphics #551
Conversation
To test the above branch:
|
Jody, thanks for working on this. I'm sorry for not getting back to you sooner. I'll checkout your branch and do some testing. Michael Romero |
Thanks @mike-es - um I actually have a question you may be able to help me with. I am happy with this pull request, but need to confirm that the original #400 is covered by a contribution agreement :) The document is here: http://docs.geoserver.org/stable/en/developer/policies/committing.html The PDF needs to be printed, signed and emailed. Perhaps you are in position to check if this has been done already? |
Mike Benowitz, the author of #400, went through the process of getting a contribution agreement signed for a different pull request (geotools/geotools#286). I believe that should cover him for #400 as well. |
Excellent! It will indeed. Okay so we have GSIP 111 to wait for and we should be good to go. |
Jody, I did some testing and relative paths for the image works well. I tried various things:
I notice a couple issues with using a full URL:
|
Jody and Mike, a contributor assignement signed for GeoTools does not cover GeoServer, the copyright assignment does not go to the same organisation (OsGeo vs OpenPlans). |
Added the issues to the todo list. It was my intention to provide "Recommended use of styles" warnings. The use of URLs are not served by GeoServer is a danger (as breaks web clients). I do not understand your issue with generation of WMS Capabilities document creating a file. Edit your comment to provide more detail. I may need some advice on handling of wicket warnings (I also note that validation occurs when clicking on the link, but not when hitting "Submit"). |
I realized I should have tested WMS 1.1.1, not 1.0.0. You can disregard the comment about creating the file. |
Any progress? How are we doing contribution agreement wise? |
I am still waiting. On Saturday, April 19, 2014, Andrea Aime notifications@github.com wrote:
Jody Garnett |
Hi, it's been another month, are the copyright assignments moving on? |
@mike-es can you check on the paperwork please? |
I just sent an email to the person responsible for getting the signed agreement and CC'd both of you. |
Are we still waiting on the agreements? |
I told management on my end that they were too slow... Even with this agreement in-hand today there would be QA needed based on the issues @mike-es listed above. I guess I could just turn off wicket validation (rather than figure out how to cascade clear the warnings from the subform). |
Hem... any progress with the CA? |
Um - yes there is progress. We changed out organisation - and this crew had already signed for GeoTools ... So we should be good now? |
License wise it would seem that way. The code base has shifted enough during the last six months that the pull request cannot be merged anymore though. |
So... I guess this one will be merged for 2.8.x? |
Unless I get to it tomorrow :) Need to rebase and see if it is any good... |
2.8.x ready to receive this (just sayin... :-p ) |
Another couple of months passed since last comment. Still in the pipeline for being worked on? |
Yeah I asked Travis to take it to a branch so we could both look at it: Near as I can tell he got stuck in wicket code. Jody Garnett On 18 April 2015 at 10:21, Andrea Aime notifications@github.com wrote:
|
0738f3b
to
0ceae4d
Compare
0ceae4d
to
6451744
Compare
Any relationship between this pull request and this ticket? Maybe they are similar but not same, cannot decide :) |
I think this feature (ability to parse out a LegendGraphic from SLD) may in Jody Garnett On 18 August 2015 at 04:57, Andrea Aime notifications@github.com wrote:
|
6451744
to
be2a721
Compare
…etLegendGraphic service in the WMS GetCapabilities LegendURL Conflicts: src/main/src/test/java/org/geoserver/data/test/SystemTestData.java
Fix up ExternalGraphic panel to allow relative URL Introduction of LegendRequest data structure to prevent more internal hashmaps KVP parser now resolves relative graphics prior to use. Additional validation checks and warnings. Validation now also checks image availability, and will provide warning if configured with an external graphic that does not match the request base url. Update documentation for style editor
looks like validation and saving is not functioning
…buttons instead of links for show/hide legend
be2a721
to
0208cec
Compare
@tbarsballe thanks for the help on this one, can you review the checklist at the top of this pull request and cross off them items that were fixed? I think we may be done?! |
Of the remaining unchecked issues, I did not explicitly fix (or test) any of them, although from general testing I think both "prepending of styles directory" and "validation on submit" are fixed now. Other fixes:
|
Looks like @jodygarnett added test cases for the remaining issues last week. Now that all the test cases pass, we can consider these issues fixed. |
#1237 broke the mergeability of this PR. |
Manualy squashed and merged to master: 83bb4d6 |
|
||
String user_home = System.getProperty("user.home"); | ||
File home = new File(user_home); | ||
ImageIO.write(expected, "png", new File(home,"expected.png")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jodygarnett @tbarsballe please do not write test images to user home directory. Fixed in 4380977 on master. These images were not used in the test and I assume that they were for test development and inadvertently included in this PR. At the least, ensure that test images are confined to module target so they can be cleaned. See gt-render for examples of how to write test fixtures that enable interactive development of tests and by default write no files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Ben, sorry we missed that in such a long lived patch.
On Wed, Nov 4, 2015 at 4:16 AM Ben Caradoc-Davies notifications@github.com
wrote:
In
src/wms/src/test/java/org/geoserver/wms/wms_1_1_1/GetLegendGraphicTest.java
#551 (comment):
BufferedImage image = getAsImage(base, "image/png");
Resource resource = getResourceLoader().get("styles/legend.png");
BufferedImage expected = ImageIO.read( resource.file() );
assertEquals( getPixelColor(expected,10,2).getRGB(), getPixelColor(image,10,2).getRGB() );
// test rescale
base = "wms?service=WMS&version=1.1.1&request=GetLegendGraphic" +
"&layer=sf:states&style=custom" +
"&format=image/png&width=16&height=16";
image = getAsImage(base, "image/png");
String user_home = System.getProperty("user.home");
File home = new File(user_home);
ImageIO.write(expected, "png", new File(home,"expected.png"));
@jodygarnett https://github.com/jodygarnett @tbarsballe
https://github.com/tbarsballe please do not write test images to user
home directory. Fixed in 4380977
4380977
on master. These images were not used in the test and I assume that they
were for test development and inadvertently included in this PR. At the
least, ensure that test images are confined to module target so they can be
cleaned. See gt-render for examples of how to write test fixtures that
enable interactive development of tests and by default write no files.—
Reply to this email directly or view it on GitHub
https://github.com/geoserver/geoserver/pull/551/files#r43839044.Jody Garnett
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, Jody.
On 04/11/15 17:11, Jody Garnett wrote:
Thanks Ben, sorry we missed that in such a long lived patch.
Ben Caradoc-Davies ben@transient.nz
Director
Transient Software Limited http://transient.nz/
New Zealand
This is a replacement for #400 adding LegendInfo to StyleInfo for use in WMS GetCapabilities generation. The data structure (if available) is also used in GetLegendGraphics.
The scope of this feature has been refined to restrict these external graphic references to images that are being served by GeoServer (for example from the styles directory). This allows GeoServer to still be responsible for all the information it is publishing, and ensure that the images are available for the GetLegendGraphics operation.
Update: Due to feedback from @aaime the above restriction is lifted, a warning will be provided in the user interface if you configure GeoServer with an absolute URL pointing to an external server. An absolute URL that starts with the base url is fine. During GetLegendGraphics any online resource that cannot be resolved will result in a warning in the logs, and the code will proceed with dynamic generation.
To do: