overpasser icon indicating copy to clipboard operation
overpasser copied to clipboard

Implement polygon filter

Open zsoltk opened this issue 9 years ago • 0 comments

Documentation: Overpass_QL#By_polygon

Implementation guidelines:

  • create class OverpassPolygonFilter extends AbstractOverpassSubQuery
  • add method public OverpassPolygonFilter polygon() to OverpassFilterQuery (by the same logic as OverpassFilterQuery is embedded in OverpassQuery.filterQuery()
  • add method public OverpassPolygonFilter addPoint(double lat, double lon) to OverpassPolygonFilter (should return the query object itself by the logic applied everywhere else in the Query classes)

When done, it should be possible to use the polygon filter like:

new OverpassQuery()
    .filterQuery()
        .node()
        .polygon()
            .addPoint(lat1, lon1)
            .addPoint(lat2, lon2)
            .addPoint(lat3, lon3)
            // ...
        .end()
    .end()
    .output(100)
    .build()
;

zsoltk avatar Dec 04 '15 15:12 zsoltk