0.0.0 • Published 3 years ago

hypergeojson v0.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

HyperGeoJSON

Share GeoJSON using Hypercore, using simple geospatial indexing with quadkeys via @mapbox/tilebelt

⚠️ Warning!

This is a prototype so will have breaking changes, unimplemented methods/functions, etc.

Install and use at your own risk of wasted time!

👋 Welcome!

If you're interested in collaborating on this geospatial hypercore project, feel free to clone this repo & jump into the issues queue.

Install

Prerequisites:

Install with npm:

npm i hypergeojson

Usage

// Import the HyperGeoJson class
import { HyperGeoJson } from 'hypergeojson'

// Create an instance of the class
const geo = new HyperGeoJson()

// Put a feature in the database
await geo.put({
  "type": "Feature",
  "id": "1",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [
      -77.0361328125,
      -11.996338401936226
    ]
  }
})

// Get a feature by its id
const point = await geo.get('1')

// Query points with a quadkey (this is an extremely high-level quadkey)
const stream = geo.quadkeyQuery('2')

stream.on('data', (data) => {
  console.log(data)
})

Contributing

Contributions are welcome! Please read the contributing guidelines first.

Conduct

It's important that this project contributes to a friendly, safe, and welcoming environment for all. Read this project's code of conduct

Changelog

Read about the changes to this project in CHANGELOG.md. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Contact

License

ISC