Background basemaps in Basemap

I wanted to overlay some plot over map, and thought to use one of
provided background maps that come with Basemap
Result isn't that great as expected: loading bluemarble map took 1GB
memory, and zooming i.e. Europe region on 1920x1080 screen is too
blurred w/o details. As a consequence, using custom basemap with even
greater resolution is out of consideration

OTOH whatever I do in Google Earth, memory never exceeds 200MB and
it's even lower with ArcGIS Explorer with any basemap on it. Maybe
it's because these packages use advanced tilling features maybe it's
else, but isn't there something that can be done with Basemap package
so that topological maps can be useful with it? Like using some GIS
webservice or similar?

I wanted to overlay some plot over map, and thought to use one of
provided background maps that come with Basemap
Result isn't that great as expected: loading bluemarble map took 1GB
memory, and zooming i.e. Europe region on 1920x1080 screen is too
blurred w/o details. As a consequence, using custom basemap with even
greater resolution is out of consideration

OTOH whatever I do in Google Earth, memory never exceeds 200MB and
it's even lower with ArcGIS Explorer with any basemap on it. Maybe
it's because these packages use advanced tilling features maybe it's
else, but isn't there something that can be done with Basemap package
so that topological maps can be useful with it? Like using some GIS
webservice or similar?

Oh sure, it's simple!

http://www.google.com/patents?id=J4YOAAAAEBAJ&dq=6618053

-Jeff

···

On 8/24/12 3:37 PM, klo uo wrote:

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Hi Jeff,

thanks for your reply.

I was hoping to get response if there are ideas how this unfortunate
performance can be avoided. If there are some thoughts or if it's
closed case.

