overpasser
Fluid Java interface to OpenStreetMap data through querying the Overpass API. No more query string forging by hand!
Example code
An Overpass query like this:
["out":"json"]["timeout":"30"];
(
node
["amenity"="parking"]
["access"!="private"]
(47.48047027491862,19.039797484874725,47.51331674014172,19.07404761761427);
<;
);
out body center qt 100;
...can be expressed like:
String query = new OverpassQuery()
.format(JSON)
.timeout(30)
.mapQuery()
.nodes()
.amenity("parking")
.notEquals("access", "private")
.boundingBox(
47.48047027491862, 19.039797484874725,
47.51331674014172, 19.07404761761427
)
.end()
.output(OutputVerbosity.BODY, OutputModificator.CENTER, OutputOrder.QT, 100)
.build()
;
...or you can just use .output(100)
at the end to use the defaults.
Language support
- Settings
- output format - currently JSON only
- timeout
- output parameters - verbosity, modificators, sort order
- Filters
- standalone filter
- exact filter matching by value (and negation)
- regex filter matching by value (and negation)
- multiple values
- Map queries
- selecting nodes
- setting bounding box
Modules
- library - Core functionality in a standalone module: only Java dependencies
- library-retrofit-adapter - Retrofit adapter towards the overpass-api server
- sample - An Android sample using both of the above