Create vector datasets from raster surfaces
Project description
A few basic surface creation routines using (primarily) rasterio, fiona, and shapely
Installation
Install dependencies:
rasterio
fiona
shapely
scipy
Clone this repo:
git clone git@github.com:mapbox/make-surface.git
CD into
make-surface
then pip install -e .
Alternatively, install straight from GitHub:
pip install -e git+git@github.com:mapbox/make-surface.git#egg=makesurface
Usage
Takes an input raster, and converts into a stacked shapefile. Sort of like gdal polygonize
with more control. Also prints out a cartocss template for stylizing (one style for each class).
Turns this:
Into this:
makesurface <input raster> <output shapefile> [OPTIONS]
Arguments
<input raster>
Input single-band raster to class and vectorize<output shapefile>
Output shapefile to create - output will be “stacked”, with lower values including areas of higher values
Options
--classfile <TEXT>
- Filepath to one-line CSV of manually defined break values;--classes <INTEGER>
(default = 10) - Number of sections to vectorize into, OR ‘all’ to vectorize into rounded input values; Ignored if classfile specified;--weight <FLOAT>
(default = 1) - parameter to weight classification type; 0 = quantile breaks, 1 = equal interval, anywhere between 0 and 1 weights the classification between the two; Ignored if classfile specified;--smoothing <FLOAT>
(default = no smoothing) - optional parameter that defines the upsampling and smoothing prior to classification; If none, no upsampling / smoothing is performed;--nodata <ANY NUMBER OR "min">
(default = nodata from metadata) - Manually defined nodata value - can be any number or “min”;--carto
(default = none) - Flag to include stdout printing of cartoCSS for each class;--grib2
(default = none) - Flag to handle.grib2
files with bounds of 0 to 360;--help
Show this message and exit;
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file makesurface-0.0.1dev.tar.gz
.
File metadata
- Download URL: makesurface-0.0.1dev.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7ef74f9bc31788dd7a2aa0c9597ddcee09cb0d0f2eda475ab2b54b9225a417a |
|
MD5 | 23aa4b5f8a671e5e5570773701ec0b6d |
|
BLAKE2b-256 | 1947135ab1bfa723d1dd361eed7771fbd1ad6709fbc17d0f22a2cc6af8ac89b9 |