Overview
In this section we demonstrate how to use the Geoconnex Reference Feature server API. We'll explore various use cases for working with hydrological and related spatial data. These use cases can be groups into three categories:
- Finding identifiers and spatial geometries for real-world features
- Finding features that are hydrologically related to a feature of interest (if that information is available)
- Finding datasets related to a feature of interest
The R examples can also be found formatted as one longer Quarto notebook here
Throughout all examples, we will be using the following libraries/constants:
- R
- Python
library(sf)
library(dplyr)
library(httr)
library(mapview)
library(jsonlite)
library(knitr)
library(DT)
base_url <- "https://reference.geoconnex.us"
import requests
import pandas as pd
import urllib.parse
import requests
import geopandas as gpd
import folium
base_url = "https://reference.geoconnex.us"
Useful resources for Geoconnex queries
The Geoconnex reference feature server implements the OGC API - Features specification, and its full API documentation is available here for those who wish to explore its capabilities further than what is demonstrated in these examples.
Although we do not use them in these examples, there are additional client libraries that provide wrappers over the Geoconnex reference feature server API for easier querying.
- HyRiver provides a Python client library and allows for queries by spatial areas, by ID, and using CQL filters. Documentation for using HyRiver with Geoconnex can be found here.
- nhdplusTools is an R package for accessing and working with the NHDPlus and other US hydrographic data. It contains helper functions for working with Geoconnex.
-
get_geoconnex_reference() queries the geoconnex reference feature server for features of interest.
-
discover_geoconnex_reference() queries the geoconnex.us reference feature server for available layers and attributes.
-