Writing Geospatial scripts with Java and jbang
Usually writing a Java application requires using Maven or Gradle. While both are great tools for large projects, they are too complicated for small scripts. jbang is a new tool that lets you create scripts or simple applications with Java. I will create a geospatial command line tool using jbang and the Java Topology Suite (JTS).
GEOC: A command line interface for GeoTools
Using GEOS and C++ with Conan and CMAKE
One of the best ways to get started using the GEOS library with C++ is to use Conan and CMAKE.
GEOS is the Geometry Engine, Open Source library written in C and C++. Is is a port of the Java Topology Suite (JTS). Both libraries include spatial predicate functions and spatials operators. GEOS is used extensively in the PostGIS extension for Postgres. Conan is a C/C++ package manager. It allows you to declare what libraries your code depends on. Finally, CMake is one of the most popular ways to build C++ applications.
Buffering Features with Groovy
In my last post, I calculated centroids from one shapefile and saved them to another using a GeoScript Groovy script. This time I buffer these centroids and save them to a polygon shapefile. Since GeoScript is based on the Java Topology Suite library you can take advantage of any of its geometry operations - intersection, union and difference.
Calculating Centroids with GeoScript Groovy
GeoScript uses the GeoTools and Java Topology Suite libraries to provide easy-to-use scripting APIs with implementations in Python, JavaScript, Scala and Groovy. The GeoScript web site provides simple code snippets in all four languages to help you get started. In this post, I address a real world example: calculating centroids from one GIS layer and saving them to another layer using Groovy. This example highlights the GeoScript Layer, Feature, and Geometry modules.
Calculating Convex Hull and Minimum Bounding Circle with Groovy
The Java Topology Suite, which Groovy GeoScript wraps, contains spatial operators that act on a group of Features or Geometries. In this post, I collect all geometries from a shapefile to calculate the convex hull and minimum bounding circle. This post builds on previous blog entries where I use GeoScript to extract centroids and buffer Features.