https://github.com/juliageo/geometryops.jl
GeoInterface-based geometry operations
https://github.com/juliageo/geometryops.jl
geometry geospatial julia
Last synced: 5 months ago
JSON representation
GeoInterface-based geometry operations
- Host: GitHub
- URL: https://github.com/juliageo/geometryops.jl
- Owner: JuliaGeo
- License: mit
- Created: 2023-05-04T18:14:42.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-11T14:23:23.000Z (about 2 years ago)
- Last Synced: 2024-06-11T17:34:33.866Z (about 2 years ago)
- Topics: geometry, geospatial, julia
- Language: Julia
- Homepage: https://juliageo.org/GeometryOps.jl/
- Size: 127 MB
- Stars: 11
- Watchers: 4
- Forks: 2
- Open Issues: 64
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Citation: CITATION.bib
Awesome Lists containing this project
README


[](https://JuliaGeo.github.io/GeometryOps.jl/stable/)
[](https://JuliaGeo.github.io/GeometryOps.jl/dev/)
[](https://github.com/JuliaGeo/GeometryOps.jl/actions/workflows/CI.yml?query=branch%3Amain)
[](https://blazingly.fast)

> [!WARNING]
> This package is still under heavy development! Use with care.
GeometryOps.jl is a package for geometric calculations on (primarily 2D) geometries.
The driving idea behind this package is to unify all the disparate packages for geometric calculations in Julia, and make them [GeoInterface.jl](https://github.com/JuliaGeo/GeoInterface.jl)-compatible. We are focusing primarily on 2/2.5D geometries for now. All methods in this package will consume any geometry which is compatible with GeoInterface - see its [integrations page](https://juliageo.org/GeoInterface.jl/stable/reference/integrations/) for more info on that!
Most of the use cases are driven by GIS and similar Earth data workflows, so this might be a bit specialized towards that, but methods should always be general to any coordinate space.
We welcome contributions, either as pull requests or discussion on issues!
## Methods
GeometryOps tries to offer most of the basic geometry operations you'd need, implemented in pure Julia and accepting any GeoInterface.jl compatible type.
- General geometry methods (OGC methods): `equals`, `extent`, `distance`, `crosses`, `contains`, `intersects`, etc
- Targeted function application over large nested geometries (`apply`) and reduction over geometries (`applyreduce`)
- Both `apply` and `applyreduce` consume arbitrary tables as well, like DataFrames!
- `signed_area`, `centroid`, `distance`, etc for valid geometries
- Line and polygon simplification (`simplify`)
- Polygon clipping, `intersection`, `difference` and `union`
- Generalized barycentric coordinates in polygons (`barycentric_coordinates`)
- Projection of geometries between coordinate reference systems using [Proj.jl](https://github.com/JuliaGeo/Proj.jl)
- Polygonization of raster images by contour detection (`polygonize`)
- Segmentization/densification of geometry, both linearly and by geodesic paths (`segmentize`)
See the "API" page in the docs for a more complete list!
## How to navigate the docs
GeometryOps' [docs](https://juliageo.org/GeometryOps.jl/stable) are divided into three main sections: tutorials, explanations and source code.
Documentation and examples for many functions can be found in the source code section, since we use literate programming in GeometryOps.
- Tutorials are meant to teach the fundamental concepts behind GeometryOps, and how to perform certain operations.
- Explanations usually contain little code, and explain in more detail how GeometryOps works.
- Source code usually contains explanations and examples at the top of the page, followed by annotated source code from that file.
## Performance comparison to other packages
From the wonderful [vector-benchmark](https://www.github.com/kadyb/vector-benchmark),
[](https://github.com/kadyb/vector-benchmark/pull/12)
More benchmarks coming soon!
### Planned additions
- Buffering, hulls (convex and otherwise)
- Checks for valid geometries (empty linestrings, null points, etc) ([#14](https://github.com/JuliaGeo/GeometryOps.jl/issues/14))
- Operations on spherical (non-Euclidean) geometry ([#17](https://github.com/JuliaGeo/GeometryOps.jl/issues/17))