|
From: klo uo <kl...@gm...> - 2012-08-24 21:37:51
|
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? |
|
From: Jeff W. <jef...@no...> - 2012-08-24 23:26:45
|
On 8/24/12 3:37 PM, klo uo wrote: > 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 > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > 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 : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: klo uo <kl...@gm...> - 2012-08-25 04:20:46
|
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. 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. Cheers |
|
From: Jeff W. <js...@fa...> - 2012-08-25 13:24:58
|
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 > > > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Benjamin R. <ben...@ou...> - 2012-08-25 13:54:06
|
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 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 |
|
From: Jeff W. <js...@fa...> - 2012-08-25 15:50:37
|
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 > > 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 > > > 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 > Maybe such a thing could be built using owslib? http://geopython.github.com/OWSLib/ -Jeff |
|
From: klo uo <kl...@gm...> - 2012-08-25 16:44:27
|
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/ 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 ;) |
|
From: Jeff W. <js...@fa...> - 2012-08-25 15:58:06
|
On 8/25/12 9:50 AM, Jeff Whitaker wrote: > 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 >> > 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 >> >> >> 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 >> > Maybe such a thing could be built using owslib? > > http://geopython.github.com/OWSLib/ > > -Jeff tilecache.org looks relevant too. -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. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: klo uo <kl...@gm...> - 2012-08-25 16:24:53
|
On Sat, Aug 25, 2012 at 5:57 PM, Jeff Whitaker wrote: > > tilecache.org looks relevant too. > 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. |
|
From: klo uo <kl...@gm...> - 2012-08-25 16:15:26
|
On Sat, Aug 25, 2012 at 3:24 PM, Jeff Whitaker <js...@fa...> wrote: > 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 |
|
From: klo uo <kl...@gm...> - 2012-08-25 17:40:45
|
> 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! :) 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 |
|
From: klo uo <kl...@gm...> - 2012-08-25 17:54:44
|
>> Result with coastlines overlay attached! > > Here is attachment Hm, image needs to be approved by moderator... Here is a link to it: http://i.imgur.com/1ZMoU.png |
|
From: klo uo <kl...@gm...> - 2012-08-25 19:32:24
|
Well it seems ArcGIS web-services can't be bitten in public place. Google and Bing static maps have many limitations: - require account for providing key - draw logos on image - limited size: Bing basic account can return max 900x834 and Google 1280x1280 (while ArcGIS 2048x2048) - Google static maps has max 25K requests per day per application and not per IP - Bing static map doesn't return requested exact coordinates, and I can't see parameter that can define returned image SR (haven't checked Google) I'll have a look tomorrow at Nokia (img size limit 2048x2048), but considering OWSLib and providing arcgis webservice function to Basemap class seems fine. Also just reusing some of OWSLib solution for map services doesn't seem like bad idea - nothing is required except Python builtin XML parsing ---------- http://msdn.microsoft.com/en-us/library/ff701724.aspx https://developers.google.com/maps/documentation/staticmaps http://api.maps.nokia.com/en/restmaps/api.html |
|
From: Jeff W. <js...@fa...> - 2012-08-25 22:18:41
|
On 8/25/12 3:08 PM, klo uo wrote: > On Sat, Aug 25, 2012 at 10:19 PM, Jeff Whitaker <js...@fa...> wrote: >> Klo: For cylindrical equidistant maps (projection='cyl') it will be easy, >> since the corner lat/lon values are all that is needed. For other >> projections, we'll need a way to translate EPSG projection codes into >> Basemap kwargs. > Jeff, how is it done for static bitmaps as bluemarble, etopo... ? > Can't the same be done, if image fits in one of supported projections? Klo: The image in interpolated to the Basemap projection region. This is slow - the main reason to use the WMS is to avoid this by having it done on the server side. > > According http://atlas.resources.ca.gov/arcgis/SDK/REST/export.html > `bbox` is required with syntax like: > > Syntax: <xmin>, <ymin>, <xmax>, <ymax> > > Number format for `bbox` AFAIK (but not sure) depends on `bboxSR` > projection and dense list of available projections with their code is > here: http://atlas.resources.ca.gov/arcgis/SDK/REST/pcs.html The trick is to figure out what the EPSG projection code is based on the Basemap projection info, and pass that information to the WMS server so it can do the interpolation. Here's an example for south polar stereographic: width = 12000.e3 plt.figure() basemap_url =\ "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export?\ bbox=%d,%d,%d,%d&\ bboxSR=3412&\ imageSR=3412&\ size=800,800&\ dpi=128&\ format=png32&\ f=image" % (-width/2,-width/2,width/2,width/2) m =\ Basemap(projection='stere',resolution='i',lon_0=0,lat_0=-90,lat_ts=-70,\ width=width,height=width,rsphere=(6378273,6356889.449)) m.imshow(plt.imread(urllib2.urlopen(basemap_url)),origin='upper') m.drawmeridians(np.arange(-180,180,30),labels=[0,0,0,1],color='y') m.drawparallels(np.arange(-80,-0,10),labels=[1,0,0,0],color='y') m.drawcoastlines() plt.show() -Jeff > > So perhaps, by just providing `cyl` (bboxSR=4326) and imageSR to any > desired projection from above list will do the trick? > > Quickly now, I tried to map other projection on whole world as it was > easier not knowing Basemap that well: > > ======================================== > from mpl_toolkits.basemap import Basemap > import matplotlib.pyplot as plt > import urllib2 > > lon1 = -180; lon2 = 180; lat1 = -90; lat2 = 90 > > basemap_url = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/export?\ > bbox=%d,%d,%d,%d&\ > bboxSR=4326&\ > imageSR=54030&\ > size=2000,1000&\ > format=png32&\ > f=image" % (lon1, lat1, lon2, lat2) > > m = Basemap(projection='robin', lon_0=0, resolution='c') > m.imshow(plt.imread(urllib2.urlopen(basemap_url)), origin='upper') > m.drawcoastlines() > plt.gca().axison = False > plt.title("Robinson Projection") > plt.show() > ======================================== > > Seems almost fine ;) |
|
From: klo uo <kl...@gm...> - 2012-08-26 11:44:48
|
On Sun, Aug 26, 2012 at 12:18 AM, Jeff Whitaker <js...@fa...> wrote: > Klo: The image in interpolated to the Basemap projection region. This is > slow - the main reason to use the WMS is to avoid this by having it done on > the server side. All right, that's the right way anyway > The trick is to figure out what the EPSG projection code is based on the > Basemap projection info, and pass that information to the WMS server so it > can do the interpolation. Yes, and also to pass right `size` parameter as aspect ratio needs to be correct Do you want me to try to pair both projections (Basemap name and WKID and WKT as they call it)? > Here's an example for south polar stereographic: > > width = 12000.e3 > plt.figure() > basemap_url =\ > "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export?\ > bbox=%d,%d,%d,%d&\ > bboxSR=3412&\ > imageSR=3412&\ > size=800,800&\ > dpi=128&\ > format=png32&\ > f=image" % (-width/2,-width/2,width/2,width/2) > m =\ > Basemap(projection='stere',resolution='i',lon_0=0,lat_0=-90,lat_ts=-70,\ > width=width,height=width,rsphere=(6378273,6356889.449)) > m.imshow(plt.imread(urllib2.urlopen(basemap_url)),origin='upper') > m.drawmeridians(np.arange(-180,180,30),labels=[0,0,0,1],color='y') > m.drawparallels(np.arange(-80,-0,10),labels=[1,0,0,0],color='y') > m.drawcoastlines() > plt.show() > Looks beautifully :) As said later today I'll look at Nokia maps and then will try to look for WMS servers. |
|
From: klo uo <kl...@gm...> - 2012-08-26 17:18:11
|
> As said later today I'll look at Nokia maps and then will try to look > for WMS servers. Nokia map services are OK, and can be used even without applying for free account, but they brand every map with their logo even for professional licence. REST services (http://api.maps.nokia.com/en/restmaps/overview.html) are very limited, in one projection and mapped according central point instead bounding box. They offer (http://api.maps.nokia.com/en/index.html) other approaches like JS, JAVA, HTML5 and perhaps some more advanced service can be deduced from there in Python, but it's not worth perhaps. BTW I checked one WMS server (http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities). It has tiling service (GetTileService) and mapping service (GetMap) but only in standard projection EPSG:4326 Here are maps provided: 1 - WMS Global Mosaic, pan sharpened 2 - WMS Global Mosaic, not pan sharpened 3 - CONUS mosaic of 1990 MRLC dataset 4 - SRTM reflectance magnitude, 30m 5 - Current global view of the earth, morning 6 - Current global view of the earth in the afternoon 7 - Blue Marble Next Generation, Global MODIS derived image 8 - Blue Marble, Global MODIS derived image 9 - SRTM derived global elevation, 3 arc-second, hue mapped 10 - Global 1km elevation, seamless SRTM land elevation and ocean depth 11 - SRTM derived global elevation, 3 arc-second 12 - United States elevation, 30m 13 - Digital Elevation Map of the United States, DTED dataset, 3 second resolution, grayscale 14 - Digital Elevation Map of the United States, DTED dataset, 3 second resolution, hue mapped 15 - ASTER DEM, tiled only, 1.5 arc-second per pixel Only first two offer international locations (from Landsat) |
|
From: Jeff W. <js...@fa...> - 2012-08-26 19:56:30
|
On 8/26/12 5:44 AM, klo uo wrote: > On Sun, Aug 26, 2012 at 12:18 AM, Jeff Whitaker <js...@fa...> wrote: >> Klo: The image in interpolated to the Basemap projection region. This is >> slow - the main reason to use the WMS is to avoid this by having it done on >> the server side. > All right, that's the right way anyway > > >> The trick is to figure out what the EPSG projection code is based on the >> Basemap projection info, and pass that information to the WMS server so it >> can do the interpolation. > Yes, and also to pass right `size` parameter as aspect ratio needs to be correct > Do you want me to try to pair both projections (Basemap name and WKID > and WKT as they call it)? Klo: Since epsg codes comprise a very small subset of possible Basemap projections, it may be better to just allow Basemap to accept an epsg kwarg. That keyword would be required in order to use a WMS to display a map background. This may be tricky though, since Basemap needs more information to define a map projection region than is provided by the epsg code. We may have to start with just a few supported epsg codes and then add more as necessary. I added a testwms.py example to my fork (https://github.com/jswhit/basemap.git) that shows how to use three different map projections (epsg codes). -Jeff -Jeff > > >> Here's an example for south polar stereographic: >> >> width = 12000.e3 >> plt.figure() >> basemap_url =\ >> "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export?\ >> bbox=%d,%d,%d,%d&\ >> bboxSR=3412&\ >> imageSR=3412&\ >> size=800,800&\ >> dpi=128&\ >> format=png32&\ >> f=image" % (-width/2,-width/2,width/2,width/2) >> m =\ >> Basemap(projection='stere',resolution='i',lon_0=0,lat_0=-90,lat_ts=-70,\ >> width=width,height=width,rsphere=(6378273,6356889.449)) >> m.imshow(plt.imread(urllib2.urlopen(basemap_url)),origin='upper') >> m.drawmeridians(np.arange(-180,180,30),labels=[0,0,0,1],color='y') >> m.drawparallels(np.arange(-80,-0,10),labels=[1,0,0,0],color='y') >> m.drawcoastlines() >> plt.show() >> > Looks beautifully :) > > As said later today I'll look at Nokia maps and then will try to look > for WMS servers. |
|
From: klo uo <kl...@gm...> - 2012-08-27 03:07:32
|
On Sun, Aug 26, 2012 at 9:56 PM, Jeff Whitaker wrote: > Klo: Since epsg codes comprise a very small subset of possible Basemap > projections, it may be better to just allow Basemap to accept an epsg kwarg. > That keyword would be required in order to use a WMS to display a map > background. This may be tricky though, since Basemap needs more information > to define a map projection region than is provided by the epsg code. We may > have to start with just a few supported epsg codes and then add more as > necessary. > > I added a testwms.py example to my fork > (https://github.com/jswhit/basemap.git) that shows how to use three > different map projections (epsg codes). I'm not sure if I understand projection problem, as arcgis webservice provides thousands of projections, but then you know better. I thought that the code will be just one function which would accept Map name, then coordinates and projection code will be deduced from Basemap function initiation? Here is same server from agency where you work according your signature: maps.ngdc.noaa.gov/rest/services it provides additional maps on same server as arcgis I also checked many WMS servers, first with XML editor but then with Gaia, which was excellent help in determining that many WMS servers just return their capabilities, but does not provide service as described in capabilities response. Some offer tilling features, for possible future interactive zooming in Basemap ;) Here is one http://maps.dwd.de/geoserver/wms?request=GetCapabilities&service=WMS&version=1.1.1 which offers bluemarble in many projection. Additionally it offers some German datasets, but does not offer tilling service. Perhaps we could look just for servers with get map service but also tilling support and support for various projections. |
|
From: Jeff W. <js...@fa...> - 2012-08-27 12:34:29
|
On 8/26/12 9:07 PM, klo uo wrote: > On Sun, Aug 26, 2012 at 9:56 PM, Jeff Whitaker wrote: >> Klo: Since epsg codes comprise a very small subset of possible Basemap >> projections, it may be better to just allow Basemap to accept an epsg kwarg. >> That keyword would be required in order to use a WMS to display a map >> background. This may be tricky though, since Basemap needs more information >> to define a map projection region than is provided by the epsg code. We may >> have to start with just a few supported epsg codes and then add more as >> necessary. >> >> I added a testwms.py example to my fork >> (https://github.com/jswhit/basemap.git) that shows how to use three >> different map projections (epsg codes). > I'm not sure if I understand projection problem, as arcgis webservice > provides thousands of projections, but then you know better. > I thought that the code will be just one function which would accept > Map name, then coordinates and projection code will be deduced from > Basemap function initiation? Klo: WMS servers use EPSG codes to define map projections - Basemap uses a set of kwargs. We need some way of inferring epsg codes from the Basemap kwargs. Alternatively, we could extend Basemap so it can accept EPSG codes. But, there are many EPSG codes that don't correspond to allowable Basemap projections, and valid Basemap projections that don't correspond to EPSG codes. It's not obvious to me how to proceed. > > Here is same server from agency where you work according your > signature: maps.ngdc.noaa.gov/rest/services it provides additional > maps on same server as arcgis > > I also checked many WMS servers, first with XML editor but then with > Gaia, which was excellent help in determining that many WMS servers > just return their capabilities, but does not provide service as > described in capabilities response. Some offer tilling features, for > possible future interactive zooming in Basemap ;) Maybe it's better not have the function accept a OWSLib wms object - that way we don't have to tie ourselves to a particular WMS server. -Jeff > > Here is one http://maps.dwd.de/geoserver/wms?request=GetCapabilities&service=WMS&version=1.1.1 > which offers bluemarble in many projection. Additionally it offers > some German datasets, but does not offer tilling service. > > Perhaps we could look just for servers with get map service but also > tilling support and support for various projections. > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Alexander C. <AC...@as...> - 2012-08-27 19:03:51
|
We have a WMS server that uses basemap to display unstructured ocean model data. We just limit the set of projections to a select few (just the most common ones), and have a mapping between EPSG and the required Basemap kwargs. It sometimes requires some implementation of proj4 prior to getting to the Basemap part of the code. I can see that it could be useful and not to difficult to add an EPSG kwarg for a few most common projections and how they would be used by Basemap users. Alexander Crosby RPS-ASA On Mon, 2012-08-27 at 06:34 -0600, Jeff Whitaker wrote: On 8/26/12 9:07 PM, klo uo wrote: > On Sun, Aug 26, 2012 at 9:56 PM, Jeff Whitaker wrote: >> Klo: Since epsg codes comprise a very small subset of possible Basemap >> projections, it may be better to just allow Basemap to accept an epsg kwarg. >> That keyword would be required in order to use a WMS to display a map >> background. This may be tricky though, since Basemap needs more information >> to define a map projection region than is provided by the epsg code. We may >> have to start with just a few supported epsg codes and then add more as >> necessary. >> >> I added a testwms.py example to my fork >> (https://github.com/jswhit/basemap.git) that shows how to use three >> different map projections (epsg codes). > I'm not sure if I understand projection problem, as arcgis webservice > provides thousands of projections, but then you know better. > I thought that the code will be just one function which would accept > Map name, then coordinates and projection code will be deduced from > Basemap function initiation? Klo: WMS servers use EPSG codes to define map projections - Basemap uses a set of kwargs. We need some way of inferring epsg codes from the Basemap kwargs. Alternatively, we could extend Basemap so it can accept EPSG codes. But, there are many EPSG codes that don't correspond to allowable Basemap projections, and valid Basemap projections that don't correspond to EPSG codes. It's not obvious to me how to proceed. > > Here is same server from agency where you work according your > signature: maps.ngdc.noaa.gov/rest/services it provides additional > maps on same server as arcgis > > I also checked many WMS servers, first with XML editor but then with > Gaia, which was excellent help in determining that many WMS servers > just return their capabilities, but does not provide service as > described in capabilities response. Some offer tilling features, for > possible future interactive zooming in Basemap ;) Maybe it's better not have the function accept a OWSLib wms object - that way we don't have to tie ourselves to a particular WMS server. -Jeff > > Here is one http://maps.dwd.de/geoserver/wms?request=GetCapabilities&service=WMS&version=1.1.1 > which offers bluemarble in many projection. Additionally it offers > some German datasets, but does not offer tilling service. > > Perhaps we could look just for servers with get map service but also > tilling support and support for various projections. > > ------------------------------------------------------------------------------ > 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 > Mat...@li...<mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------------ 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 Mat...@li...<mailto:Mat...@li...> https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: klo uo <kl...@gm...> - 2012-08-27 17:25:05
|
On Mon, Aug 27, 2012 at 2:34 PM, Jeff Whitaker wrote: > Klo: WMS servers use EPSG codes to define map projections - Basemap uses a > set of kwargs. We need some way of inferring epsg codes from the Basemap > kwargs. Alternatively, we could extend Basemap so it can accept EPSG codes. > But, there are many EPSG codes that don't correspond to allowable Basemap > projections, and valid Basemap projections that don't correspond to EPSG > codes. It's not obvious to me how to proceed. >> >> Here is same server from agency where you work according your >> signature: maps.ngdc.noaa.gov/rest/services it provides additional >> maps on same server as arcgis >> >> I also checked many WMS servers, first with XML editor but then with >> Gaia, which was excellent help in determining that many WMS servers >> just return their capabilities, but does not provide service as >> described in capabilities response. Some offer tilling features, for >> possible future interactive zooming in Basemap ;) > > > Maybe it's better not have the function accept a OWSLib wms object - that > way we don't have to tie ourselves to a particular WMS server. Thanks for explaining Jeff, but aren't we using arcgis REST service which accepts more then 4500 projections? Are you saying Basemap offers projection that's not listed here: http://atlas.resources.ca.gov/arcgis/SDK/REST/gcs.html EPSG codes may be important to WMS. And providing WMS feature is maybe question how. Any GIS tool has WMS service support. Some WMS servers provide tiling capabilities and that also can be considered for future feature of fast zooming in Basemap. Most of them seem to offer just EPSG:4326 and there are servers with many projections (not as many as arcgis REST service) But at this point of static map servers we can just use urllib module and do requested WMS function which will return the map without using any additional function or package I'm validating public WMS servers and these days I'll report again. As mentioned many simply aren't working, many are localized, etc. Hope will find nice usage for some selected |
|
From: Jeff W. <jef...@no...> - 2012-08-27 19:32:10
|
On 8/27/12 11:24 AM, klo uo wrote: > On Mon, Aug 27, 2012 at 2:34 PM, Jeff Whitaker wrote: >> Klo: WMS servers use EPSG codes to define map projections - Basemap uses a >> set of kwargs. We need some way of inferring epsg codes from the Basemap >> kwargs. Alternatively, we could extend Basemap so it can accept EPSG codes. >> But, there are many EPSG codes that don't correspond to allowable Basemap >> projections, and valid Basemap projections that don't correspond to EPSG >> codes. It's not obvious to me how to proceed. >>> Here is same server from agency where you work according your >>> signature: maps.ngdc.noaa.gov/rest/services it provides additional >>> maps on same server as arcgis >>> >>> I also checked many WMS servers, first with XML editor but then with >>> Gaia, which was excellent help in determining that many WMS servers >>> just return their capabilities, but does not provide service as >>> described in capabilities response. Some offer tilling features, for >>> possible future interactive zooming in Basemap ;) >> >> Maybe it's better not have the function accept a OWSLib wms object - that >> way we don't have to tie ourselves to a particular WMS server. > > Thanks for explaining Jeff, but aren't we using arcgis REST service > which accepts more then 4500 projections? Are you saying Basemap > offers projection that's not listed here: > http://atlas.resources.ca.gov/arcgis/SDK/REST/gcs.html Klo: Yes. And vice versa, some of those 4500 projections aren't supported by Basemap. Anyway, I went ahead and created a prototype 'wmsmap' method. You can try it by cloning my fork (https://github.com/jswhit/basemap) and running examples/testwms.py. I created an extra kward 'epsg' for creating Basemap instances. To use the wmsmap function, you have to use that keyword. Give it a try and let me know what you think. -Jeff > > EPSG codes may be important to WMS. And providing WMS feature is maybe > question how. Any GIS tool has WMS service support. Some WMS servers > provide tiling capabilities and that also can be considered for future > feature of fast zooming in Basemap. Most of them seem to offer just > EPSG:4326 and there are servers with many projections (not as many as > arcgis REST service) > But at this point of static map servers we can just use urllib module > and do requested WMS function which will return the map without using > any additional function or package > > I'm validating public WMS servers and these days I'll report again. As > mentioned many simply aren't working, many are localized, etc. > Hope will find nice usage for some selected > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > 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 : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: klo uo <kl...@gm...> - 2012-08-28 15:56:11
|
On Mon, Aug 27, 2012 at 9:32 PM, Jeff Whitaker wrote: > > Klo: Yes. And vice versa, some of those 4500 projections aren't supported > by Basemap. > > Anyway, I went ahead and created a prototype 'wmsmap' method. You can try it > by cloning my fork (https://github.com/jswhit/basemap) and running > examples/testwms.py. I created an extra kward 'epsg' for creating Basemap > instances. To use the wmsmap function, you have to use that keyword. Give > it a try and let me know what you think. Jeff it looks great, everything is parametrized including server name and map name, so it should work for any additional service. However on Windows with Python 2.7 and Basemap 1.0.5 I get an error while trying to run the script: ======================================== Traceback (most recent call last): File "testwms.py", line 39, in <module> m=Basemap2(epsg=epsg,resolution='h',width=width,height=height) TypeError: __init__() got an unexpected keyword argument 'epsg' ======================================== I than added initial empty "epsg" arg to original Basemap class declaration, but then after some time processing I get: ======================================== warning: width and height keywords ignored for Cylindrical Equidistant projectionEPSG: Traceback (most recent call last): File "testwms.py", line 47, in <module> m.drawparallels(np.arange(0,80,1),labels=[1,0,0,0]) File "testwms.py", line 15, in wmsmap if not hasattr(self,'epsg'): AttributeError: 'Basemap2' object has no attribute 'epsg' ======================================== So I leave it for now and assume it's some tiny issue not obvious at this time to me. I'll continue WMS search, but yesterday I spent couple of hours just to look at those beautiful maps provided on arcgis server. I explored on all and it's so nicely done and with high resolution zoom. They are annotated though, but again, see i.e. Ocean Basemap, or overlay with transparency over some more colored topo map like GEBCO_08 from maps.ngdc.noaa.gov server - just great. World Topo also... |
|
From: Jeff W. <jef...@no...> - 2012-08-28 16:21:43
|
On 8/28/12 9:56 AM, klo uo wrote: > On Mon, Aug 27, 2012 at 9:32 PM, Jeff Whitaker wrote: >> Klo: Yes. And vice versa, some of those 4500 projections aren't supported >> by Basemap. >> >> Anyway, I went ahead and created a prototype 'wmsmap' method. You can try it >> by cloning my fork (https://github.com/jswhit/basemap) and running >> examples/testwms.py. I created an extra kward 'epsg' for creating Basemap >> instances. To use the wmsmap function, you have to use that keyword. Give >> it a try and let me know what you think. > Jeff it looks great, everything is parametrized including server name > and map name, so it should work for any additional service. > However on Windows with Python 2.7 and Basemap 1.0.5 I get an error > while trying to run the script: Klo: Just added a pull request for this https://github.com/matplotlib/basemap/pull/73 Regarding your windows error - you have to rebuild basemap to get the needed updates (it's not just a matter of running the testwms.py script). -Jeff > ======================================== > Traceback (most recent call last): > File "testwms.py", line 39, in <module> > m=Basemap2(epsg=epsg,resolution='h',width=width,height=height) > TypeError: __init__() got an unexpected keyword argument 'epsg' > ======================================== > > I than added initial empty "epsg" arg to original Basemap class > declaration, but then after some time processing I get: > ======================================== > warning: width and height keywords ignored for Cylindrical Equidistant > projectionEPSG: > Traceback (most recent call last): > File "testwms.py", line 47, in <module> > m.drawparallels(np.arange(0,80,1),labels=[1,0,0,0]) > File "testwms.py", line 15, in wmsmap > if not hasattr(self,'epsg'): > AttributeError: 'Basemap2' object has no attribute 'epsg' > ======================================== > > So I leave it for now and assume it's some tiny issue not obvious at > this time to me. > > I'll continue WMS search, but yesterday I spent couple of hours just > to look at those beautiful maps provided on arcgis server. I explored > on all and it's so nicely done and with high resolution zoom. They are > annotated though, but again, see i.e. Ocean Basemap, or overlay with > transparency over some more colored topo map like GEBCO_08 from > maps.ngdc.noaa.gov server - just great. World Topo also... > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > 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 : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: klo uo <kl...@gm...> - 2012-08-28 16:57:10
|
>> Jeff it looks great, everything is parametrized including server name >> and map name, so it should work for any additional service. >> However on Windows with Python 2.7 and Basemap 1.0.5 I get an error >> while trying to run the script: > > > Klo: Just added a pull request for this > > https://github.com/matplotlib/basemap/pull/73 > > Regarding your windows error - you have to rebuild basemap to get the needed > updates (it's not just a matter of running the testwms.py script). Thanks will do that right now. I was just investigating possibility of returning clear map without annotations where it is possible. For example World_Topo_Map (http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer) has additional layers and according layers parameter in export function (http://atlas.resources.ca.gov/arcgis/SDK/REST/export.html): ======================================== Description: Determines which layers appear on the exported map. There are four ways to specify which layers are shown: show: Only the layers specified in this list will be exported. hide: All layers except those specified in this list will be exported. include: In addition to the layers exported by default, the layers specified in this list will be exported. exclude: The layers exported by default excluding those specified in this list will be exported. Syntax: [show | hide | include | exclude]:layerId1,layerId2 where layerId1, layerId2are the layer ids returned by the map service resource Example: layers=show:2,4,7 ======================================== if we add additional parameter "&layers=hide:5,6,7,8,9" I expected annotations to be gone, but unfortunately not there yet Will look further if it's somehow possible to clear annotations. |