geopandas / xyzservices

Source of XYZ tiles providers
https://xyzservices.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
169 stars 32 forks source link

Add quarterly basemap imagery from Planet #169

Closed collijk closed 7 months ago

collijk commented 7 months ago

This PR:

make compress also added two new sources ( "Ofb_Zones_Exclues_Sauf_Toiture" and "Potentiel_Solaire_Rrn") and removed one ("Zonage_Ofb"), I presume because it makes some live requests in the compression script to find WMTS services.

I have manually validated that I get the appropriate error when requesting tiles without an api key: image

I have verified I can pull through tiles for all added sources:

years = list(range(2016, 2025))
quarters = [1, 2, 3, 4]

fig, axes = plt.subplots(figsize=(3*len(years), 3*len(quarters)), nrows=len(quarters), ncols=len(years))

for col, year in enumerate(years):
    for row, quarter in enumerate(quarters):    
        ax = axes[row, col]
        if year == 2024 and quarter > 1:
            ax.set_axis_off()
            continue        

        ethiopia.iloc[[0]].boundary.plot(ax=ax)        
        cx.add_basemap(ax, source=xyz.providers.Planet[f"QuarterlyBasemaps{year}q{quarter}"](api_key=planet_api_key))

        if not row:
            ax.set_title(year, fontsize=18)
        if not col:
            ax.set_ylabel(f"Q{quarter}", fontsize=18)

        strip_axes(ax)

fig.tight_layout()

image

martinfleis commented 7 months ago

Is a registration enough to use these tiles or do we need to pay to get an API key? xyzservices contains only free tiles and the Planet site seems to push me towards "Contact sales" only.

collijk commented 7 months ago

Ah, good to know. They have a free tier for access, but primarily access is done through paid subscriptions: https://www.planet.com/markets/education-and-research/#apply-now

martinfleis commented 7 months ago

If it is academic only, then it won't qualify. Sorry!