-
Notifications
You must be signed in to change notification settings - Fork 398
add WMS example #84
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 WMS example #84
Conversation
I went ahead and added a wmsimage anyway, and just let it pass **kwargs on to OWSLib.wms.WebMapService.getmap. The example was changed to use the new method. |
@@ -1,5 +1,8 @@ | |||
version 1.0.6 (not yet released) | |||
-------------------------------- | |||
* added 'wmsimage' method for displaying background image retrieved from | |||
a OGC-compliant WMS server using OWSLib (http://pypi.python.org/OWSLib) |
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.
Might want to have a "batteries not included" message making it clear that the OWSLib is not automatically installed by basemap.
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.
The wmsimage method will raise an exception if OWSLib cannot be imported, telling the user that OWSLib is required.
Hopefully this example will also work, where JPG is returned? Had to go through some gyrations to read the returned image without writing to disk, because PIL is being used |
I add the noaa openstreetmaps example to testwmsimage.py. It works for me without any gyrations. My guess is that your PIL is misbehaving. |
code from Rich Signell that shows how to retrieve an image from a WMS server and display it on a map. Uses OWSlib. This could be folded into a 'wmsimage' method, but there are so many possible options to pass to OWSlib.wms.WebMapService that this is probably best left to the the user.