hypergeojson v0.0.0
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:
- HyperGeoJson requires a recent node.js version and lowest version tested so far is v14.19.0.
- This package is released as ESM, which may require configuration in your project
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
3 years ago