JTS offer more powerful spatial operations. For instance it is pretty easy to check wheter a point lies within a polygon because the Geometry class provides the contains() method for this.
In this example, we're using this to visualize the density of restaurants for the boroughs of Berlin. First, we will load the geometries of all boroughs into memory and assemble their polygonal boundary. Then we will download all restaurant nodes in the area covered by the boroughs from Overpass and calculate the number of restaurants in each borough. After that we will determine a nice color depending on the density and print the results in GeoJSON.
See the results online, here's a preview:
Here's the code: