Harry Winser

GeoTools - a simple geospatial tool

Geospatial tech is a deep, rich, and complex sector of the tech industry. I work for a small startup, Edozo, which handles Commercial Property Data and Mapping. What this essentially means is that for the past 5 years I’ve been working within the GeoSpatial sphere, using things like PostGIS and GeoServer to deliver products.

I’ve learned a whole lot on this journey (and will probably be the subject of a number of blog posts in the future) but today I want to share a little side project I’ve been working on: geo.harrywinser.com.

A screenshot of the early build of geotools

The problem

On a day to day basis, I tend to work with a lot of different geometries; user inputted, or derived from user interaction. I also need to generate geometric test data, such as for unit tests or testing API endpoints.

With that in mind, I soon discovered a bit of an issue with the tools I was using, and I couldn’t find anything quite what I was looking for.

For example to convert a GeoJSON Feature to a different SRID I’d do:

  1. Extract the Geometry from it
  2. Read it in Postgres using ST_GeomFromGeoJSON
  3. Set the SRID
  4. Convert to a new SRID using ST_TRANSFORM
  5. Convert back to GeoJSON

As you can see, this is quite a long and involved process. If the shape is large, DBeaver can start to crash. And if it’s a FeatureCollection, well then that’s extra hard.

With all this in mind, I thought “There has to be an easier way to do what I need doing!”.

So I went hunting on the net.

One of my first finds was geojson.io. It’s a good looking site, and very focused on creating and editing GeoJSON. However, I found the tools tricky and unintuitive (to me), and it cannot transform the shapes between different SRID’s * .

There is also QGIS which is a fantastic Desktop application for doing all sorts of GeoSpatial data manipulation. It can easily do what I need. However it’s not lightweight, has a many GB install, and uses a lot of RAM while in use. Not great if you just need to draw a shape and copy out some GeoJSON.

A Solution

So, I thought about it, and made a list of what I needed to get the job done:

  1. Create/Edit shapes
  2. Insert Shapes
  3. Copy them as WKT’s or GeoJSON
  4. Create GeoJSON Feature Collections
  5. Transform shapes between different SRID’s
  6. Fast and Lightweight
  7. Make it at least mildly workable on Mobile (though, this is not the primary focus)

With the above in mind, I’ve started to build geo.harrywinser.com! As of time of writing, it’s still very much in progress. Half the features aren’t there yet, but i thought I’d share the work in progress, as it might already be useful to some folks.

Let me know if there are any additional features you’d like to see, or any bugs that are… ahem… bugging you!

*The standard SRID for GeoJSON is 4326, as per the standard. However, You can specify your own SRID as part of a Feature or FeatureCollection, which is where geojson.io falls down for me.