Skip to content

Commit

Permalink
pure gpd for gadm
Browse files Browse the repository at this point in the history
  • Loading branch information
knaaptime committed Nov 7, 2024
1 parent c3906c7 commit 0401a4e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions geosnap/io/gadm.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
"""Utilities for fetching data from GADM."""

import os
import tempfile

import geopandas as gpd


def get_gadm(code, level=0, use_fsspec=True, gpkg=True, n_retries=3):
def get_gadm(code, level=0):
"""Collect data from GADM as a geodataframe.
Parameters
Expand Down Expand Up @@ -36,11 +33,9 @@ def get_gadm(code, level=0, use_fsspec=True, gpkg=True, n_retries=3):
with this method would always returns the layer with index 0 in the geopackage file).
"""
code = code.upper()
import fsspec


gdf = gpd.read_file(
f"https://geodata.ucdavis.edu/gadm/gadm4.1/gpkg/gadm41_{code}.gpkg",
layer=f"ADM_ADM_{level}",
)
f"https://geodata.ucdavis.edu/gadm/gadm4.1/gpkg/gadm41_{code}.gpkg",
layer=f"ADM_ADM_{level}",
)
return gdf

0 comments on commit 0401a4e

Please sign in to comment.