项目作者: brewin

项目描述 :
A tool to generate filled contours from rasters.
高级语言: Kotlin
项目地址: git://github.com/brewin/gdal_contourf.git
创建时间: 2019-08-25T00:37:26Z
项目社区:https://github.com/brewin/gdal_contourf

开源协议:Other

下载


gdal_contourf

Generates filled contours (polygons) from raster data. It runs on the
JVM and is optimized for speed. A large raster can typically be processed in a
matter of seconds. It uses GDAL to read raster files and
write vector files. Contours are generated using the
Marching Squares algorithm.

Note that as of GDAL v2.4.0,
gdal_contour can produce
polygons using the -p option, but it is very slow.

Requirements

  • Java
  • GDAL
  • GDAL Java bindings (libgdal-java on Debian/Ubuntu, gdal-java on Fedora/Centos)

Building

Make sure the GDAL version in build.gradle.kts matches the system version. (ie. 3.0.0)

  1. ./gradlew shadowJar

Usage

It can be used as a library with Gradle:

  1. repositories {
  2. jcenter()
  3. maven("https://jitpack.io")
  4. }
  5. dependencies {
  6. implementation("com.github.brewin:gdal_contourf:1.1.2")
  7. }

Or run from the command line:

  1. java -jar gdal_contourf-1.1.2_gdal-3.0.0.jar --in input.tif --band 1 \
  2. --levels -50 0 50 100 150 --simplification 30 --epsg 4326 \
  3. --format GeoJSON --out output.geojson

Disclaimer

This is not well-tested and probably never will be. It works for my use-case.
Correctness not guaranteed.