Crate gistools

Crate gistools 

Source
Expand description

§GIS Tools 🌎 🗺️

                ___                       ___                          
               /\  \          ___        /\  \
              /::\  \        /\  \      /::\  \
             /:/\:\  \       \:\  \    /:/\ \  \
            /:/  \:\  \      /::\__\  _\:\~\ \  \
           /:/__/_\:\__\  __/:/\/__/ /\ \:\ \ \__\
           \:\  /\ \/__/ /\/:/  /    \:\ \:\ \/__/
            \:\ \:\__\   \::/__/      \:\ \:\__\
             \:\/:/  /    \:\__\       \:\/:/  /
              \::/  /      \/__/        \::/  /
               \/__/                     \/__/
   ___           ___           ___           ___       ___
  /\  \         /\  \         /\  \         /\__\     /\  \
  \:\  \       /::\  \       /::\  \       /:/  /    /::\  \
   \:\  \     /:/\:\  \     /:/\:\  \     /:/  /    /:/\ \  \
   /::\  \   /:/  \:\  \   /:/  \:\  \   /:/  /    _\:\~\ \  \
  /:/\:\__\ /:/__/ \:\__\ /:/__/ \:\__\ /:/__/    /\ \:\ \ \__\
 /:/  \/__/ \:\  \ /:/  / \:\  \ /:/  / \:\  \    \:\ \:\ \/__/
/:/  /       \:\  /:/  /   \:\  /:/  /   \:\  \    \:\ \:\__\
\/__/         \:\/:/  /     \:\/:/  /     \:\  \    \:\/:/  /
               \::/  /       \::/  /       \:\__\    \::/  /
                \/__/         \/__/         \/__/     \/__/

§Install

cargo add gis-tools

§About

A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.

This library is designed to be lightweight with minimal dependencies. All code that doesn’t require STD will avoid it, so all readers and writers are accessible to the browser or embedded systems if needed.

§Features

Notable features of GIS Tools are:

  • 🔗 Lightweight, fast, and memory efficient. no_std builds for Rust.
  • 🗺️ Full toolkit support for WGS84, Web Mercator, and S2 projections. Other projections are coerced under the hood for your benefit.
  • 🌱 A large list of projections can be converted to/from one of the above 3 via Transformers.
  • 📦 Build Vector Tiles, Raster Tiles, and Gridded Data Tiles. Vector supports 3 output formats (Mapbox Vector Tile, Open S2 Tiles, and Flat Open S2 Tiles).
  • ✅ Most data structures support all projections, but primarily focus the big 3 states above. Also handle large data sets through working with the filesystem and mmap buffers.
  • 📖 Contains 23 native GIS readers. The list of readers are: CSV, GBFS, GeoTIFF, GPX, GRIB2, GTFS, JPEG and JPEG2000, (Geo|S2)JSON, LineDelimted GeoJSON, GeoJSON Text Sequences, LAS, LAZ, NadGrids, NetCDF, OSM, (S2)PMTiles, Shapefiles, raster and vector tiles, WKT, and XML.
  • 🦺 Secure code where the only external dependencies are libm, half, regex, serde, serde_json, and some optional std memmap2, image, and flate2.
  • 🧲 Full suite of tools for points, lines, polygons, greater-circle-arcs, predicates, and more.
  • 🌌 Space specific tools for planets and satellite orbits.

§Goals

Making GIS data easy to parse and work with. One of the biggest issues in GIS right now is how segmented various niche tools are. The other issue is how most solutions to read GIS data are half baked, deprecated, or partially parse results that may also need to be transformed one more time to use them.

This library exists to make GIS tools simple to use, various data types are fast to parse, and a gaurentee that the parsed data is compatible with said tools. Stored geometry projections will be transformed to be either WGS84 or S2 Projections so you don’t have to worry about those complexities.

Lastly the goal is for all code to be accessible to both the browser and locally. An example is the Shapefile reader where it can pull from online data or handle extremely large file locally in parallel locally as well.

§Usage

The Documentation is very thorough in this library. Therefore the best thing to do is follow the links provided as needed.

§Readers

All the following readers implement the crate::parsers::FeatureReader trait. This is useful because each tool and writer use this trait to work with any reader to ensure consistency of the projection and structure without needing you to worry about the setup. It also allows you to directly read in s2json::VectorFeature data using the iter or par_iter functions.

