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

add a better way to attach a png to a map plot #162

Open
danlipsa opened this issue Mar 30, 2017 · 24 comments
Open

add a better way to attach a png to a map plot #162

danlipsa opened this issue Mar 30, 2017 · 24 comments
Milestone

Comments

@danlipsa
Copy link
Contributor

danlipsa commented Mar 30, 2017

Currently, put_png is used to put a background image on the canvas. A template is used to scale the png image so that it fits the map plot, so the user has to fidget with the scaling option to get it to fit.

Instead, the scaling can be computed by vcs so that the png fits the map plot. It can also be extended to be used in map plots that use geographic projections.

Using the new API a user would only have to specify a png as an option to the plot. The image would be scaled so that it fits with the plot.

As @durack1 pointed out, this will have the further advantage that the png will be georeferenced so you can view the map centered at any latitude/longitude.

@doutriaux1 @aashish24 @durack1 What do you think about this enhancement?

@durack1
Copy link
Member

durack1 commented Mar 30, 2017

@danlipsa this would be unreal! I wonder if the png hard code is optional? Could this also work with tif, jpeg etc inputs and overlays?

@danlipsa
Copy link
Contributor Author

@durack1 The png file format would not be required. It should work with any image known to VTK.

@durack1
Copy link
Member

durack1 commented Mar 30, 2017

@danlipsa great, I wonder what other stuff VTK can do could be a exposed through VCS.. this overlay stuff is very hard to do in other packages I'm familiar with

@doutriaux1
Copy link
Contributor

@danlipsa I think that would be perfect! How long do you think it would take?

@danlipsa
Copy link
Contributor Author

@doutriaux1 A rough estimate: a few days to a week to add to one plot and maybe a few more days to extended to other plots.

@danlipsa
Copy link
Contributor Author

@durack1 I am nor sure what do you have in mind.

@doutriaux1
Copy link
Contributor

ok, it's neat but I would vote to fix the test suite first on circleci.

@doutriaux1
Copy link
Contributor

we can always put it in a nightly after the fact for @durack1

@danlipsa
Copy link
Contributor Author

@doutriaux1 Yes, definitely, we'll do this after the release - And we cannot release unless we have a working test suit.

@durack1
Copy link
Member

durack1 commented Mar 30, 2017

@doutriaux1 @danlipsa nightly is fine with me... I could even test out a branch if it was available.. With something like this user feedback could be helpful to round out the edges

@durack1
Copy link
Member

durack1 commented Mar 30, 2017

@danlipsa, regarding other stuff to expose.. I'm naive as to what VTK can do, so maybe I need to browse the VTK example gallery and see what else is possible

@danlipsa
Copy link
Contributor Author

danlipsa commented Apr 4, 2017

@durack1 @aashish24 @doutriaux1 Unfortunately, we are not as good as we should be in showcasing all visualizations we support. So, if you see something you like bring it up and we'll look into it. It is quite possible that we already support it.
Our gallery is focused on 3D and is not comprehensive.
http://www.vtk.org/gallery/

You can also take a look at
http://www.vtk.org/features/
2D Plots and Charts and Infovis would be of interest, but again those are not comprehensive.

@durack1
Copy link
Member

durack1 commented Apr 4, 2017

@danlipsa thanks for the links.. I just took a peek and there was nothing there that jumped out at me.. Your suggestion of raising a query with an example (or sketch or similar) will be something I'll consider in the future..

@durack1
Copy link
Member

durack1 commented Apr 18, 2017

@danlipsa with some considerable trial and error and a lot of help from @doutriaux1 I have managed to get the image that I was imagining:
170417_pcmdi-amip-1-1-2_siconcandtos-201612
This required some considerable kludging to get the desired output, but the final product does look clean. I think this provides a good template to aim toward when addressing this issue

@danlipsa
Copy link
Contributor Author

@durack1 @aashish24 @doutriaux1 Very nice! I think it would be great to get something like this without too much effort.

@durack1
Copy link
Member

durack1 commented Apr 25, 2017

@danlipsa @doutriaux1 @williams13 what would be really nice, is the ability to georeference the png overlay/input file so that you could rearrange it however you wanted, so for the lower panel above, it then becomes e.g.:
170420_pcmdi-amip-1-1-2_siconcandtos-201612_completepacific
This would also further augment the functionality so you could potentially use maps that are not global, so the ability to georeference the overlay, and maybe even many of them, if you have a mosaic of high res files for each continent for e.g. As I noted before I am more than happy to iterate with your guys when this issue is starting to be looked at

@danlipsa
Copy link
Contributor Author

danlipsa commented Apr 25, 2017

@durack1 Yes, definitely this is how we'll do it. I think there are images that are already geo-referenced. @aashish24 knows more about this.

@doutriaux1 doutriaux1 modified the milestone: 3.0 May 5, 2017
@durack1
Copy link
Member

durack1 commented Jul 21, 2017

@danlipsa let me know when you get to look at this, we have a pub in the revision queue and I would really like to highlight this CDAT functionality if it's available at publication time..

@danlipsa
Copy link
Contributor Author

@durack1 That would be very nice. I have vcs.js and upgrading vcs to OpenGl2 in my queue. Keep promoting this to @williams13 @doutriaux1 and @aashish24 and will get done.

@durack1
Copy link
Member

durack1 commented Jul 27, 2017

@danlipsa @doutriaux1 @williams13 @aashish24 I would certainly up-vote this feature, as it's not obvious to me that any other package is capable of generating these

@durack1
Copy link
Member

durack1 commented Nov 6, 2017

For a matplotlib example, with multiple options (blue marble, topographic relief etc) see https://matplotlib.org/basemap/users/geography.html

@lee1043 this is the issue that I referenced in my email

@doutriaux1
Copy link
Contributor

@durack1 yes but these are canned images by the developers, correct? We want full featured stuff, with any image.

@lee1043
Copy link
Contributor

lee1043 commented Nov 6, 2017

@doutriaux1 @durack1 Yes, it is canned image, but key thing of it is that the map image can be fitted to any type of map projection or region, automatically.

@durack1
Copy link
Member

durack1 commented Nov 6, 2017

The actual function is warpimage() which is only global - see: use an abitrary image as a map background. The image must be global, covering the world in lat/lon coordinates from the international dateline eastward and the South Pole northward.

So there is considerable scope to do things alot better here!

@CDAT CDAT deleted a comment from jypeter Nov 9, 2017
@doutriaux1 doutriaux1 removed this from the 3.0 milestone Mar 29, 2018
@doutriaux1 doutriaux1 added this to the post 3.0 milestone Mar 29, 2018
@doutriaux1 doutriaux1 modified the milestones: 8.1, 8.2 Mar 27, 2019
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

No branches or pull requests

4 participants