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

georest.esri.services

Generic Image, Map and Feature Service queries: tile URL templates, features as GeoJSON, and Image Service raster operations (exportImage, statistics and histograms, pixel values, samples).

georest.esri.portal

ArcGIS Portal search (ArcGIS Online, IIPP, USGS, NOAA, USFS, NASA, or any ArcGIS Enterprise portal) and service metadata.

georest.esri.edw

The USFS Enterprise Data Warehouse: catalog search, layer roles, FGDC and ISO metadata, and feature and analytic queries.

georest.esri.auth

Signing in to ArcGIS Online or a Portal for secured content.

georest.usgs.waterdata

USGS Water Data: monitoring locations, daily and continuous values, field measurements, peaks and time-series metadata.

georest.usfs.fia

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).

georest.usfs.lcms

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.

georest.usfs.lcms_ee

LCMS as Earth Engine image collections, for summaries over your own polygon (optional: pip install "georest[ee]").

georest.usfs.align

LCMS treed area beside FIA forest-land area, kept apart and labelled with the reasons they differ.

georest.usfs.vocab

The cached FIA catalogs behind the fia searches, and refreshing them.

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.

Documentation contents