Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored OSM Importer (isOneway(...) function). #252

Merged
merged 1 commit into from
Jun 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/main/java/org/neo4j/gis/spatial/osm/OSMImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ protected void debugNodeWithId( T node, String idName, long[] idValues )
protected void createOSMWay( Map<String, Object> wayProperties,
ArrayList<Long> wayNodes, LinkedHashMap<String, Object> wayTags )
{
RoadDirection direction = isOneway( wayTags );
RoadDirection direction = getRoadDirection( wayTags );
String name = (String) wayTags.get( "name" );
int geometry = GTYPE_LINESTRING;
boolean isRoad = wayTags.containsKey( "highway" );
Expand Down Expand Up @@ -2120,12 +2120,13 @@ else if ( prop.equals( "timestamp" ) )
}

/**
* Detects if road has the only direction
*
* @param wayProperties
* @return RoadDirection
* Retrieves the direction of the given road, i.e. whether it is a one-way road from its start node,
* a one-way road to its start node or a two-way road.
* @param wayProperties the property map of the road
* @return BOTH if it's a two-way road, FORWARD if it's a one-way road from the start node,
* or BACKWARD if it's a one-way road to the start node
*/
public static RoadDirection isOneway( Map<String, Object> wayProperties )
public static RoadDirection getRoadDirection( Map<String, Object> wayProperties )
{
String oneway = (String) wayProperties.get( "oneway" );
if ( null != oneway )
Expand Down