Olga,
Interesting timing... WikiBrain's spatial features are under heavy development at the moment.
Right now we essentially provide mappings from Wikipedia articles to points (for all spatial articles), and polygons (for states and countries). We also have some basic utilities for a variety of "distance metrics:" geodetic distance, number of countries, states away, a topology-based distance metric.
All these features are (like WikiBrain) implemented in Java and we have ties in and out of GeoTools and JTS. I think JTS provides most of the features you are asking for.
All of this is under active development at the moment. I'm happy to answer more specific questions. I'm not an expert in these GIS features, but I'm doing my best to come up to speed quickly!
-Shilad