that one true unified global data repository.
There are multiple parts to this.
Client library - pandas/numpy like which lets you create, distribute, gather and compute on spatial data.
Server - a Flask REST API that lets you save data, pull down other data and even do remote computation
A web app - Github like where you can manage data sets via the UI and browse other contributors data
git clone https://github.com/fhk/globeloc
cd globeloc
# insert your flavour of virtual env here
conda create -n globeloc python=3.7
conda activate globeloc
pip install -r requirements.txt
The client library extends scipy sparse arrays and gives you a way to insert spatial data into them.
These can then be saved, loaded, shared and computed on.
In the simplest case you can parse any file which can be read with geopandas (fiona).
For example:
from globeloc.globeloc import GlobeLoc as glc
gdf = glc()
gdf.connect(url="http://127.0.0.1:8080")
#gdf.connect(url="local")
my_unique_data = gdf.parse("./gis_osm_pois_free_1.shp", column="fclass", sub_category="hotel")
response = gdf.save(my_unique_data)
gdf.load("10f2481e-9fce-11ea-89d1-3b195c02ff70")
gdf['hotel'][:] + gdf['park'][:]
The server is a Flask server which is codegened from the swagger.json file.
However, the code gen is only run to add new end points and the other controller must be preserved.
The server lives in the "./api" folder.
To start the server run
cd api
python -m swagger_server
You can now access the end points on local host port 8080
/save
/load
However, these are not used directly. Rather the transaction is handled by the client library with the methods of the same name.
There are two notebooks.
./notebooks
globeloc_core.ipynb (1)
test_lib.ipynb (2)