| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository houses definitions of geometric features. These features
can include regions, transects, and points, described in geojson format.
For example, here are some regions for Antarctica.

http://mpas-dev.github.io/geometric_features/main/
Data for regions has been derived from sources listed in the contributors file as specified via the author field in each geojson file.
The python geometric_features package can be used to help maintain and use this repository. Several example scripts that make use of the package can be found in the examples directory. Each of the classes and functions that make up the package have extensive documentation. More user-level documentation will be added shortly.
To use geometric features, you can install it in a conda environment:
conda create -n geometric_features -c conda-forge python=3.13 geometric_features
conda activate geometric_featuresTo develop geometric_features (e.g. to add new features), install the default pixi environment:
pixi installIf you want a different Python version, choose one of the versioned pixi environments:
pixi install -e py310The development environment in pixi.toml is equivalent to the legacy dev-spec.txt, with the local package installed in editable mode and an additional package environment for rattler-build.
A typical workflow will look like:
Available functionality includes:
IMPORTANT: Always use the gf.split(fc) script when placing features into the geometric_data directory. This will help everyone maintain the repository, and allow tools to parse them cleanly.
Many of this functionality can also be accessed with a command-line interface:
merge_features
combine_features
difference_features
set_group_name
split_features
simplify_features
tag_features
plot_featuresUse the -h flag to find out more.
An example workflow to read in, plot and write out a set of features is
#!/usr/bin/env python
from geometric_features import GeometricFeatures
import matplotlib.pyplot as plt
# create a GeometricFeatures object that points to a local cache of geometric
# data and knows which branch of geometric_feature to use to download
# missing data
gf = GeometricFeatures(cacheLocation='./geometric_data')
# read in a FeatureCollection containing all ocean regions in the Atlantic
# basin
fcAtlantic = gf.read(componentName='ocean', objectType='region',
tags=['Atlantic_Basin'])
fcAtlantic.plot('cyl')
plt.title('Atlantic merged')
# combine them all into a single feature
fcAtlantic = fcAtlantic.combine(featureName='Atlantic_Basin')
fcAtlantic.plot('cyl')
plt.title('Atlantic combined')
# make another feature containing the regions in Filchner-Ronne Ice Shelf
fcFilchnerRonne = gf.read(componentName='iceshelves', objectType='region',
featureNames=['Filchner_1', 'Filchner_2',
'Filchner_3', 'Ronne_1', 'Ronne_2'])
fcFilchnerRonne.plot('southpole')
plt.title('Filchner-Ronne')
# make one more collection of all the IMBIE basins in West Antarctica
fcWestAntarctica = gf.read(componentName='landice', objectType='region',
tags=['WestAntarcticaIMBIE'])
fcWestAntarctica.plot('southpole')
plt.title('West Antarctica')
fcWestAntarctica.to_geojson('west_antarctica.geojson')
plt.show()| Back | FazBrowse Home | New Git URL |