Search in sources :

Example 11 with MultipolygonBuilder

use of net.osmand.data.MultipolygonBuilder in project OsmAnd-tools by osmandapp.

the class IndexRouteCreator method addLowEmissonZoneWay.

private void addLowEmissonZoneWay(Way e) {
    List<Way> outer = new ArrayList<>();
    List<Way> inner = new ArrayList<>();
    outer.add(e);
    MultipolygonBuilder multipolygonBuilder = new MultipolygonBuilder(outer, inner);
    multipolygonBuilder.setId(e.getId());
    Multipolygon lowEmissionZone = multipolygonBuilder.build();
    if (lowEmissionZone != null) {
        QuadRect bbox = lowEmissionZone.getLatLonBbox();
        QuadRect flippedBbox = flipBbox(bbox);
        lowEmissionZones.insert(lowEmissionZone, flippedBbox);
    }
}
Also used : TIntArrayList(gnu.trove.list.array.TIntArrayList) ArrayList(java.util.ArrayList) TLongArrayList(gnu.trove.list.array.TLongArrayList) Multipolygon(net.osmand.data.Multipolygon) QuadRect(net.osmand.data.QuadRect) Way(net.osmand.osm.edit.Way) MultipolygonBuilder(net.osmand.data.MultipolygonBuilder)

Aggregations

MultipolygonBuilder (net.osmand.data.MultipolygonBuilder)11 Multipolygon (net.osmand.data.Multipolygon)7 Node (net.osmand.osm.edit.Node)7 Way (net.osmand.osm.edit.Way)6 ArrayList (java.util.ArrayList)5 QuadRect (net.osmand.data.QuadRect)5 Ring (net.osmand.data.Ring)5 Relation (net.osmand.osm.edit.Relation)4 RelationMember (net.osmand.osm.edit.Relation.RelationMember)4 TIntArrayList (gnu.trove.list.array.TIntArrayList)3 File (java.io.File)3 TreeSet (java.util.TreeSet)3 BinaryMapDataObject (net.osmand.binary.BinaryMapDataObject)3 LatLon (net.osmand.data.LatLon)3 TLongObjectHashMap (gnu.trove.map.hash.TLongObjectHashMap)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2