Welcome to georest¶
georest is an open source Python library for the geospatial REST APIs that public agencies publish: ArcGIS Image, Map and Feature Services, ArcGIS Portal search, the USDA Forest Service Enterprise Data Warehouse (EDW), Forest Inventory and Analysis (FIA) estimates and Landscape Change Monitoring System (LCMS) summaries, and the USGS Water Data OGC API. Developed by RedCastle Resources, it turns those services into plain Python calls, so finding a dataset, reading its metadata and pulling its features or pixels takes a few lines instead of hand-built query strings.
pip install georest
What georest covers¶
Module |
What it does |
|---|---|
Generic Image, Map and Feature Service queries: tile URL templates, features as GeoJSON, and Image Service raster operations ( |
|
ArcGIS Portal search (ArcGIS Online, IIPP, USGS, NOAA, USFS, NASA, or any ArcGIS Enterprise portal) and service metadata. |
|
The USFS Enterprise Data Warehouse: catalog search, layer roles, FGDC and ISO metadata, and feature and analytic queries. |
|
Signing in to ArcGIS Online or a Portal for secured content. |
|
USGS Water Data: monitoring locations, daily and continuous values, field measurements, peaks and time-series metadata. |
|
Forest Inventory and Analysis: estimates of forest area, volume, carbon, growth and more, each with its sampling error and plot count; plus searches for what to estimate (attributes, evaluations, groupings). |
|
Landscape Change Monitoring System: land cover, land use and change for counties, ranger districts and national rollups, with class tables and palettes from the API. |
|
LCMS as Earth Engine image collections, for summaries over your own polygon (optional: |
|
LCMS treed area beside FIA forest-land area, kept apart and labelled with the reasons they differ. |
|
The cached FIA catalogs behind the |
Quick start¶
from georest.esri import edw, portal, services
from georest.usgs import waterdata
# Search the USFS EDW catalog by keyword or theme
hits = edw.search_edw_services("fire")
# Features as GeoJSON: layer 63 is "Burned Area Boundaries (All Years)"
fires = edw.query_features(
"EDW_MTBS_01", 63,
where="fire_name LIKE '%CAMERON PEAK%'",
out_fields="fire_name,acres,year",
)
# Search any ArcGIS Portal
results = portal.searchPortal("naip 2023", portal="agol")
# A tile URL template for an Image Service
tile_url = services.getImageServiceTileUrl("https://.../ImageServer")
# USGS Water Data: stream gages in a box, then a month of daily discharge
gages = waterdata.search_monitoring_locations(
bbox=(-111.7, 36.8, -111.5, 37.0), site_type_code="ST")
flow = waterdata.get_daily_values("USGS-09380000", "00060",
start="2024-01-01", end="2024-01-31")
# Forest Service: an FIA estimate always comes with its sampling error
from georest.usfs import fia, lcms
wc = fia.find_evaluations("Oregon")["wc"].iloc[0]
forest = fia.estimate(wc, 2, rselected="County code and name") # se_pct, plots
cover = lcms.lcms_summary("Land_Cover", state="Oregon", county="Crook")
The provider modules are also available from the top level (from georest import edw). They load on first use, so import georest itself is nearly free.
Getting started¶
Installation covers installing georest, including into ArcGIS Pro’s Python.
Authentication covers signing in for secured ArcGIS content and using a USGS API key.
Module Overview describes every module and links to the full API reference.
Examples has runnable notebooks for each provider.