Skip to content

Commit

Permalink
only check for routable areas instead of areas in general
Browse files Browse the repository at this point in the history
  • Loading branch information
miklcct committed Oct 15, 2024
1 parent 6dbaf21 commit 32a97b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public void addWay(OsmWay way) {

applyLevelsForWay(way);

if (way.isAreaWay()) {
if (way.isRoutableArea()) {
// this is an area that's a simple polygon. So we can just add it straight
// to the areas, if it's not part of a relation.
if (!areaWayIds.contains(wayId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ public class OsmWay extends OsmWithTags {
"backward",
"reversible"
);

private static final Set<String> INDOOR_AREA_VALUES = Set.of(
"room",
"corridor",
"area"
);


private final TLongList nodes = new TLongArrayList();

public void addNodeRef(long nodeRef) {
Expand Down Expand Up @@ -149,20 +143,20 @@ public boolean isBackwardEscalator() {
*
* An area can be specified as such, or be one by default as an amenity.
*/
public boolean isAreaWay() {
public boolean isRoutableArea() {
return (
!isTag("area", "no") &&
(
isTag("area", "yes") || isParking() || isBikeParking() || isBoardingArea() || isIndoorArea()
isTag("area", "yes") ||
isParking() ||
isBikeParking() ||
isBoardingArea() ||
isIndoorRoutable()
) &&
getNodeRefs().size() > 2
);
}

public boolean isIndoorArea() {
return isOneOfTags("indoor", INDOOR_AREA_VALUES);
}

/**
* Given a set of {@code permissions} check if it can really be applied to both directions
* of the way and return the permissions for both cases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ public class OsmWithTags {
"bus_guideway",
"escape"
);

private static final Set<String> INDOOR_ROUTABLE_VALUES = Set.of(
"corridor",
"area"
);

private static final Set<String> INDOOR_ROUTABLE_VALUES = Set.of("corridor", "area");

private static final Set<String> LEVEL_TAGS = Set.of("level", "layer");
private static final Set<String> DEFAULT_LEVEL = Set.of("0");
Expand Down

0 comments on commit 32a97b7

Please sign in to comment.