Skip to content

add wmsimage method #73

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

Merged
merged 28 commits into from
Aug 30, 2012
Merged

add wmsimage method #73

merged 28 commits into from
Aug 30, 2012

Conversation

jswhit
Copy link
Contributor

@jswhit jswhit commented Aug 28, 2012

for retrieving and displaying background images from web map servers. Requires that projection be defined using the new 'epsg' keyword, except for projection='cyl', which is automatically assumed to be epsg=4326. Run testwms.py to exercise this new feature.

@@ -3985,6 +4089,73 @@ def warpimage(self,image="bluemarble",scale=None,**kwargs):
if self.round: im,c = self._clipcircle(ax,im)
return im

def wmsimage(self,server='http://server.arcgisonline.com/ArcGIS',\
Copy link

Choose a reason for hiding this comment

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

This function should be perhaps named as "restmap" or "arcgismap" as it should be able to process any valid ArcGIS Mapserver with REST protocol. For WMS servers we'll need to do another template and maybe call it wmsmap or wmsimage. Here is example urllib call for sample WMS function GetMap:

basemap_url = "\
http://geonetwork3.fao.org/ows/14097?\
request=GetMap&\
service=WMS&\
version=1.1.1&\
layers=country_bnd&\
format=image/svg%2Bxml&\
bgcolor=0xFFFFFF&\
transparent=TRUE&\
srs=EPSG:4326&\
bbox=-180,-137.464503042596,180,137.464503042596&\
width=986&\
height=753\
"

It's very similar to already implemented, only that some parameters are differently named.
Additionally SRS is acceptable in WMS 1.1.1, and CRS in WMS 1.3.0 which should be deduced from WMS server version. Both default to EPSG:4326

@jswhit
Copy link
Contributor Author

jswhit commented Aug 28, 2012

OK, renamed it 'arcgisimage'.

jswhit added a commit that referenced this pull request Aug 30, 2012
@jswhit jswhit merged commit 8918e4b into matplotlib:master Aug 30, 2012
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.

2 participants