Skip to content

Instantly share code, notes, and snippets.

@rossbernet
Created March 1, 2017 22:59
Show Gist options
  • Save rossbernet/ddfcdae31a15616c01e1a3a5a848abd2 to your computer and use it in GitHub Desktop.
Save rossbernet/ddfcdae31a15616c01e1a3a5a848abd2 to your computer and use it in GitHub Desktop.
Vector dataset -> euclidean distance
Method: use GDAL.
Was able to make it work in QGIS. But the rasterize step did not work in the command line. Proximity did.
$ gdal_rasterize -a Shape_Leng -ts 3000 3000 -l philly_street_lines /Users/rbernet/Desktop/philly_street_lines.shp /Users/rbernet/Desktop/raster_testing/test_rasterize.tif
$ gdal_proximity.py /Users/rbernet/Desktop/raster_testing/philly_lines_3.tif /Users/rbernet/Desktop/raster_testing/phil_prox_test2.tif -distunits GEO -of GTiff
Goal: Create a web-based weighted raster overlay using open source tools.
- In the easiest way possible. For a small dataset. In Python
Why:
1. To learn how this type of analysis might be performed now.
2. Practice Python and open source tools
3. Understand limitations when datasets get to be too large
Approach.
Step 1. Create a python script that starts with vector data (.shp or geojson) and calculates euclidean distance.
Step 2. After can do this for 1 file. Do it for 3. With same extents.
3: Create static weighted raster overlay. AKA - add them together to create a "prioritization map"
4: Get this on the web....
@rossbernet
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment