Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Create vector datasets from raster surfaces

Project Description

Raster –> vector surface creation tools in python

Installation

From GitHub:

pip install -e git+git@github.com:mapbox/make-surface.git#egg=makesurface

From PyPI

pip install makesurface --pre

Manual

  1. Install dependencies:

‘click>=3.0’, ‘fiona’, ‘numpy’, ‘rasterio’, ‘shapely’, ‘scipy’, ‘mercantile’, ‘pyproj’

  1. Clone this repo:

:console:git clone git@github.com:mapbox/make-surface.git

  1. cd into :console:make-surface then pip install -e .

Usage - Vectorize

makesurface vectorize [OPTIONS] INFILE

Takes an input raster, and converts into a stacked shapefile. Sort of like gdal polygonize with more control, optimized for vector tiles. Also can print out a CartoCSS template for stylizing (one style for each class).

image

Options:

--outfile TEXT           Write to GeoJSON
-b, --bidx INTEGER       Input band to vectorize. [default = 1]
-cl, --classes TEXT      Number of output classes, OR "all" for rounded
                         input values (ignored if class file specified)
                         [default = 10]
-cf, --classfile TEXT    One-line CSV of break values [default = None]
-w, --weight FLOAT       Weighting between equal interval and quantile
                         breaks [default = 1 / equal interval]
-s, --smoothing INTEGER  Value by which to zoom and smooth the data [default
                         = None]
-n, --nodata TEXT        Manually defined nodata value - can be any number
                         or "min" [default = None]
-ov, --outvar TEXT       Name of output variable [Default = value]
-set, --setnodata FLOAT  Value to set nodata to (eg, if nodata / masked, set
                         pixel to this value) [default = None]
-c, --carto
-ni, --nibble            Expand mask by 1 pixel
--axonometrize FLOAT     EXPERIMENTAL
-ns, --nosimple
--help                   Show this message and exit.

Usage - Triangulate

makesurface triangulate [OPTIONS] ZOOM

Creates an empty triangular lattice:

Options:
  --bounds FLOAT...  Bounding Box ("w s e n") to create lattice in
  --tile INTEGER...  Tile ("x y z") to create lattice in
  --output TEXT      File to write to (.geojson)
  --tableid TEXT     static id for databases
  --help             Show this message and exit.

Usage - fillfacets

makesurface fillfacets [OPTIONS] SAMPLERASTER [INFILE]

Use GeoJSON-like triangle geometry to get average regional raster value for that geometry

image

Options:

--output TEXT           Write output to .json [default - print to stdout]
-b, --bidxs TEXT...     Band to sample [default=1]
--zooming INTEGER       Manual upsampling of raster for sampling [Default =
                        upsampling by estimated polygon density]
-np, --noproject        Do not project data
-ogjs, --outputgeojson  Output updated GeoJSON
-bp, --batchprint TEXT
-cl, --color
--help                  Show this message and exit.
Release History

Release History

This version
History Node

0.2.14dev

History Node

0.2.13dev

History Node

0.2.12dev

History Node

0.2.11dev

History Node

0.2.10dev

History Node

0.2.9dev

History Node

0.2.8dev

History Node

0.2.7dev

History Node

0.2.6dev

History Node

0.2.5dev

History Node

0.2.4dev

History Node

0.2.3dev

History Node

0.2.2dev

History Node

0.2.1dev

History Node

0.2.0dev

History Node

0.1.2dev

History Node

0.1.1dev

History Node

0.1.0dev

History Node

0.0.8dev

History Node

0.0.7dev

History Node

0.0.6dev

History Node

0.0.5dev

History Node

0.0.4dev

History Node

0.0.3dev

History Node

0.0.2dev

History Node

0.0.1dev

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
makesurface-0.2.14dev.tar.gz (9.1 kB) Copy SHA256 Checksum SHA256 Source Feb 27, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting