SciTools / cartopy

Cartopy - a cartographic python library with matplotlib support
https://scitools.org.uk/cartopy/docs/latest
BSD 3-Clause "New" or "Revised" License
1.41k stars 359 forks source link

Access OGC Web Map Tile Services (WMTS) #405

Closed rsignell-usgs closed 10 years ago

rsignell-usgs commented 10 years ago

It would be cool if Cartopy could access generic OGC Web Map Tile Services (WMTS), such as the one here: http://www.digitalglobe.com/super-typhoon-haiyan#imagery-access

The getCapabilities document for this WMTS is here: https://services.digitalglobe.com/earthservice/wmtsaccess?connectid=1ad41a7a-2a21-4221-b524-94aa6b63cdf4&request=getCapabilities

And this is a more generally useful (global one):

from owslib.wmts import WebMapTileService
wmts = WebMapTileService("http://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi")
print wmts.identification.type
print wmts.identification.version
print wmts.identification.title

produces:

OGC WMTS
1.0.0
NASA Global Imagery Browse Services for EOSDIS
Near real time imagery from multiple NASA instruments
['World', 'Global']

and

print sorted(list(wmts.contents))

produces

['AIRS_CO_Total_Column_Day',
 'AIRS_CO_Total_Column_Night',
 'AIRS_Dust_Score',
 'AIRS_Prata_SO2_Index_Day',
 'AIRS_Prata_SO2_Index_Night',
 'AIRS_Precipitation_Day',
 'AIRS_Precipitation_Night',
 'AMSRE_Brightness_Temp_89H_Day',
 'AMSRE_Brightness_Temp_89H_Night',
 'AMSRE_Brightness_Temp_89V_Day',
 'AMSRE_Brightness_Temp_89V_Night',
 'MEaSUREs_Daily_Landscape_Freeze_Thaw_AMSRE',
 'MEaSUREs_Daily_Landscape_Freeze_Thaw_SSMI',
 'MLS_CO_215hPa_Day',
 'MLS_CO_215hPa_Night',
 'MLS_H2O_46hPa_Day',
 'MLS_H2O_46hPa_Night',
 'MLS_HNO3_46hPa_Day',
 'MLS_HNO3_46hPa_Night',
 'MLS_N2O_46hPa_Day',
 'MLS_N2O_46hPa_Night',
 'MLS_O3_46hPa_Day',
 'MLS_O3_46hPa_Night',
 'MLS_SO2_147hPa_Day',
 'MLS_SO2_147hPa_Night',
 'MLS_Temperature_46hPa_Day',
 'MLS_Temperature_46hPa_Night',
 'MODIS_Aqua_Aerosol',
 'MODIS_Aqua_Brightness_Temp_Band31_Day',
 'MODIS_Aqua_Brightness_Temp_Band31_Night',
 'MODIS_Aqua_Chlorophyll_A',
 'MODIS_Aqua_Cloud_Top_Pressure_Day',
 'MODIS_Aqua_Cloud_Top_Pressure_Night',
 'MODIS_Aqua_Cloud_Top_Temp_Day',
 'MODIS_Aqua_Cloud_Top_Temp_Night',
 'MODIS_Aqua_CorrectedReflectance_Bands721',
 'MODIS_Aqua_CorrectedReflectance_TrueColor',
 'MODIS_Aqua_Data_No_Data',
 'MODIS_Aqua_Land_Surface_Temp_Day',
 'MODIS_Aqua_Land_Surface_Temp_Night',
 'MODIS_Aqua_Sea_Ice',
 'MODIS_Aqua_Snow_Cover',
 'MODIS_Aqua_SurfaceReflectance_Bands121',
 'MODIS_Aqua_SurfaceReflectance_Bands143',
 'MODIS_Aqua_SurfaceReflectance_Bands721',
 'MODIS_Aqua_Water_Vapor_5km_Day',
 'MODIS_Aqua_Water_Vapor_5km_Night',
 'MODIS_Combined_Value_Added_AOD',
 'MODIS_Terra_Aerosol',
 'MODIS_Terra_Brightness_Temp_Band31_Day',
 'MODIS_Terra_Brightness_Temp_Band31_Night',
 'MODIS_Terra_Chlorophyll_A',
 'MODIS_Terra_Cloud_Top_Pressure_Day',
 'MODIS_Terra_Cloud_Top_Pressure_Night',
 'MODIS_Terra_Cloud_Top_Temp_Day',
 'MODIS_Terra_Cloud_Top_Temp_Night',
 'MODIS_Terra_CorrectedReflectance_Bands367',
 'MODIS_Terra_CorrectedReflectance_Bands721',
 'MODIS_Terra_CorrectedReflectance_TrueColor',
 'MODIS_Terra_Data_No_Data',
 'MODIS_Terra_Land_Surface_Temp_Day',
 'MODIS_Terra_Land_Surface_Temp_Night',
 'MODIS_Terra_Sea_Ice',
 'MODIS_Terra_Snow_Cover',
 'MODIS_Terra_SurfaceReflectance_Bands121',
 'MODIS_Terra_SurfaceReflectance_Bands143',
 'MODIS_Terra_SurfaceReflectance_Bands721',
 'MODIS_Terra_Water_Vapor_5km_Day',
 'MODIS_Terra_Water_Vapor_5km_Night',
 'MODIS_Water_Mask',
 'OMI_Absorbing_Aerosol_Optical_Depth',
 'OMI_Aerosol_Index',
 'OMI_Aerosol_Optical_Depth',
 'OMI_Cloud_Pressure',
 'OMI_SO2_Lower_Troposphere',
 'OMI_SO2_Middle_Troposphere',
 'OMI_SO2_Planetary_Boundary_Layer',
 'OMI_SO2_Upper_Troposphere_and_Stratosphere',
 'Sea_Surface_Temp_Blended',
 'Sea_Surface_Temp_Infrared',
 'Sea_Surface_Temp_Microwave',
 'VIIRS_CityLights_2012']

