/geo-features

Mojo Geographic and geometric vector features

Primary LanguageMakefileMIT LicenseMIT

geo-features

Run Tests

Mojo🔥 package for geographic or geometric vector features, for example: location data or earth observation data. It is based upon the GeoJSON and ISO/OGC Simple Features standards.

⚠️ pre-alpha, not yet usable!

If you are interested in contributing or discussing, please first contact me by email or DM on Mojo Discord.

requirements

project goals

  • Apply Mojo's systems programming features to create a new geo package with strong type safety and high performance.
  • Promote cloud native geospatial computing and open geospatial standards, ex: GeoParquet.
  • Leverage the vast Python ecosystem, wherever possible, to enable rapid development and interoperability.

roadmap

core structs

  • Envelope
  • Feature
  • FeatureCollection
  • GeometryCollection
  • LinearRing
  • LineString
  • Memory Layout
  • MultiLineString
  • MultiPoint
  • MultiPolygon
  • Point
  • Polygon

serialization and interchange formats

  • GeoArrow
  • GeoJSON
  • GeoParquet
  • TopoJSON
  • WKT

methods and algorithms

  • area
  • perimeter
  • centroid
  • intersection
  • union
  • difference
  • parallelized+vectorized spatial join
  • rasterize from vector
  • vectorize from raster
  • re-projection and CRS support
  • simplify or decimate
  • stratified sampling?
  • zonal stats?
  • smart antimeridian crossing mode (quaternions?)

architectural decisions

  • Implement a columnar memory layout similar to GeoArrow, for efficient representation of coordinates, features and attributes.

related work

setup dev environment

  1. Clone this repo, including submodules:

    git clone --recurse-submodules https://github.com/guidorice/geo-features
  2. Create a Python environment using environment.yml. This is required for supporting packages used by geo-features, for example for interchange, serialization, and unit testing. Conda is recommended because it puts a copy of libpython into each conda env.

    conda env create -n geo-features --file environment.yml
    
  3. Set MOJO_PYTHON_LIBRARY environment variable to your libpython. An example of doing this on MacOS is the scripts directory. Help: Using Mojo with Python .

  4. Run targets in Makefile, ex: make test, make package, make format.