Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quarterly basemap imagery from Planet #169

Closed

Conversation

collijk
Copy link

@collijk collijk commented Apr 27, 2024

This PR:

  • Adds pycharm settings to the gitignore (don't want to contribute my ide cruft 🙂 )
  • Adds all available quarterly basemaps from Planet labs from their xyz service to provider_sources/xyzservices-providers.json
  • Updates xyzservices/data/providers.json with make compress

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
Copy link
Member

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
Copy link
Author

collijk commented Apr 28, 2024

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
Copy link
Member

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

@collijk collijk closed this Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants