Skip to content

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

License

Notifications You must be signed in to change notification settings

Open-S2/gis-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gis-tools

GitHub Actions Workflow Status npm crate downloads docs-ts docs-rust code-coverage Discord

About

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

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 need to be transformed one more time to use them.

So this tool exists to make GIS tools simple to use, various data fast to parse, and transformed to usable projections without having to worry about the details.

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

Install

# NPM
npm install gis-tools-ts
# PNPM
pnpm add gis-tools-ts
# Yarn
yarn add gis-tools-ts
# Bun
bun add gis-tools-ts
# Deno
deno install gis-tools-ts

# Cargo
cargo add gis-tools

Components

đź’ˇ NOTE: The sizes are estimates and can change based on how you use them. Click the module link for documentation and more precise guides on file cost.

Converters

Main Modules Size Description
toJSON To JSON Badge Convert any Reader to JSON data.
toTiles FT Badge Convert any Reader to vector and/or raster tiles.

Data Stores

Main Modules Size Description
externalSort ES Badge Sort large files with uint64 keys
kd KD Badge KD Spatial index that works in the browser and the filesystem.
kv KV Badge Key-Value store that works in the browser and the filesystem.
multiMap MM Badge Multi-map that works in the browser and the filesystem.
vector Vec Badge Vector store that works in the browser and the filesystem.

Data Structures

Main Modules Size Description
cache Cache Badge A KV cache for values with a max size. Least used dropped first.
pointGrid PG Badge Point grid tiling for number or raster data.
pointCluster PC Badge Point cluster tool with indexing.
pointIndex PI Badge Point indexing with range/radius queries.
pointIndexFast PIF Badge Faster point indexing with range/radius queries.
priorityQueue PQ Badge A priority queue.
tile Tile Badge A tile/layer management tool for features.

Geometry

Main Modules Size Description
angles Angle Badge Spherical geodetic angle methods.
bbox BBOX Badge Bounding box creation/manipulation.
id ID Badge ID tools for S2 and WM.
lonlat LonLat Badge Longitude/Latitude convienience methods.
planets Planet Badge Collection of planet constants with observation tools.
predicates Pred Badge Reliability predicates for 2D and 3D orientation geometry.
s2 S2 Badge S2 geometry convienience methods.
tools Tools Badge Geometry manipulation tools.
wm WM Badge Web Mercator (WM) geometry convienience methods.

PROJ4

Main Modules Size Description
datums Datums Badge A collection of datums for easy access.
mgrs MGRS Badge Military Grid Reference System (MGRS) converter.
projections Proj Badge Supports a large list of projections to be used by transformers.
transformers Trans Badge Tool for transforming coordinates from one projection to another.

Readers

Main Modules Size Description
jpeg JPEG Badge Read/parse JPEG data.
jpeg2000 JPEG2 Badge Read/parse JPEG 2000 data.
lanczos Lanc Badge Apply a Lanczos filter that downsamples an image.
csv CSV Badge CSV data reader with options on parsing.
gbfs GBFS Badge General Bikeshare Feed Specification reader.
geotiff GTiff Badge Geotiff image reader with projection support.
grib2 grib2 Badge GRIB 2 data reader.
json JSON Badge JSON data reader with line delimiter support.
nadgrid NGrid Badge NAD Grid data reader.
netcdf NetCDF Badge NetCDF data reader.
osm OSM Badge OpenStreetMap PBF data reader
pmtiles PMT Badge (S2)PMTiles data reader.
protobuf Proto Badge Protobuf data reader/writer.
shapefile Shape Badge Shapefile data reader supporting DBF and projections (PRJ).
tileReader TR Badge Tile data reader, usually from a local input folder.
wkt wkt Badge Well Known Text data reader.
xml XML Badge XML data reader.

Space

Main Modules Size Description
satellite SAT Badge Satellite Orbit Class from TLE data

Tools

Main Modules Size Description
delaunator DEL Badge Delaunay triangulation of 2D points.
interpolators INT Badge Interpolate values from points and weights.
orthodrome ORT Badge Find shortest path between two points or point on path.
polylabel POL Badge Find the labels for vector polygons

Writers

Main Modules Size Description
pmtilesWriter PMTW Badge Write (S2)PMTiles data.
tileWriter TW Badge Write (S2)Tiles data. Supports time series as well.

Utils

Main Modules Size Description
polyfills PF Badge Collection of polyfills that might add value for the browser.
gzip GZ Badge gzip compression/decompression convenience methods.
lzw LZW Badge lzw decompression methods.

Development

Requirements

You need the tool tarpaulin to generate the coverage report. Install it using the following command:

cargo install cargo-tarpaulin

The bacon coverage tool is used to generate the coverage report. To utilize the pycobertura package for a prettier coverage report, install it using the following command:

pip install pycobertura

Running Tests

To run the tests, use the following command:

# TYPESCRIPT
## basic test
bun run test
## live testing
bun run test:dev

# RUST
## basic test
cargo test
# live testing
bacon test

Generating Coverage Report

To generate the coverage report, use the following command:

cargo tarpaulin
# faster
cargo tarpaulin --color always --skip-clean
# bacon
bacon coverage # or type `l` inside the tool

Using Tokei

cargo install tokei

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages