Skip to content

Commit

Permalink
Merge branch 'fix-kelamapper' into dev-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
vesameskanen committed Jun 14, 2023
2 parents 6edeb98 + 429dbdd commit 81b6663
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/BuildConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -965,15 +965,15 @@ the local filesystem.

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Optional`**Default value:** `"default"`
**Path:** /osm/[0]
**Enum values:** `default` | `norway` | `uk` | `finland` | `germany` | `atlanta` | `houston` | `portland` | `constantspeed`
**Enum values:** `default` | `norway` | `uk` | `finland` | `germany` | `atlanta` | `houston` | `portland` | `constant-speed-finland`

The named set of mapping rules applied when parsing OSM tags. Overrides the value specified in `osmDefaults`.

<h3 id="od_osmTagMapping">osmTagMapping</h3>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Optional`**Default value:** `"default"`
**Path:** /osmDefaults
**Enum values:** `default` | `norway` | `uk` | `finland` | `germany` | `atlanta` | `houston` | `portland` | `constantspeed`
**Enum values:** `default` | `norway` | `uk` | `finland` | `germany` | `atlanta` | `houston` | `portland` | `constant-speed-finland`

The named set of mapping rules applied when parsing OSM tags.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
/**
* OSM way properties for optimizing distance (not traveling time) in routing.
*/
class ConstantSpeedMapper implements OsmTagMapper {
class ConstantSpeedFinlandMapper implements OsmTagMapper {

private float speed;

public ConstantSpeedMapper() {
public ConstantSpeedFinlandMapper() {
super();
this.speed = 22.22f; // 80 kmph by default
}

public ConstantSpeedMapper(float speed) {
public ConstantSpeedFinlandMapper(float speed) {
super();
this.speed = speed;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public enum OsmTagMapperSource {
ATLANTA,
HOUSTON,
PORTLAND,
CONSTANTSPEED;
CONSTANT_SPEED_FINLAND;

public OsmTagMapper getInstance() {
return switch (this) {
Expand All @@ -25,7 +25,7 @@ public OsmTagMapper getInstance() {
case ATLANTA -> new AtlantaMapper();
case HOUSTON -> new HoustonMapper();
case PORTLAND -> new PortlandMapper();
case CONSTANTSPEED -> new ConstantSpeedMapper();
case CONSTANT_SPEED_FINLAND -> new ConstantSpeedFinlandMapper();
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void isMotorThroughTrafficExplicitlyDisallowed() {

@Test
public void constantSpeedCarRouting() {
OsmTagMapper osmTagMapper = new ConstantSpeedMapper(20f);
OsmTagMapper osmTagMapper = new ConstantSpeedFinlandMapper(20f);

var slowWay = new OSMWithTags();
slowWay.addTag("highway", "residential");
Expand Down

0 comments on commit 81b6663

Please sign in to comment.