'NASA Global Imagery Browse Services for EOSDIS'

esc24 commented 10 years ago

I agree. I'm keen that we improve our support for the OGC standards in Cartopy and Iris. Thanks for the links. Any thoughts on an API?

rsignell-usgs commented 10 years ago

I don't, really, besides building on the OWSLib implementation. I'm glad you think this is cool. I was imagining you might just say to use mapproxy.org.

rhattersley commented 10 years ago

It would be cool if Cartopy could access generic OGC Web Map Tile Services (WMTS), such as the one here: http://www.digitalglobe.com/super-typhoon-haiyan#imagery-access

Is this WMTS still available? I get nothing but white tiles... :unamused:

rsignell-usgs commented 10 years ago

I think it might just be a very limited region that is covered. NASA's WMTS is probably a better endpoint for testing: https://wiki.earthdata.nasa.gov/pages/viewpage.action?pageId=14518214 https://earthdata.nasa.gov/labs/gibs/examples/openlayers-wmts/

rhattersley commented 10 years ago

FYI: I've pushed #407 to get the ball rolling.

pelson commented 10 years ago

@rsignell-usgs - @rhattersley has just had his PR merged which adds this functionality. I've put together a short notebook demonstrating: http://nbviewer.ipython.org/gist/pelson/6f7fc8c182a13ed34a76 The thing the notebook doesn't do well is highlight the slippy maps nature of @rhattersley's implementation, which I think is pretty slick (even if Google et al. have been doing it for years in the web browser :wink:).

esc24 commented 10 years ago

Thanks @pelson. It's worth noting that if you don't want to bother to explicitly instantiate the WebMapTileService you can just pass the url directly.

rhattersley commented 10 years ago

I've put together a short notebook demonstrating

You beat me to it! :unamused:

the slippy maps nature ... which I think is pretty slick

Yeah, it's oddly exciting being able to plug a standard WMTS endpoint into Cartopy and just pan/zoom your way around it. :smile: