Changeset 11247 in josm for trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java
- Timestamp:
- 2016-11-13T00:29:31+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java
r11240 r11247 37 37 */ 38 38 public static Collection<OsmPrimitive> getSurroundingObjects(EastNorth internalPoint) { 39 return getSurroundingObjects(Main.getLayerManager().getEditDataSet(), internalPoint );39 return getSurroundingObjects(Main.getLayerManager().getEditDataSet(), internalPoint, false); 40 40 } 41 41 … … 46 46 * @param ds the data set 47 47 * @param internalPoint the internal point. 48 * @param includeMultipolygonWays whether to include multipolygon ways in the result (false by default) 48 49 * @return the surrounding polygons/multipolygons 49 * @since 1124 050 * @since 11247 50 51 */ 51 public static Collection<OsmPrimitive> getSurroundingObjects(DataSet ds, EastNorth internalPoint ) {52 public static Collection<OsmPrimitive> getSurroundingObjects(DataSet ds, EastNorth internalPoint, boolean includeMultipolygonWays) { 52 53 if (ds == null) { 53 54 return Collections.emptySet(); … … 62 63 for (Relation r : ds.getRelations()) { 63 64 if (r.isUsable() && r.isMultipolygon() && r.isSelectable() && Geometry.isNodeInsideMultiPolygon(n, r, null)) { 64 for (RelationMember m : r.getMembers()) { 65 if (m.isWay() && m.getWay().isClosed()) { 66 found.values().remove(m.getWay()); 65 if (!includeMultipolygonWays) { 66 for (RelationMember m : r.getMembers()) { 67 if (m.isWay() && m.getWay().isClosed()) { 68 found.values().remove(m.getWay()); 69 } 67 70 } 68 71 }
Note:
See TracChangeset
for help on using the changeset viewer.