Skip to content

Commit

Permalink
Merge pull request #252 from ehx-v1/0.15-neo4j-2.3
Browse files Browse the repository at this point in the history
Refactored OSM Importer (isOneway(...) function).
  • Loading branch information
craigtaverner authored Jun 14, 2016
2 parents a0c9def + bb541af commit 49fdec4
Showing 1 changed file with 7 additions and 6 deletions.
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

0 comments on commit 49fdec4

Please sign in to comment.