跳转到主要内容

从栅格表面创建矢量数据集

项目描述

Python中的栅格到矢量表面创建工具

安装

从GitHub

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

从PyPI

pip install makesurface --pre

手册

  1. 安装依赖项

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

  1. 克隆此仓库

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

  1. cd进入 :console:make-surface 然后 pip install -e .

用法 - 向量化

makesurface vectorize [OPTIONS] INFILE

接受一个输入栅格,并将其转换为叠加的shapefile。类似于< span class="docutils literal">gdal polygonize,但具有更多控制,针对矢量瓦片进行了优化。还可以打印出用于风格的CartoCSS模板(每个类一个样式)。

image

图像

选项

--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.

用法 - 三角化

makesurface triangulate [OPTIONS] ZOOM

创建一个空的三角形网格:image0

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.

用法 - 填充面片

makesurface fillfacets [OPTIONS] SAMPLERASTER [INFILE]

使用类似GeoJSON的三角形几何形状来获取该几何形状的平均区域栅格值

image

图像

选项

--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.

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

makesurface-0.2.14dev.tar.gz (9.1 kB 查看哈希值)

上传时间 源代码

支持者