§Tools

§Data Tools
§Geometry Tools

Points

Lines

Polygons

Clip

§Interpolation Tools

§Writers

Writers are tools for writing to certain formats, build tiles, etc.

All writer tools use the crate::parsers::Writer trait to write data to. Some of the writers have another level of indirection for writing tiles and use both/either the crate::writers::TileWriter and crate::writers::TemporalTileWriter traits.

§Geometry

§Longitude Latitude
§Predicates
  • crate::geometry::orient2d(): Highly accurate returns a negative value if the points a, b, and c occur in counterclockwise order (c lies to the left of the directed line defined by points a and b).
  • crate::geometry::orient2dfast(): Returns a positive value if the points a, b, and c occur in counterclockwise order (c lies to the left of the directed line defined by points a and b).
  • crate::geometry::incirclefast(): An in-circle test fast test, lacks the same accuracy as incircle
§S1
§S2
§WGS84 & Web Mercator
§External

§Parsers

§Image
§Readers
§WKT
§Writers
§XML

§Proj

§Space

§Planet Constants

Earth: crate::space::EARTH_RADIUS, crate::space::EARTH_RADIUS_EQUATORIAL, crate::space::EARTH_RADIUS_POLAR, crate::space::EARTH_CIRCUMFERENCE, crate::space::EARTH_LOWEST_ALTITUDE, crate::space::EARTH_HIGHEST_ALTITUDE

Jupiter: crate::space::JUPITER_RADIUS, crate::space::JUPITER_RADIUS_EQUATORIAL, crate::space::JUPITER_RADIUS_POLAR, crate::space::JUPITER_CIRCUMFERENCE

Mars: crate::space::MARS_RADIUS, crate::space::MARS_RADIUS_EQUATORIAL, crate::space::MARS_RADIUS_POLAR, crate::space::MARS_CIRCUMFERENCE, crate::space::MARS_LOWEST_ALTITUDE, crate::space::MARS_HIGHEST_ALTITUDE

Mercury: crate::space::MERCURY_RADIUS, crate::space::MERCURY_RADIUS_EQUATORIAL, crate::space::MERCURY_RADIUS_POLAR, crate::space::MERCURY_CIRCUMFERENCE, crate::space::MERCURY_LOWEST_ALTITUDE, crate::space::MERCURY_HIGHEST_ALTITUDE

Moon: crate::space::MOON_RADIUS, crate::space::MOON_RADIUS_EQUATORIAL, crate::space::MOON_RADIUS_POLAR, crate::space::MOON_CIRCUMFERENCE, crate::space::MOON_LOWEST_ALTITUDE, crate::space::MOON_HIGHEST_ALTITUDE

Neptune: crate::space::NEPTUNE_RADIUS, crate::space::NEPTUNE_RADIUS_EQUATORIAL, crate::space::NEPTUNE_RADIUS_POLAR, crate::space::NEPTUNE_CIRCUMFERENCE

Pluto: crate::space::PLUTO_RADIUS, crate::space::PLUTO_RADIUS_EQUATORIAL, crate::space::PLUTO_RADIUS_POLAR, crate::space::PLUTO_CIRCUMFERENCE, crate::space::PLUTO_LOWEST_ALTITUDE, crate::space::PLUTO_HIGHEST_ALTITUDE

Saturn: crate::space::SATURN_RADIUS, crate::space::SATURN_RADIUS_EQUATORIAL, crate::space::SATURN_RADIUS_POLAR, crate::space::SATURN_CIRCUMFERENCE

Venus: crate::space::VENUS_RADIUS, crate::space::VENUS_RADIUS_EQUATORIAL, crate::space::VENUS_RADIUS_POLAR, crate::space::VENUS_CIRCUMFERENCE, crate::space::VENUS_LOWEST_ALTITUDE, crate::space::VENUS_HIGHEST_ALTITUDE

§Data Structures

§Utilities

Modules§

data_store
Data Storage Tools
data_structures
Data structures
geometry
Geometry Tools
parsers
GIS Core Tools
proj
Projection Tools
readers
GIS Readers
space
Space Tools
tools
Generic Geospatial Tools
util
Utility Tools
writers
GIS Writers