About GIS web-services, I thought maybe extending Basemap and
providing interface to some of available online mapping services.
For example arcgis is just one of them, and allows using their online
map service to arbitrary application, while exposing REST
(http://resources.arcgis.com/en/help/rest/apiref/index.html?mapserver.html)
and SOAP service with full WSDL description
(http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer?wsdl)
and documentation. REST requests cover all of their services while
SOAP is limited and a bit harder to code in this example. Services
offer much more than it's needed to be paired in Basemap, as can be
seen from documentation, with any imaginable projection and what not.

As an example of using the service here is image: http://i.imgur.com/RpUFv.png
and here is it's simple source code that executes unnoticeable in second:

···

On Sat, Aug 25, 2012 at 1:26 AM, Jeff Whitaker wrote:

Oh sure, it's simple!

http://www.google.com/patents?id=J4YOAAAAEBAJ&dq=6618053

========================================
  import matplotlib.pyplot as plt
  import urllib2

  lon1 = -10; lon2 = 30; lat1 = 30; lat2 = 60
  basemap_url =
"http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/export?bbox=%d,%d,%d,%d&bboxSR=4326&size=1024,768&dpi=128&format=png32&f=image"
% (lon1, lat1, lon2, lat2)
  overlay_url =
"https://ogcie.iblsoft.com/sigwx?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=ASXX&WIDTH=1024&HEIGHT=768&CRS=EPSG:4326&BBOX=%d,%d,%d,%d&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png"
% (lon1, lat1, lon2, lat2)

  plt.figure(figsize=(8, 6), dpi=128, facecolor='w')
  plt.imshow(plt.imread(urllib2.urlopen(basemap_url)))
  plt.imshow(plt.imread(urllib2.urlopen(overlay_url)))
  plt.gca().axison = False
  plt.savefig("scene.png", dpi=128, transparent=True)

As both "basemap map" and overlay image use same CRS, this seems
doable with just MPL.

Having such service paired in Basemap as a feature looks very
promising to me. I don't know much about MPL and Basemap design, as if
all above talk is easy and then acceptable for implementation, but
that's roughly what I had in mind for web-services - as additional
feature for replacing bloated background maps provided, which does not
have such quality to justify low performance.

Cheers

Oh sure, it's simple!

http://www.google.com/patents?id=J4YOAAAAEBAJ&dq=6618053

Hi Jeff,

thanks for your reply.

I was hoping to get response if there are ideas how this unfortunate
performance can be avoided. If there are some thoughts or if it's
closed case.

Klo: It's not a closed case - but I have no idea how to do it. If you'd like to try to implement something, your contribution would be welcome.

About GIS web-services, I thought maybe extending Basemap and
providing interface to some of available online mapping services.
For example arcgis is just one of them, and allows using their online
map service to arbitrary application, while exposing REST
(http://resources.arcgis.com/en/help/rest/apiref/index.html?mapserver.html)
and SOAP service with full WSDL description
(http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer?wsdl)
and documentation. REST requests cover all of their services while
SOAP is limited and a bit harder to code in this example. Services
offer much more than it's needed to be paired in Basemap, as can be
seen from documentation, with any imaginable projection and what not.

As an example of using the service here is image: http://i.imgur.com/RpUFv.png
and here is it's simple source code that executes unnoticeable in second:

   import matplotlib.pyplot as plt
   import urllib2

   lon1 = -10; lon2 = 30; lat1 = 30; lat2 = 60
   basemap_url =
"http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/export?bbox=%d,%d,%d,%d&bboxSR=4326&size=1024,768&dpi=128&format=png32&f=image"
% (lon1, lat1, lon2, lat2)
   overlay_url =
"https://ogcie.iblsoft.com/sigwx?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=ASXX&WIDTH=1024&HEIGHT=768&CRS=EPSG:4326&BBOX=%d,%d,%d,%d&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png"
% (lon1, lat1, lon2, lat2)

   plt.figure(figsize=(8, 6), dpi=128, facecolor='w')
   plt.imshow(plt.imread(urllib2.urlopen(basemap_url)))
   plt.imshow(plt.imread(urllib2.urlopen(overlay_url)))
   plt.gca().axison = False
   plt.savefig("scene.png", dpi=128, transparent=True)

As both "basemap map" and overlay image use same CRS, this seems
doable with just MPL.

Having such service paired in Basemap as a feature looks very
promising to me. I don't know much about MPL and Basemap design, as if
all above talk is easy and then acceptable for implementation, but
that's roughly what I had in mind for web-services - as additional
feature for replacing bloated background maps provided, which does not
have such quality to justify low performance.

It looks like you are fetching an image over a specified region and displaying it with matplotlib. That's very useful, but it doesn't solve the zooming problem you mentioned. Still, it's a good start and would be nice to have in basemap.

Sorry for sounding so dismissive in my earlier reply. How do you think web map services could be integrated into Basemap? Do you see this mainly as a faster and more general alternative to the 'bluemarble' or 'warpimage' methods, where you can specify a web map service and have the appropriate tile that fits the map projection region fetched and displayed automatically?

-Jeff

···

On 8/24/12 10:20 PM, klo uo wrote:

On Sat, Aug 25, 2012 at 1:26 AM, Jeff Whitaker wrote:

Cheers

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

If I could chime in for a quick moment, perhaps one could consider a specialized backend extension that would provide the web services communication? This way, when panning and zooming, the backend would know the limits and fetch (and optionally cache) the requested tiles from the connected service.

Mind you, I don’t think this quite falls into the scope of the mpl or Basemap project, but such a backend would be a powerful project on its own.

Cheers!

Ben Root

···

On Saturday, August 25, 2012, Jeff Whitaker wrote:

On 8/24/12 10:20 PM, klo uo wrote:

On Sat, Aug 25, 2012 at 1:26 AM, Jeff Whitaker wrote:

Oh sure, it’s simple!

http://www.google.com/patents?id=J4YOAAAAEBAJ&dq=6618053

Hi Jeff,

thanks for your reply.

I was hoping to get response if there are ideas how this unfortunate

performance can be avoided. If there are some thoughts or if it’s

closed case.

Klo: It’s not a closed case - but I have no idea how to do it. If

you’d like to try to implement something, your contribution would be

welcome.

About GIS web-services, I thought maybe extending Basemap and

providing interface to some of available online mapping services.

For example arcgis is just one of them, and allows using their online

map service to arbitrary application, while exposing REST

(http://resources.arcgis.com/en/help/rest/apiref/index.html?mapserver.html)

and SOAP service with full WSDL description

(http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer?wsdl)

and documentation. REST requests cover all of their services while

SOAP is limited and a bit harder to code in this example. Services

offer much more than it’s needed to be paired in Basemap, as can be

seen from documentation, with any imaginable projection and what not.

As an example of using the service here is image: http://i.imgur.com/RpUFv.png

and here is it’s simple source code that executes unnoticeable in second:

========================================

import matplotlib.pyplot as plt

import urllib2

lon1 = -10; lon2 = 30; lat1 = 30; lat2 = 60

basemap_url =

http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/export?bbox=%d,%d,%d,%d&bboxSR=4326&size=1024,768&dpi=128&format=png32&f=image

% (lon1, lat1, lon2, lat2)

overlay_url =

https://ogcie.iblsoft.com/sigwx?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=ASXX&WIDTH=1024&HEIGHT=768&CRS=EPSG:4326&BBOX=%d,%d,%d,%d&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png

% (lon1, lat1, lon2, lat2)

plt.figure(figsize=(8, 6), dpi=128, facecolor=‘w’)

plt.imshow(plt.imread(urllib2.urlopen(basemap_url)))

plt.imshow(plt.imread(urllib2.urlopen(overlay_url)))

plt.gca().axison = False

plt.savefig(“scene.png”, dpi=128, transparent=True)

========================================

As both “basemap map” and overlay image use same CRS, this seems

doable with just MPL.

Having such service paired in Basemap as a feature looks very

promising to me. I don’t know much about MPL and Basemap design, as if

all above talk is easy and then acceptable for implementation, but

that’s roughly what I had in mind for web-services - as additional

feature for replacing bloated background maps provided, which does not

have such quality to justify low performance.

It looks like you are fetching an image over a specified region and

displaying it with matplotlib. That’s very useful, but it doesn’t solve

the zooming problem you mentioned. Still, it’s a good start and would

be nice to have in basemap.

Sorry for sounding so dismissive in my earlier reply. How do you think

web map services could be integrated into Basemap? Do you see this

mainly as a faster and more general alternative to the ‘bluemarble’ or

‘warpimage’ methods, where you can specify a web map service and have

the appropriate tile that fits the map projection region fetched and

displayed automatically?

-Jeff

Maybe such a thing could be built using owslib?
-Jeff

···

On 8/25/12 7:53 AM, Benjamin Root
wrote:

  On Saturday, August 25, 2012, Jeff Whitaker wrote:

On 8/24/12 10:20 PM, klo uo wrote:

    > On Sat, Aug 25, 2012 at 1:26 AM, Jeff Whitaker wrote:

    >> Oh sure, it's simple!

    >>

    >> [http://www.google.com/patents?id=J4YOAAAAEBAJ&dq=6618053](http://www.google.com/patents?id=J4YOAAAAEBAJ&dq=6618053)

    > Hi Jeff,

    >

    > thanks for your reply.

    >

    > I was hoping to get response if there are ideas how this

unfortunate

    > performance can be avoided. If there are some thoughts or

if it’s

    > closed case.



    Klo:  It's not a closed case - but I have no idea how to do it.

If

    you'd like to try to implement something, your contribution

would be

    welcome.

    >

    > About GIS web-services, I thought maybe extending Basemap

and

    > providing interface to some of available online mapping

services.

    > For example arcgis is just one of them, and allows using

their online

    > map service to arbitrary application, while exposing REST

    > ([http://resources.arcgis.com/en/help/rest/apiref/index.html?mapserver.html](http://resources.arcgis.com/en/help/rest/apiref/index.html?mapserver.html))

    > and SOAP service with full WSDL description

    > ([http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer?wsdl](http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer?wsdl))

    > and documentation. REST requests cover all of their

services while

    > SOAP is limited and a bit harder to code in this example.

Services

    > offer much more than it's needed to be paired in Basemap,

as can be

    > seen from documentation, with any imaginable projection and

what not.

    >

    > As an example of using the service here is image: [http://i.imgur.com/RpUFv.png](http://i.imgur.com/RpUFv.png)

    > and here is it's simple source code that executes

unnoticeable in second:

    > ========================================

    >    import matplotlib.pyplot as plt

    >    import urllib2

    >

    >    lon1 = -10; lon2 = 30; lat1 = 30; lat2 = 60

    >    basemap_url =

    > "[http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/export?bbox=%d,%d,%d,%d&bboxSR=4326&size=1024,768&dpi=128&format=png32&f=image](http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/export?bbox=%d,%d,%d,%d&bboxSR=4326&size=1024,768&dpi=128&format=png32&f=image)"

    > % (lon1, lat1, lon2, lat2)

    >    overlay_url =

    > "[https://ogcie.iblsoft.com/sigwx?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=ASXX&WIDTH=1024&HEIGHT=768&CRS=EPSG:4326&BBOX=%d,%d,%d,%d&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png](https://ogcie.iblsoft.com/sigwx?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=ASXX&WIDTH=1024&HEIGHT=768&CRS=EPSG:4326&BBOX=%d,%d,%d,%d&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png)"

    > % (lon1, lat1, lon2, lat2)

    >

    >    plt.figure(figsize=(8, 6), dpi=128, facecolor='w')

    >    plt.imshow(plt.imread(urllib2.urlopen(basemap_url)))

    >    plt.imshow(plt.imread(urllib2.urlopen(overlay_url)))

    >    plt.gca().axison = False

    >    plt.savefig("scene.png", dpi=128, transparent=True)

    > ========================================

    >

    > As both "basemap map" and overlay image use same CRS, this

seems

    > doable with just MPL.

    >

    > Having such service paired in Basemap as a feature looks

very

    > promising to me. I don't know much about MPL and Basemap

design, as if

    > all above talk is easy and then acceptable for

implementation, but

    > that's roughly what I had in mind for web-services - as

additional

    > feature for replacing bloated background maps provided,

which does not

    > have such quality to justify low performance.

    It looks like you are fetching an image over a specified region

and

    displaying it with matplotlib.  That's very useful, but it

doesn’t solve

    the zooming problem you mentioned.  Still, it's a good start and

would

    be nice to have in basemap.



    Sorry for sounding so dismissive in my earlier reply.  How do

you think

    web map services could be integrated into Basemap?  Do you see

this

    mainly as a faster and more general alternative to the

‘bluemarble’ or

    'warpimage' methods, where you can specify a web map service and

have

    the appropriate tile that fits the map projection region fetched

and

    displayed automatically?



    -Jeff
    If I could chime in for a quick moment, perhaps one could

consider a specialized backend extension that would provide the
web services communication? This way, when panning and zooming,
the backend would know the limits and fetch (and optionally
cache) the requested tiles from the connected service.

    Mind you, I don't think this quite falls into the scope of

the mpl or Basemap project, but such a backend would be a
powerful project on its own.

Cheers!

Ben Root

http://geopython.github.com/OWSLib/

tilecache.org looks relevant too.
-Jeff

···

On 8/25/12 9:50 AM, Jeff Whitaker
wrote:

  Maybe such a thing could be built using owslib?

-Jeff

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats.
_______________________________________________
Matplotlib-users mailing list
    On 8/25/12 7:53 AM, Benjamin Root

wrote:

    On Saturday, August 25, 2012, Jeff Whitaker wrote:
      On 8/24/12 10:20 PM, klo uo

wrote:

      > On Sat, Aug 25, 2012 at 1:26 AM, Jeff Whitaker wrote:

      >> Oh sure, it's simple!

      >>

      >> [http://www.google.com/patents?id=J4YOAAAAEBAJ&dq=6618053](http://www.google.com/patents?id=J4YOAAAAEBAJ&dq=6618053)

      > Hi Jeff,

      >

      > thanks for your reply.

      >

      > I was hoping to get response if there are ideas how this

unfortunate

      > performance can be avoided. If there are some thoughts or

if it’s

      > closed case.



      Klo:  It's not a closed case - but I have no idea how to do

it. If

      you'd like to try to implement something, your contribution

would be

      welcome.

      >

      > About GIS web-services, I thought maybe extending Basemap

and

      > providing interface to some of available online mapping

services.

      > For example arcgis is just one of them, and allows using

their online

      > map service to arbitrary application, while exposing REST

      > ([http://resources.arcgis.com/en/help/rest/apiref/index.html?mapserver.html](http://resources.arcgis.com/en/help/rest/apiref/index.html?mapserver.html))

      > and SOAP service with full WSDL description

      > ([http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer?wsdl](http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer?wsdl))

      > and documentation. REST requests cover all of their

services while

      > SOAP is limited and a bit harder to code in this example.

Services

      > offer much more than it's needed to be paired in Basemap,

as can be

      > seen from documentation, with any imaginable projection

and what not.

      >

      > As an example of using the service here is image: [http://i.imgur.com/RpUFv.png](http://i.imgur.com/RpUFv.png)

      > and here is it's simple source code that executes

unnoticeable in second:

      > ========================================

      >    import matplotlib.pyplot as plt

      >    import urllib2

      >

      >    lon1 = -10; lon2 = 30; lat1 = 30; lat2 = 60

      >    basemap_url =

      > "[http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/export?bbox=%d,%d,%d,%d&bboxSR=4326&size=1024,768&dpi=128&format=png32&f=image](http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/export?bbox=%d,%d,%d,%d&bboxSR=4326&size=1024,768&dpi=128&format=png32&f=image)"

      > % (lon1, lat1, lon2, lat2)

      >    overlay_url =

      > "[https://ogcie.iblsoft.com/sigwx?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=ASXX&WIDTH=1024&HEIGHT=768&CRS=EPSG:4326&BBOX=%d,%d,%d,%d&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png](https://ogcie.iblsoft.com/sigwx?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=ASXX&WIDTH=1024&HEIGHT=768&CRS=EPSG:4326&BBOX=%d,%d,%d,%d&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png)"

      > % (lon1, lat1, lon2, lat2)

      >

      >    plt.figure(figsize=(8, 6), dpi=128, facecolor='w')

      >    plt.imshow(plt.imread(urllib2.urlopen(basemap_url)))

      >    plt.imshow(plt.imread(urllib2.urlopen(overlay_url)))

      >    plt.gca().axison = False

      >    plt.savefig("scene.png", dpi=128, transparent=True)

      > ========================================

      >

      > As both "basemap map" and overlay image use same CRS,

this seems

      > doable with just MPL.

      >

      > Having such service paired in Basemap as a feature looks

very

      > promising to me. I don't know much about MPL and Basemap

design, as if

      > all above talk is easy and then acceptable for

implementation, but

      > that's roughly what I had in mind for web-services - as

additional

      > feature for replacing bloated background maps provided,

which does not

      > have such quality to justify low performance.

      It looks like you are fetching an image over a specified

region and

      displaying it with matplotlib.  That's very useful, but it

doesn’t solve

      the zooming problem you mentioned.  Still, it's a good start

and would

      be nice to have in basemap.



      Sorry for sounding so dismissive in my earlier reply.  How do

you think

      web map services could be integrated into Basemap?  Do you see

this

      mainly as a faster and more general alternative to the

‘bluemarble’ or

      'warpimage' methods, where you can specify a web map service

and have

      the appropriate tile that fits the map projection region

fetched and

      displayed automatically?



      -Jeff
      If I could chime in for a quick moment, perhaps one could

consider a specialized backend extension that would provide
the web services communication? This way, when panning and
zooming, the backend would know the limits and fetch (and
optionally cache) the requested tiles from the connected
service.

      Mind you, I don't think this quite falls into the scope of

the mpl or Basemap project, but such a backend would be a
powerful project on its own.

Cheers!

Ben Root

http://geopython.github.com/OWSLib/

http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/Matplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users

It looks like you are fetching an image over a specified region and
displaying it with matplotlib. That's very useful, but it doesn't solve
the zooming problem you mentioned. Still, it's a good start and would
be nice to have in basemap.

Yes, I was thinking about fetching image resource only. I should have
probably fetched more detailed and smaller region that would
demonstrate superiority over Basemap bitmaps quality and performance,
as I mentioned zooming problem in a context of very high memory usage
while provided image is with low detail compared to what's potentially
possible.

Sorry for sounding so dismissive in my earlier reply. How do you think
web map services could be integrated into Basemap? Do you see this
mainly as a faster and more general alternative to the 'bluemarble' or
'warpimage' methods, where you can specify a web map service and have
the appropriate tile that fits the map projection region fetched and
displayed automatically?

Exactly - as function to Basemap class that could be called as
bluemarble() or shadedrelief() etc. on previously defined projection.
Export Map (http://atlas.resources.ca.gov/arcgis/SDK/REST/export.html)
seems like only function needed, but more knowledge about Basemap is
needed, as my main problem with it is fitting projections right. I
tried to overlay arcgis map over some Basemap projections like:

  m=Basemap(...)
  m.imshow(arcgis_map)
  m.drawcoastlines()

But it never fits, and also aspect ratio should be considered.

And same scheme for potentially other mapping webservices, as
functions to Basemap class...

Also for reference here are maps available to arcgis service:
http://server.arcgisonline.com/ArcGIS/rest/services

···

On Sat, Aug 25, 2012 at 3:24 PM, Jeff Whitaker <jswhit@...146...> wrote:

This is like more advanced, on a higher level. I imagine if you plan
to add some interaction to Basemap, it would be fantastic, to say at
least.

While reading Google patent you linked the other day, I came also to
this link: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection
It was mentioned as a advanced feature to some server providing WMS capabilities

Also, already mentioned GIS webservices IMHO provide interface to
their caching/tiling mechanisms, but if there is backend to hold this
feature in MPL/Basemap I have no idea.

···

On Sat, Aug 25, 2012 at 5:57 PM, Jeff Whitaker wrote:

tilecache.org looks relevant too.

This is interesting. I didn't know about this module

Using either simple REST (urllib) to access webservices or depend on
additional module which exposes all kinds of services capabilities,
that are not just basemaps, but services which are used to interface
many public data through XML communication, that are potentially
attractive to Basemap users IMHO

It is kind of a dilemma :wink:

···

On Sat, Aug 25, 2012 at 5:50 PM, Jeff Whitaker wrote:

Maybe such a thing could be built using owslib?

http://geopython.github.com/OWSLib/

Export Map (http://atlas.resources.ca.gov/arcgis/SDK/REST/export.html)
seems like only function needed, but more knowledge about Basemap is
needed, as my main problem with it is fitting projections right. I
tried to overlay arcgis map over some Basemap projections like:

  m=Basemap(...)
  m.imshow(arcgis_map)
  m.drawcoastlines()

But it never fits, and also aspect ratio should be considered.

Success! :slight_smile:
It was that "imageSR" had to be set, as it doesn't seem to be deduced
from the map:

···

========================================
basemap_url = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/export?\
bbox=%d,%d,%d,%d&\
bboxSR=4326&\
imageSR=4326&\
size=800,600&\
dpi=128&\
format=png32&\
f=image" % (lon1, lat1, lon2, lat2) \

Result with coastlines overlay attached!

Jeff, I think it is easy to make this function to Basemap class, but
I'm not confident doing it.
If you can make it, I'll then try to use it as template and pair it to
other available webservices

Cheers