} else {
coords = new double[] { xCoord, yCoord };
}
+
+ // Switch to (longitude, latitude)
+ flipAxes(coords);
+
Resource vertex = DistrictNetworkUtil.createVertex(graph, model.getParentDiagram(), coords, model.getComponentMappings().get(mappingValue));
writeStringValue(graph, row, idColumn, vertex, DN.HasId);
startCoords = new double[] { startXCoord , startYCoord };
endCoords = new double[] { endXCoord , endYCoord };
}
-
+
+ // Switch to (longitude, latitude)
+ flipAxes(startCoords);
+ flipAxes(endCoords);
+
Resource edge = DNEdgeBuilder.create(graph, vv, model.getParentDiagram(), model.getComponentMappings().get(mappingValue), startCoords, endCoords, padding, true);
writeStringValue(graph, row, idColumn, edge, DN.HasId);
return false;
}
}
-
+
+ private static void flipAxes(double[] coords) {
+ double tmp = coords[0];
+ coords[0] = coords[1];
+ coords[1] = tmp;
+ }
+
private static void writeValue(WriteGraph graph, CSVRecord row, int index, Resource subject, Resource relation) throws DatabaseException {
- if (index != -1) {
+ if (index != -1) {
String stringValue = row.get(index);
if (!stringValue.isEmpty()) {
try {