Skip to content
Snippets Groups Projects
Commit 344ea4ed authored by lazarog98's avatar lazarog98
Browse files

Merge branch '9-hotfix-duplicate-geometries-for-split-segments' into 'main'

Resolve "[HOTFIX] Duplicate geometries for split segments"

Closes #9

See merge request !24
parents 37c28445 64064e1d
Branches
No related tags found
1 merge request!24Resolve "[HOTFIX] Duplicate geometries for split segments"
......@@ -24,10 +24,10 @@ public class App {
*/
// smaller BBox inside Cottbus, better for the debug tool
float minLat = 51.757799795929955f;
float minLon = 14.32136535644531f;
float maxLat = 51.770389396279654f;
float maxLon = 14.349260330200195f;
float minLat = 51.764092326645475f;
float minLon = 14.310615062713623f;
float maxLat = 51.766591637718435f;
float maxLon = 14.314413070678711f;
// BBox around Cottbus
/*
......
......@@ -67,7 +67,6 @@ public class OSMParser {
}
private void createSegment(JSONObject element, ArrayList<Long> geometry) {
JSONArray nodes = element.getJSONArray(OSMKey.nodes.name());
long osmId = element.getLong(OSMKey.id.name());
ArrayList<Coordinates> line = null;
......@@ -80,8 +79,8 @@ public class OSMParser {
return;
}
long startNodeId = nodes.getLong(0);
long endNodeId = nodes.getLong(nodes.length() - 1);
long startNodeId = geometry.get(0);
long endNodeId = geometry.get(geometry.size() - 1);
boolean oneWay = this.isOneWay(element);
int maxSpeed = SegmentUtils.getMaxSpeed(element);
......
......@@ -118,7 +118,9 @@ public class SegmentUtils {
ArrayList<Long> geometryNodeIds = extractIdsFromTo(nodes, from, i);
geometry.add(geometryNodeIds);
System.out.println("Splitting at position " + from);
if (from != 0) {
System.out.println("Splitting at position " + from + ", nodes:");
}
from = i;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment