So you made an Entwine point tile index and want to deliver it offline as a quick demonstration? Impress your friends, enemies and frenemies like this. You need:
- a non-safari web browser
I’m using a MacOS 10.7 machine, and therefore assume you are also. The same set of instructions should work for any bash shell, if you’re using Windows… sorry. You’ll need to translate…
The feature image in this post was generated from a local copy of the City of Melbourne’s public point cloud using this method (you can explore it live in your browser as EPT here ).
Let’s get started. Open a terminal window and:
git pull email@example.com:connormanning/potree.entwine.io.git
Now, turn off the internet. The rest is completely offline. Do:
cd potree.entwine.io python3 -m http.server 8000
…then navigate to http://localhost:8000 in a web browser that is not Safari to see the default potree/entwine demo page. Leave this running.
Next, you need your ept dataset, and it needs to be delivered via http. Buuuut, our browser will see this as an XHR request so
http.server by default will not deliver the good stuff.
Stack overflow comes to the rescue right here: https://stackoverflow.com/questions/21956683/enable-access-control-on-simple-http-server
So we make a python script from answer 4, call it
simplecorsserver.py and put it somewhere convenient. Let’s say
/Volumes/drive for this example.
Open a fresh terminal window and go find your ept dataset. Say the dataset is in
cd /Volumes/drive/ept-datasets python3 -m /Volumes/drive/simplecorsserver -p 9000
Now, head to your web browser. In the address bar, make a URL like:
(make sure those quotes are straight not curly!)
…and you should see your EPT dataset popping in.
If you have more than one to investigate, put them someplace like
/Volumes/drive/ept-datasets/my-other-dataset and change the URL to:
Good luck, and happy offline point cloud rendering!
Once you’re done, cancel your python webservers and take the rest of the day off to go climbing. Win!
The sales pitch
Spatialised is a fully independent, full time consulting business. The tutorials and write-ups here are free for you to use, without ads or tracking.
If you find the content here useful to your business or research, you can support production of more words and open source geo-recipes via Paypal or Patreon; or hire me to do stuff. Enjoy!