-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '3825a024000a7bc576ab2f5a19b44bb1dd333822' into boarding…
…-locations
- Loading branch information
Showing
29 changed files
with
355 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...cation/src/main/java/org/opentripplanner/service/osminfo/OsmInfoGraphBuildRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.opentripplanner.service.osminfo; | ||
|
||
import java.io.Serializable; | ||
import java.util.Optional; | ||
import org.opentripplanner.service.osminfo.model.OsmWayReferences; | ||
import org.opentripplanner.street.model.edge.Edge; | ||
|
||
/** | ||
* Store OSM data used during graph build, but after the OSM Graph Builder is done. | ||
* <p> | ||
* This is a repository to support the {@link OsmInfoGraphBuildService}. | ||
*/ | ||
public interface OsmInfoGraphBuildRepository extends Serializable { | ||
/** | ||
* TODO Add doc | ||
*/ | ||
void addReferences(Edge edge, OsmWayReferences info); | ||
|
||
/** | ||
* TODO Add doc | ||
*/ | ||
Optional<OsmWayReferences> findReferences(Edge edge); | ||
} |
22 changes: 22 additions & 0 deletions
22
application/src/main/java/org/opentripplanner/service/osminfo/OsmInfoGraphBuildService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.opentripplanner.service.osminfo; | ||
|
||
import java.util.Optional; | ||
import org.opentripplanner.service.osminfo.model.OsmWayReferences; | ||
import org.opentripplanner.street.model.edge.Edge; | ||
|
||
/** | ||
* The responsibility of this service is to provide information from Open Street Map, which | ||
* is NOT in the OTP street graph. The graph build happens in phases, and some data is read in | ||
* from the OSM files, but needed later on. For example, we might need info from OSM to link street | ||
* edges/vertexes with transit stops/platforms. We do not want to put data in the OTP street graph | ||
* unless it is relevant for routing. So, for information that is read by the OsmGraphBuilder, but | ||
* needed later on, we have this service. | ||
* | ||
* THIS SERVICE IS ONLY AVAILABLE DURING GRAPH BUILD, NOT DURING ROUTING. * | ||
*/ | ||
public interface OsmInfoGraphBuildService { | ||
/** | ||
* TODO Add doc | ||
*/ | ||
Optional<OsmWayReferences> findReferences(Edge edge); | ||
} |
12 changes: 12 additions & 0 deletions
12
...java/org/opentripplanner/service/osminfo/configure/OsmInfoGraphBuildRepositoryModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.opentripplanner.service.osminfo.configure; | ||
|
||
import dagger.Binds; | ||
import dagger.Module; | ||
import org.opentripplanner.service.osminfo.OsmInfoGraphBuildRepository; | ||
import org.opentripplanner.service.osminfo.internal.DefaultOsmInfoGraphBuildRepository; | ||
|
||
@Module | ||
public interface OsmInfoGraphBuildRepositoryModule { | ||
@Binds | ||
OsmInfoGraphBuildRepository bind(DefaultOsmInfoGraphBuildRepository repository); | ||
} |
12 changes: 12 additions & 0 deletions
12
...in/java/org/opentripplanner/service/osminfo/configure/OsmInfoGraphBuildServiceModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.opentripplanner.service.osminfo.configure; | ||
|
||
import dagger.Binds; | ||
import dagger.Module; | ||
import org.opentripplanner.service.osminfo.OsmInfoGraphBuildService; | ||
import org.opentripplanner.service.osminfo.internal.DefaultOsmInfoGraphBuildService; | ||
|
||
@Module | ||
public interface OsmInfoGraphBuildServiceModule { | ||
@Binds | ||
OsmInfoGraphBuildService bind(DefaultOsmInfoGraphBuildService service); | ||
} |
37 changes: 37 additions & 0 deletions
37
...java/org/opentripplanner/service/osminfo/internal/DefaultOsmInfoGraphBuildRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.opentripplanner.service.osminfo.internal; | ||
|
||
import jakarta.inject.Inject; | ||
import java.io.Serializable; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.Optional; | ||
import org.opentripplanner.service.osminfo.OsmInfoGraphBuildRepository; | ||
import org.opentripplanner.service.osminfo.model.OsmWayReferences; | ||
import org.opentripplanner.street.model.edge.Edge; | ||
|
||
public class DefaultOsmInfoGraphBuildRepository | ||
implements OsmInfoGraphBuildRepository, Serializable { | ||
|
||
private final Map<Edge, OsmWayReferences> references = new HashMap<>(); | ||
|
||
@Inject | ||
public DefaultOsmInfoGraphBuildRepository() {} | ||
|
||
@Override | ||
public void addReferences(Edge edge, OsmWayReferences info) { | ||
Objects.requireNonNull(edge); | ||
Objects.requireNonNull(info); | ||
this.references.put(edge, info); | ||
} | ||
|
||
@Override | ||
public Optional<OsmWayReferences> findReferences(Edge edge) { | ||
return Optional.ofNullable(references.get(edge)); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "DefaultOsmInfoGraphBuildRepository{references size = " + references.size() + "}"; | ||
} | ||
} |
Oops, something went wrong.