Skip to main content

A Python library that both a client that downloads various shapefiles and GEOJSON files from the web and processes these geometry files. Users can also process locally hosted shapefiles and GEOJSON files. Also works for those on VPN/PROXY connections.

Project description

shapeography

Alt text Alt text

(C) Eric J. Drewitz 2026

An open-source Python package that manages shapefiles and GEOJSON files.

Jupyter Lab Examples

  1. Downloading and Plotting the National Weather Service Public Forecast Zones
  2. Downloading and Plotting the NOAA/NWS Climate Prediction Center 6-10 Day Probabilistic Precipitation Outlook

Client Module

Documentation

The client module hosts the client function get_shapefiles() that downloads shapefiles/GEOJSON file from a user-defined URL address into a folder locally on your PC.

The user must specify the path and filename and the file is saved to {path}/{filename}.

This client is also helpful for those using shapeography in automated scripts. If the user keeps the optional argument refresh=True - The directory hosting the shapefiles/GEOJSON file will be refreshed as the old files will be deleted and new files downloaded. This can be helpful in automation due to periodic shapefile updates on the server-side as it ensures that the user will always have the most recent and up to date shapefiles/GEOJSON file.

This client supports users on a VPN/PROXY connection.

**Proxy Example**

proxies=None ---> proxies={
                       'http':'address:port',
                       'https':'address:port'
                    } 

shapeography.client.get_shapefiles(url, path, filename, proxies=proxies)

Unzip Module

Documentation

The unzip module hosts the function that unzips the shapefiles/GEOJSON file if the file(s) need to be unzipped.

In nearly all cases, shapefile components are within a zipfile server-side so needing to unzip is very common.

The function extract_files() unzips the shapefiles/GEOJSON into a user-specified extraction folder that is automatically generated.

Supports the following file extentions: .zip, .gz, .tar, .tar.gz

Geometry Module

Documentation

The geometry module hosts functions that extract data from these shapefiles/GEOJSON file and make it significantly easier to work with this data in Python.

The current functions are:

  1. cartopy_shapefeature() - Returns a cartopy.shapefeature from the data inside the shapefile/GEOJSON.
  2. get_geometries() - Returns a gpd.GeoDataFrame of the geometry data of the shapefile/GEOJSON in the coordinate reference system (CRS) specified by the user. (Default CRS = 'EPSG:4326' --> ccrs.PlateCarree())
  3. geodataframe() - Returns gpd.GeoDataFrame hosting all the data in the shapefile/GEOJSON in the coordinate reference system (CRS) specified by the user. (Default CRS = 'EPSG:4326' --> ccrs.PlateCarree())

Citations

  1. cartopy: Phil Elson, Elliott Sales de Andrade, Greg Lucas, Ryan May, Richard Hattersley, Ed Campbell, Andrew Dawson, Bill Little, Stephane Raynaud, scmc72, Alan D. Snow, Ruth Comer, Kevin Donkers, Byron Blay, Peter Killick, Nat Wilson, Patrick Peglar, lgolston, lbdreyer, … Chris Havlin. (2023). SciTools/cartopy: v0.22.0 (v0.22.0). Zenodo. https://doi.org/10.5281/zenodo.8216315
  2. geopandas: Kelsey Jordahl, Joris Van den Bossche, Martin Fleischmann, Jacob Wasserman, James McBride, Jeffrey Gerard, … François Leblanc. (2020, July 15). geopandas/geopandas: v0.8.1 (Version v0.8.1). Zenodo. http://doi.org/10.5281/zenodo.3946761
  3. requests: K. Reitz, "Requests: HTTP for Humans". Available: https://requests.readthedocs.io/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shapeography-0.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shapeography-0.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file shapeography-0.1.tar.gz.

File metadata

  • Download URL: shapeography-0.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for shapeography-0.1.tar.gz
Algorithm Hash digest
SHA256 1260b8868b66a9e9bdf5c011fd7087b3842b950e863e7a2d5284e8b0ce5d5480
MD5 c4e7c8b8b4e6a458ee44939ca13cba37
BLAKE2b-256 cee6276334a4d0022b735b0db665f20a3935fe31fac2aabc791f475770a71d1e

See more details on using hashes here.

File details

Details for the file shapeography-0.1-py3-none-any.whl.

File metadata

  • Download URL: shapeography-0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for shapeography-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3bb917e7f134be0505c874c8ee4eecb5a0252730ffab5aacd6184f2d32aadf37
MD5 acc4f3b77fa2e521bdfaa13c49eba865
BLAKE2b-256 4ed993684b0cdbaf061b3ad401d7d0d92e3a995fe848fb61d6238e332ffa247e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page