Skip to content

Instantly share code, notes, and snippets.

@maptastik
Last active June 5, 2019 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maptastik/9562cf3d7c24fa21654fd721083c303e to your computer and use it in GitHub Desktop.
Save maptastik/9562cf3d7c24fa21654fd721083c303e to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Entwine"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use Anaconda to create a new Python environment that contains entwine\n",
"\n",
"```bash\n",
"conda create -n entwine -c conda-forge entwine\n",
"```\n",
"\n",
"Activate the `entwine` environment\n",
"\n",
"```bash\n",
"activate entwine\n",
"```\n",
"\n",
"Then install any other packages you might want for working with your data. We will definitely need nodejs and http-server installed ot view the results in the browser.\n",
"\n",
"```bash\n",
"conda install nodejs -y\n",
"npm install http-server -g\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Get some data from NOAA using their [Data Access Viewer tool](https://coast.noaa.gov/dataviewer). Although they have the same LiDAR data made available through NC's spatial data downloader, NOAA's has a much quicker turnaround time.\n",
"![](https://i.imgur.com/dEPhM3C.png)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Building data into an Entwine Point Tile\n",
"\n",
"The key functionality that entwine provides is tiling of a point cloud so those million or billions of points can efficiently be drawn in the browser. We'll create a directory to hold our EPTs and then build an EPT from the PNC/Carter-Finley point cloud.\n",
"\n",
"```bash\n",
"mkdir ept\n",
"entwine build -i ASSETS/DATA/PNC_CF_nc2015_phaseIII.laz -o ept/pnc_cf\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## View the point cloud in the browser\n",
"\n",
"Using th the `http-server` module we installed on top of nodejs, we can serve the `ept` directory and make any EPTs available for viewing in Potree or Plasio.\n",
"\n",
"```bash\n",
"http-server ept -p 8080 --cors\n",
"```\n",
"- **Potree:** http://potree.entwine.io/data/view.html?r=http://localhost:8080/pnc_cf\n",
"\n",
"![](https://i.imgur.com/H699bsg.png)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Color the point cloud using ortho imagery and PDAL\n",
"\n",
"### Get imagery\n",
"\n",
"```bash\n",
"curl \"https://maps.raleighnc.gov/images/rest/services/Orthos2015/ImageServer/exportImage?bbox=-78.728199%2C35.795156%2C-78.705239%2C35.809774&bboxSR=4326&size=2000%2C2000&imageSR=2264&format=tiff&pixelType=U8&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_BilinearInterpolation&f=image\" -o ASSETS/DATA/pnc_cf_ortho_2015.tif\n",
"```\n",
"\n",
"#### Pipeline (pnc_cf_color.json)\n",
"```json\n",
"{\n",
" \"pipeline\": [\n",
" {\n",
" \"type\": \"readers.ept\",\n",
" \"filename\": \"ept://ept/pnc_cf\"\n",
" },\n",
" {\n",
" \"type\": \"filters.colorization\",\n",
" \"raster\": \"ASSETS/DATA/pnc_cf_ortho_2015.tif\"\n",
" },\n",
" {\n",
" \"type\": \"writers.las\",\n",
" \"compression\": \"true\",\n",
" \"minor_version\": \"2\",\n",
" \"dataformat_id\": \"3\",\n",
" \"filename\":\"ASSETS/DATA/pnc_cf_color.laz\"\n",
" }\n",
" ]\n",
"}\n",
"```\n",
"\n",
"#### PDAL Command\n",
"\n",
"```bash\n",
"pdal pipeline C:\\Users\\cooperr\\Documents\\Presentations\\foss4gna2019_redux\\lidar\\entwine\\PIPELINES\\pnc_cf_color.json\n",
"```\n",
"\n",
"#### Built an ETC\n",
"\n",
"```bash\n",
"entwine build -i ASSETS/DATA/pnc_cf_color.laz -o ept/pnc_cf_color\n",
"```\n",
"\n",
"- **Potree:** http://potree.entwine.io/data/view.html?r=http://localhost:8080/pnc_cf_color\n",
"\n",
"![](https://i.imgur.com/0uCf2V7.png)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment