Being able to convert OpenStreetMap elements to JTS geometries allows us to perform a lot of interesting geometric operations on them.
For example, here is the the borough 'Mitte' of Berlin:
It can be built using the following code. The output is available here.
As a subclass of Geometry, the MultiPolygon implements the buffer() operation that produces an enlarged version of the polygon. As argument the operation accepts a distance that specifies how much larger the result will be.
The above example used a positive distance for the buffer() operation. It is however also possible to supply negative values, producing a polygon that is smaller than the input.
The Geometry class offers more operations, most notably the set operations: intersection, union, difference and symmetric difference. For example we can subtract the original polygon from its buffer using the difference operation: