0.2.3 • Published 3 years ago
jsgeoda v0.2.3
jsgeoda
jsgeoda is the first javascript library for spatial data analysis with functionalities of choropleth mapping, spatial weights, local indicators of spatial association, spatial clustering, and cluster analysis. With a few lines of code, you can run spatial data analysis in a web browser or in Node.js:
import jsgeoda from 'jsgeoda';
const geoda = await jsgeoda.New();
// get geojson
const response = await fetch("./natregimes.geojson");
const ab = response.arrayBuffer();
// read geojson in jsgeoda
const nat = geoda.readGeoJSON(ab);
// create Queen contiguity weights
const w = geoda.getQueenWeights(nat);
// get values of variable "HR60"
const hr60 = geoda.getcol("HR60");
// apply local Moran statistics on variable "HR60"
const lm = geoda.localMoran(w, hr60);
Installation
$ npm i --save jsgeoda
Documentation
Hands-On Tutorials:
- Hello jsgeoda!
https://codesandbox.io/s/1-hello-jsgeoda-foq4j
- Load spatial data
https://codesandbox.io/s/2-load-spatial-data-dgcux
- Choropleth Mapping
https://codesandbox.io/s/3basicmapping-lcguj
- Spatial Weights
https://codesandbox.io/s/4spatial-weights-owi84
- Univariate LISA
https://codesandbox.io/s/5lisaunivariate-zhhop
- Multivariate LISA
https://codesandbox.io/s/6lisamultivariate-4w3hk
- Spatial Clustering
https://codesandbox.io/s/7spatialclustering-uvz12
Authors
Xun Li, Luc Anselin