-
Notifications
You must be signed in to change notification settings - Fork 9
Home
Mazi Boustani edited this page May 6, 2016
·
21 revisions
Khooshe is for visualizing Big Data Points (GeoSpatial points data (latitude and longitudes)). It is defined to be independent of how small or big the data is.
Install Khooshe if only going to use run_khooshe
function inside your own program, otherwise no need to install it and follow next section ("How it works")
pip install Khooshe
- gets all point data (latitude and longitude)
- finds some cluster from all points
- finds center of each cluster (centroid)
- store all centroid as one layer
- classifies points belongs to each centroid
- repeat steps 2 to 5 till there are no more centroid available
- stores actual points data as a layer
- Install gfortran and libatlas-base-dev. For mac users libatlas-base-dev is not required as it must be there already. You can install gcc through brew to get fortran compiler -
brew install gcc --without-multilib
- Install scipy -
pip install scipy
- Install numpy -
pip install numpy
- Make sure you installed requirements
- Check in code by "git clone https://github.com/MBoustani/Khooshe.git"
- Copy Sample Points to the Khooshe folder
- Run the Khooshe.py
- After processed finished successfully, copy the 'tiles' folder to 'Visualizer/static' folder
- Open the 'Visualizer/khoose_visualizer.html' with webserver (e.g. https://pypi.python.org/pypi/pyserve)
- Another version offers khooshe integrated with Openlayers 3. Open 'Visualizer/khooshe_openlayers.html' using same server
##Note: If you are using your data points, the format should be CSV file with Latitude in first column, Longitude in second column and popup content in 3rd column, see example Sample Points
You can integrate khooshe on your openlayer 3 app using below code
// Initialize khooshe with instance of OL map
khooshe.init(map)
// Initialize Khooshe default layer
khooshe.initKhoosheLayer()
// Initialize a Khooshe layer on a different base tile folder
khooshe.initKhoosheLayer('static/tiles_sample/','yellow')
- Use
khooshe.DEBUG = true
for console logs - khooshe-ol supports openlayer popups. By default they are not displayed but you can turn the feature on by
khooshe.init(map, true)
- khooshe-ol also allows custom popups. khooshe-ol adds new field
popup_content
while populatingol.Feature
. You can disable default popups and add your own event. See sample code at https://github.com/MBoustani/Khooshe/blob/master/Visualizer/static/js/khooshe-ol.js#L19