In this post, I would like to let you know about an excellent piece of software, Java Topology Suite (
JTSis an open source library of spatial predicates and functions for processing geometries. It provides a complete, consistent, and robust implementation of fundamental algorithms for processing linear geometry on the 2-dimensional Cartesian plane.
A funny thing about it is that
is used by most java based Open Source geospatial applications, and GEOS, which is a C++ port of JTS, is used by most C based applications.
So, all the downstream projects using
GEOS such as various Python wrappers around
GEOS such as
shapely and even the
PostGIS, all of them really work against the
JTS using the GEOS as the interface for communication. So the
JTS is a very, very powerful Java library.
If you are not a Java developer, though, this might be of little interest to you. However, there is another little application, called
JTS TestBuilder, which provides a GUI for geometry exploration and is an interface into the
JTS API. It is not so famous as other pieces of open source GIS stack, such as
GRASS, though. Also its documentation is outdated and scarce, so you would need to find out how to use the application on your own.
Nevertheless, it is an indispensable tool for anyone who spends a fair amount of time working with computational geometry or spatial data processing applications. It would also serve as a great visualization tool for GIS instructors who need to visually explain how GIS algorithms operate. I have used it to show how Convex Hull is created from a set of points, for instance. One obvious advantage of
JTS TestBuilder is that you do not need to run any heavy GIS applications and the “geometry modification – running analysis – seeing the result” cycle is really short.
Here I’ve loaded cities of California along with the state boundary and created a convex hull for the boundary geometry.
Having said that, you can work in the following manner:
- Use your favorite GIS database management tool to get
WKTof a geometry you would like to inspect or analyze.
- Use the
JTS TestBuilderto draw the features.
JTSGeometry Functions constructing new geometries or answering spatial questions.
- Load the results of the analysis back into your GIS (either for ad hoc exploration or for storage).
The code to read the features into
WKT and write back from
JTS TestBuilder can also help you to learn something new with regard to GIS theory. If you think that you are a well seasoned GIS professional who can amaze others by mentioning a few cool names like Voronoi or Thiessen, I encourage you to explore the geometry functions
JTS TestBuilder provides. I am pretty sure just a few of you have heard of:
- Koch snowflake which are used a lot in space-filling as well as cartographic simplifaction algorithms.
- Seirpinski carpet which is not used extensively in GIS yet, but there are some emerging applications regarding urban pattern analysis.
Another very similar application that is particularly popular among math teachers is
GeoGebra. I have been using it for a while, too, but it lacks export of result geometries into
WKT which can be put into a geospatial database or drawn directly in a desktop GIS application such as
QGIS. You can try
GeoGebra online or by installing a desktop application. It is also available as an app for iOS, Android, and Windows Phone.