diff --git a/CHANGELOG.md b/CHANGELOG.md index e843fc5a..43f21f91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased/Snapshot] +## [Unreleased] ### Added - Read the docs capabilities @@ -19,6 +19,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Coordinated shut down phase ### Changed +- Rely on Java 17 + - Workaround for `spotless`: Add module exports to `gradle.properties` -### Fixed -- ... +### Removed +- Legacy Java code + - Jacoco gradle pluginfgc + +[Unreleased]: https://github.com/ie3-institute/OSMoGrid/compare/7e598e53e333c9c1a7b19906584f0357ddf07990...HEAD diff --git a/Jenkinsfile b/Jenkinsfile index 2ddf55f0..681898eb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ //////////////////////////////// /* project configuration */ -String javaVersionId = 'jdk-11' // id that matches the java tool with the java version that should be used set as jenkins property +String javaVersionId = 'jdk-17' // id that matches the java tool with the java version that should be used set as jenkins property /* git configuration */ String projectName = 'OSMoGrid' // name of the repository, is case insensitive @@ -112,11 +112,10 @@ node { sh 'java -version' - gradle('--refresh-dependencies clean spotlessCheck pmdMain pmdTest spotbugsMain ' + - 'spotbugsTest test jacocoTestReport jacocoTestCoverageVerification', projectName) + gradle('--refresh-dependencies clean spotlessCheck pmdMain pmdTest spotbugsMain spotbugsTest test', projectName) // due to an issue with openjdk-8 we use openjdk-11 for javadocs generation - sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew clean javadoc -Dorg.gradle.java.home=/opt/java/openjdk''', returnStdout: true) + sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew clean javadoc''', returnStdout: true) } // sonarqube analysis @@ -159,7 +158,7 @@ node { */ sh( script: """set +x && cd $projectName""" + - ''' set +x; ./gradlew clean javadoc -Dorg.gradle.java.home=/opt/java/openjdk''', + ''' set +x; ./gradlew clean javadoc''', returnStdout: true ) @@ -389,7 +388,7 @@ def deployJavaDocs(String projectName, String sshCredentialsId, String gitChecko "git config user.name 'Johannes Hiry' && " + "git fetch --depth=1 origin api-docs && " + "git checkout api-docs && " + - "cd .. && ./gradlew clean javadoc -Dorg.gradle.java.home=/opt/java/openjdk && " + + "cd .. && ./gradlew clean javadoc && " + "cp -R build/docs/javadoc/* tmp-api-docs && " + "cd tmp-api-docs &&" + "git add --all && git commit -m 'updated api-docs' && git push origin api-docs:api-docs" + @@ -458,9 +457,6 @@ def publishReports(String relativeProjectDir) { // publish test reports publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/tests/test', reportFiles: 'index.html', reportName: "${relativeProjectDir}_java_tests_report", reportTitles: '']) - // publish jacoco report for main project only - publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/jacoco', reportFiles: 'index.html', reportName: "${relativeProjectDir}_jacoco_report", reportTitles: '']) - // publish pmd report for main project only publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/pmd', reportFiles: 'main.html', reportName: "${relativeProjectDir}_pmd_report", reportTitles: '']) diff --git a/build.gradle b/build.gradle index 7f4f168d..70d291ac 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,19 @@ plugins { // todo revise id 'java' //java support - id 'groovy' // groovy support + id 'scala' id 'pmd' // code check, working on source code id 'com.diffplug.spotless' version '6.2.0'//code format id 'com.github.spotbugs' version '5.0.4' // code check, working on byte code id 'de.undercouch.download' version '4.1.2' id 'kr.motd.sphinx' version '2.10.1' // documentation generation id "com.github.maiflai.scalatest" version "0.32" // run scalatest without specific spec task - id 'jacoco' // java code coverage plugin id "org.sonarqube" version "3.3" // sonarqube id 'net.thauvin.erik.gradle.semver' version '1.0.4' // semantic versioning - id 'scala' } ext { - javaVersion = JavaVersion.VERSION_11 + javaVersion = JavaVersion.VERSION_17 scalaMajorVersion = '3' scalaVersion = '3.1.0' @@ -41,7 +39,6 @@ apply from: scriptsLocation + 'spotbugs.gradle' apply from: scriptsLocation + 'spotless.gradle' apply from: scriptsLocation + 'checkJavaVersion.gradle' apply from: scriptsLocation + 'documentation.gradle' -apply from: scriptsLocation + 'jacoco.gradle' // jacoco java code coverage apply from: scriptsLocation + 'sonarqube.gradle' apply from: scriptsLocation + 'vcs.gradle' apply from: scriptsLocation + 'semVer.gradle' @@ -49,7 +46,8 @@ apply from: scriptsLocation + 'tscfg.gradle' repositories { mavenCentral() //searches in bintray's repository 'jCenter', which contains Maven Central - maven { url 'https://www.jitpack.io' } // allows github repos as dependencies + maven { url 'https://www.jitpack.io' } // allows github repos as dependencies// sonatype snapshot repo + maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } // Snapshot-Repository } dependencies { @@ -76,7 +74,7 @@ dependencies { // todo CLEANUP following old dependencies // ie³ power system utils - implementation('com.github.ie3-institute:PowerSystemUtils:1.6') { + implementation('com.github.ie3-institute:PowerSystemUtils:2.0-SNAPSHOT') { exclude group: 'org.slf4j' exclude group: 'org.apache.logging.log4j' exclude group: 'com.github.ie3-institute' diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..601931d4 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,6 @@ +# Workaround for splotless with java 17 +org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED diff --git a/gradle/scripts/jacoco.gradle b/gradle/scripts/jacoco.gradle deleted file mode 100644 index 9f097cf4..00000000 --- a/gradle/scripts/jacoco.gradle +++ /dev/null @@ -1,59 +0,0 @@ -// see https://docs.gradle.org/current/userguide/jacoco_plugin.html for details -// and http://vgaidarji.me/blog/2017/12/20/how-to-configure-jacoco-for-kotlin-and-java-project/ for exclude explanation - -// general configuration -jacoco { - toolVersion = "0.8.4" - reportsDir = file("$buildDir/reports/jacoco") -} - -jacocoTestReport { - reports { - xml.enabled true - csv.enabled false - html.enabled true - html.destination file("${buildDir}/reports/jacoco") - } - - // what to exclude from coverage report (files that should not be analyzed!) - // UI, "noise", generated classes, platform classes, etc. - def excludes = [ - 'scala/**/*.*', - // exclude scala source files - 'groovy/**/*.*', - // exclude groovy source files - '**/**Test**.**', - // exclude unit tests files - '**/**IT**.**' // exclude integration tests files - ] - - getClassDirectories().setFrom(fileTree( - dir: "$buildDir/classes/", - excludes: excludes - )) - - // sourceSets sourceSets.main - executionData check // include integration tests in jacoco reports -} - -jacocoTestCoverageVerification { - violationRules { - rule { - limit { - minimum = 0 - } - } - - rule { - enabled = false - element = 'CLASS' - includes = ['org.gradle.*'] - - limit { - counter = 'LINE' - value = 'TOTALCOUNT' - maximum = 0.3 - } - } - } -} diff --git a/gradle/scripts/pmd.gradle b/gradle/scripts/pmd.gradle index e4385cc2..390377d8 100644 --- a/gradle/scripts/pmd.gradle +++ b/gradle/scripts/pmd.gradle @@ -2,6 +2,6 @@ pmd { consoleOutput = true - toolVersion = "6.40.0" + toolVersion = "6.41.0" rulesMinimumPriority = 2 } diff --git a/gradle/scripts/sonarqube.gradle b/gradle/scripts/sonarqube.gradle index 57032d88..0eefaaf0 100644 --- a/gradle/scripts/sonarqube.gradle +++ b/gradle/scripts/sonarqube.gradle @@ -7,18 +7,13 @@ sonarqube { property 'sonar.sourceEncoding', 'UTF-8' // encoding property 'sonar.sources', [ 'src/main/resources', - 'src/main/java', 'src/main/scala'] // src dirs property "sonar.tests", [ 'src/test/resources', - 'src/test/java', 'src/test/scala'] // test src dirs // reports stuff (for all languages) property 'sonar.junit.reportPaths', [ 'build/test-results/test'] // Comma-delimited list of paths to Surefire XML-format reports. - // unit tests reports dirs - property "sonar.coverage.jacoco.xmlReportsPath", [ - "build/reports/jacoco/test/jacocoTestReport.xml"] // Comma-separated list of paths to JaCoCo (jacoco.xml) report files. // spotbugs report dir property "sonar.java.spotbugs.reportPaths", [ "build/reports/spotbugs/main.xml", @@ -27,12 +22,6 @@ sonarqube { property "sonar.java.pmd.reportPaths", [ "build/reports/pmd/test.xml", "build/reports/pmd/main.xml"] // Comma-delimited list of paths to PMD Apex XML reports - // groovy specific stuff - property 'sonar.groovy.jacoco.reportPath', 'build/jacoco/test.exec' // unit tests reports dir - /// integration tests reports dir (if any) - property 'sonar.groovy.jacoco.itReportPath', 'build/jacoco/test.exec' - property 'sonar.groovy.binaries', 'build/classes/groovy' // groovy binaries - // exclusions property 'sonar.exclusions', [ 'docs/**', @@ -49,6 +38,3 @@ project.tasks["sonarqube"].dependsOn "check" // - pmdTest // - spotBugsTest // - test - -project.tasks["sonarqube"].dependsOn "jacocoTestReport" -project.tasks["sonarqube"].dependsOn "jacocoTestCoverageVerification" diff --git a/gradle/scripts/spotbugs.gradle b/gradle/scripts/spotbugs.gradle index 3b7f48f7..0e792c45 100644 --- a/gradle/scripts/spotbugs.gradle +++ b/gradle/scripts/spotbugs.gradle @@ -8,14 +8,14 @@ spotbugs{ spotbugsMain{ reports{ - html.enabled = false - xml.enabled = true + html.enabled false + xml.enabled true } } spotbugsTest{ reports{ - html.enabled = false - xml.enabled = true + html.enabled false + xml.enabled true } } diff --git a/src/main/java/de/osmogrid/config/OsmogridConfig.java b/src/main/java/de/osmogrid/config/OsmogridConfig.java deleted file mode 100644 index 76e44d6c..00000000 --- a/src/main/java/de/osmogrid/config/OsmogridConfig.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.config; - -public class OsmogridConfig { - public final OsmogridConfig.Grid grid; - public final OsmogridConfig.Io io; - public final OsmogridConfig.Runtime runtime; - - public static class Grid { - public final double averagePowerDensity; - public final boolean considerHouseConnectionPoints; - public final double ignoreClustersSmallerThan; - public final java.lang.String lineType; - public final double loadSubstation; - public final double nominalPower; - public final double ratedVoltage; - public final double ratedVoltageHigherNet; - public final boolean separateClustersByLandUses; - public final java.lang.String voltageLevel; - - public Grid( - com.typesafe.config.Config c, - java.lang.String parentPath, - $TsCfgValidator $tsCfgValidator) { - this.averagePowerDensity = $_reqDbl(parentPath, c, "averagePowerDensity", $tsCfgValidator); - this.considerHouseConnectionPoints = - $_reqBln(parentPath, c, "considerHouseConnectionPoints", $tsCfgValidator); - this.ignoreClustersSmallerThan = - $_reqDbl(parentPath, c, "ignoreClustersSmallerThan", $tsCfgValidator); - this.lineType = $_reqStr(parentPath, c, "lineType", $tsCfgValidator); - this.loadSubstation = $_reqDbl(parentPath, c, "loadSubstation", $tsCfgValidator); - this.nominalPower = $_reqDbl(parentPath, c, "nominalPower", $tsCfgValidator); - this.ratedVoltage = $_reqDbl(parentPath, c, "ratedVoltage", $tsCfgValidator); - this.ratedVoltageHigherNet = - $_reqDbl(parentPath, c, "ratedVoltageHigherNet", $tsCfgValidator); - this.separateClustersByLandUses = - $_reqBln(parentPath, c, "separateClustersByLandUses", $tsCfgValidator); - this.voltageLevel = $_reqStr(parentPath, c, "voltageLevel", $tsCfgValidator); - } - - private static boolean $_reqBln( - java.lang.String parentPath, - com.typesafe.config.Config c, - java.lang.String path, - $TsCfgValidator $tsCfgValidator) { - if (c == null) return false; - try { - return c.getBoolean(path); - } catch (com.typesafe.config.ConfigException e) { - $tsCfgValidator.addBadPath(parentPath + path, e); - return false; - } - } - - private static double $_reqDbl( - java.lang.String parentPath, - com.typesafe.config.Config c, - java.lang.String path, - $TsCfgValidator $tsCfgValidator) { - if (c == null) return 0; - try { - return c.getDouble(path); - } catch (com.typesafe.config.ConfigException e) { - $tsCfgValidator.addBadPath(parentPath + path, e); - return 0; - } - } - - private static java.lang.String $_reqStr( - java.lang.String parentPath, - com.typesafe.config.Config c, - java.lang.String path, - $TsCfgValidator $tsCfgValidator) { - if (c == null) return null; - try { - return c.getString(path); - } catch (com.typesafe.config.ConfigException e) { - $tsCfgValidator.addBadPath(parentPath + path, e); - return null; - } - } - } - - public static class Io { - public final java.lang.String pbfFilePath; - public final boolean readTypes; - public final java.lang.String targetFormat; - public final java.lang.String typeSourceFormat; - public final boolean write; - - public Io( - com.typesafe.config.Config c, - java.lang.String parentPath, - $TsCfgValidator $tsCfgValidator) { - this.pbfFilePath = $_reqStr(parentPath, c, "pbfFilePath", $tsCfgValidator); - this.readTypes = $_reqBln(parentPath, c, "readTypes", $tsCfgValidator); - this.targetFormat = $_reqStr(parentPath, c, "targetFormat", $tsCfgValidator); - this.typeSourceFormat = $_reqStr(parentPath, c, "typeSourceFormat", $tsCfgValidator); - this.write = $_reqBln(parentPath, c, "write", $tsCfgValidator); - } - - private static boolean $_reqBln( - java.lang.String parentPath, - com.typesafe.config.Config c, - java.lang.String path, - $TsCfgValidator $tsCfgValidator) { - if (c == null) return false; - try { - return c.getBoolean(path); - } catch (com.typesafe.config.ConfigException e) { - $tsCfgValidator.addBadPath(parentPath + path, e); - return false; - } - } - - private static java.lang.String $_reqStr( - java.lang.String parentPath, - com.typesafe.config.Config c, - java.lang.String path, - $TsCfgValidator $tsCfgValidator) { - if (c == null) return null; - try { - return c.getString(path); - } catch (com.typesafe.config.ConfigException e) { - $tsCfgValidator.addBadPath(parentPath + path, e); - return null; - } - } - } - - public static class Runtime { - public final boolean cutArea; - public final boolean gui; - public final java.lang.String name; - public final boolean plot; - - public Runtime( - com.typesafe.config.Config c, - java.lang.String parentPath, - $TsCfgValidator $tsCfgValidator) { - this.cutArea = $_reqBln(parentPath, c, "cutArea", $tsCfgValidator); - this.gui = $_reqBln(parentPath, c, "gui", $tsCfgValidator); - this.name = $_reqStr(parentPath, c, "name", $tsCfgValidator); - this.plot = $_reqBln(parentPath, c, "plot", $tsCfgValidator); - } - - private static boolean $_reqBln( - java.lang.String parentPath, - com.typesafe.config.Config c, - java.lang.String path, - $TsCfgValidator $tsCfgValidator) { - if (c == null) return false; - try { - return c.getBoolean(path); - } catch (com.typesafe.config.ConfigException e) { - $tsCfgValidator.addBadPath(parentPath + path, e); - return false; - } - } - - private static java.lang.String $_reqStr( - java.lang.String parentPath, - com.typesafe.config.Config c, - java.lang.String path, - $TsCfgValidator $tsCfgValidator) { - if (c == null) return null; - try { - return c.getString(path); - } catch (com.typesafe.config.ConfigException e) { - $tsCfgValidator.addBadPath(parentPath + path, e); - return null; - } - } - } - - public OsmogridConfig(com.typesafe.config.Config c) { - final $TsCfgValidator $tsCfgValidator = new $TsCfgValidator(); - final java.lang.String parentPath = ""; - this.grid = - c.hasPathOrNull("grid") - ? new OsmogridConfig.Grid(c.getConfig("grid"), parentPath + "grid.", $tsCfgValidator) - : new OsmogridConfig.Grid( - com.typesafe.config.ConfigFactory.parseString("grid{}"), - parentPath + "grid.", - $tsCfgValidator); - this.io = - c.hasPathOrNull("io") - ? new OsmogridConfig.Io(c.getConfig("io"), parentPath + "io.", $tsCfgValidator) - : new OsmogridConfig.Io( - com.typesafe.config.ConfigFactory.parseString("io{}"), - parentPath + "io.", - $tsCfgValidator); - this.runtime = - c.hasPathOrNull("runtime") - ? new OsmogridConfig.Runtime( - c.getConfig("runtime"), parentPath + "runtime.", $tsCfgValidator) - : new OsmogridConfig.Runtime( - com.typesafe.config.ConfigFactory.parseString("runtime{}"), - parentPath + "runtime.", - $tsCfgValidator); - $tsCfgValidator.validate(); - } - - private static final class $TsCfgValidator { - private final java.util.List badPaths = new java.util.ArrayList<>(); - - void addBadPath(java.lang.String path, com.typesafe.config.ConfigException e) { - badPaths.add("'" + path + "': " + e.getClass().getName() + "(" + e.getMessage() + ")"); - } - - void validate() { - if (!badPaths.isEmpty()) { - java.lang.StringBuilder sb = new java.lang.StringBuilder("Invalid configuration:"); - for (java.lang.String path : badPaths) { - sb.append("\n ").append(path); - } - throw new com.typesafe.config.ConfigException(sb.toString()) {}; - } - } - } -} diff --git a/src/main/java/de/osmogrid/controller/SessionController.java b/src/main/java/de/osmogrid/controller/SessionController.java deleted file mode 100644 index bcb59c8d..00000000 --- a/src/main/java/de/osmogrid/controller/SessionController.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.controller; - -import de.osmogrid.config.OsmogridConfig; -import de.osmogrid.controller.graph.GraphController; -import de.osmogrid.controller.grid.GridController; -import de.osmogrid.model.graph.DistanceWeightedOsmEdge; -import de.osmogrid.model.graph.OsmGridNode; -import de.osmogrid.util.enums.TargetFormat; -import edu.ie3.datamodel.models.input.container.JointGridContainer; -import java.util.List; -import org.jgrapht.graph.AsSubgraph; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Controls all operations on the session. - * - * @author Mahr - * @since 17.12.2018 - */ -public class SessionController { - - private static final Logger logger = LoggerFactory.getLogger(SessionController.class); - - public void initialize(OsmogridConfig osmogridConfig) { - - long tStart = System.currentTimeMillis(); - logger.debug("Starting session for \"{}\", begin initialization", osmogridConfig.runtime.name); - - GraphController graphController = new GraphController(); - graphController.initialize(osmogridConfig); - logger.info("Start building the graph ..."); - List> graphModel = - graphController.generateGraph(); - - GridController gridController = new GridController(); - gridController.initialize(osmogridConfig); - logger.info("Start building the grid ..."); - JointGridContainer gridModel = gridController.generateGrid(graphModel); - - if (osmogridConfig.io.write) { - writeResult(gridModel, TargetFormat.valueOf(osmogridConfig.io.typeSourceFormat)); - } - - // consider using System.nanoTime() to get duration of JVM attended time (depends on what is - // desired here) - long tEnd = System.currentTimeMillis(); - logger.info("Finished. Took me {} seconds.", (tEnd - tStart) / 1000d); - } - - private void writeResult(JointGridContainer jointGridContainer, TargetFormat targetFormat) { - if (targetFormat.equals(TargetFormat.CSV)) { - logger.info("CSV writing not yet implemented."); - } else { - logger.error("Unknown target format."); - } - } -} diff --git a/src/main/java/de/osmogrid/controller/graph/GraphController.java b/src/main/java/de/osmogrid/controller/graph/GraphController.java deleted file mode 100644 index 0593caea..00000000 --- a/src/main/java/de/osmogrid/controller/graph/GraphController.java +++ /dev/null @@ -1,1307 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.controller.graph; - -import static de.osmogrid.util.OsmoGridUtils.GEO2QM_CORRECTION; -import static edu.ie3.util.quantities.PowerSystemUnits.*; -import static tech.units.indriya.unit.Units.METRE; - -import de.osmogrid.config.OsmogridConfig; -import de.osmogrid.model.graph.DistanceWeightedOsmEdge; -import de.osmogrid.model.graph.OsmGraph; -import de.osmogrid.model.graph.OsmGridNode; -import de.osmogrid.util.OsmDataProvider; -import de.osmogrid.util.OsmoGridUtils; -import de.osmogrid.util.QuantityUtils; -import de.osmogrid.util.exceptions.EmptyClusterException; -import de.osmogrid.util.quantities.OsmoGridUnits; -import de.osmogrid.util.quantities.PowerDensity; -import edu.ie3.util.exceptions.GeoPreparationException; -import edu.ie3.util.geo.GeoUtils; -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.stream.Collectors; -import javax.measure.Quantity; -import javax.measure.quantity.Area; -import javax.measure.quantity.Dimensionless; -import javax.measure.quantity.Length; -import javax.measure.quantity.Power; -import math.geom2d.Vector2D; -import net.morbz.osmonaut.geometry.Polygon; -import net.morbz.osmonaut.osm.LatLon; -import net.morbz.osmonaut.osm.Node; -import net.morbz.osmonaut.osm.Tags; -import net.morbz.osmonaut.osm.Way; -import org.jgrapht.Graph; -import org.jgrapht.Graphs; -import org.jgrapht.alg.connectivity.BiconnectivityInspector; -import org.jgrapht.alg.connectivity.ConnectivityInspector; -import org.jgrapht.alg.interfaces.ShortestPathAlgorithm; -import org.jgrapht.alg.shortestpath.JohnsonShortestPaths; -import org.jgrapht.graph.AsSubgraph; -import org.locationtech.jts.geom.Point; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import tech.units.indriya.ComparableQuantity; -import tech.units.indriya.quantity.Quantities; - -/** - * Controls all operations on the graph. - * - * @author Mahr - * @since 17.12.2018 - */ -public class GraphController { - - public static final Logger logger = LoggerFactory.getLogger(GraphController.class); - - private static final List> graphModel = - new ArrayList<>(); - private OsmDataProvider osmDataProvider; - private OsmogridConfig osmogridConfig; - private OsmGraph fullGraph; - - public void initialize(OsmogridConfig osmogridConfig) { - this.osmogridConfig = osmogridConfig; - - osmDataProvider = new OsmDataProvider(); - osmDataProvider.initialize( - osmogridConfig.io.pbfFilePath, osmogridConfig.runtime.cutArea, osmogridConfig.runtime.plot); - - fullGraph = osmDataProvider.getRawGraph(); - } - - /** - * Calls all methods necessary for generating the graph model. - * - * @return The graph model separated into subgraphs. - */ - public List> generateGraph() { - - ComparableQuantity powerDensity = - Quantities.getQuantity( - osmogridConfig.grid.averagePowerDensity, OsmoGridUnits.WATT_PER_SQUARE_METRE); - - logger.info("Calculating perpendiculars"); - calcPerpendicularDistanceMatrix(powerDensity); - - logger.info("Refreshing the graph information"); - fullGraph = refreshGraph(); - - logger.info("Checking clusters for presence of buildings"); - removeEmptyLandUses(); - - logger.info("Calculating and setting edge weights"); - addEdgeWeights(); - - logger.info("Clearing up the graph by removing unnecessary dead ends"); - cleanGraph(fullGraph); - - logger.info("Creating clusters"); - List convexLandUses = new LinkedList<>(); - try { - convexLandUses = buildConvexHulls(); - } catch (GeoPreparationException e) { - logger.error("Could not build convex hull for landuse", e); - System.exit(-1); - } - - List> clusters = createClusterKMedoids(convexLandUses); - - logger.info("Creating subgraphs"); - createSubgraphs(clusters); - logger.info("Created " + graphModel.size() + " subgraphs"); - - logger.info("Cleaning up the subgraphs"); - for (AsSubgraph subgraph : graphModel) { - cleanGraph(subgraph); - } - - logger.info("Calculating cluster loads"); - calculateClusterLoads(); - - return graphModel; - } - - /** - * Calculates the perpendicular point on the street for each building using the distance matrix. - */ - private void calcPerpendicularDistanceMatrix(ComparableQuantity powerDensity) { - - List buildings = osmDataProvider.getBuildings(); - Set[][] highwayDistanceMatrix = osmDataProvider.getHighwayDistanceMatrix(); - - // add highways that already have been visited and have a Perp here - Set hasPerp = new HashSet<>(); - Map> highwayPerps = new HashMap<>(); - - for (Way building : buildings) { - boolean isSubstation = osmDataProvider.getRealSubstations().contains(building); - - LatLon center = building.getCenter(); - Vector2D p = new Vector2D(center.getLon(), center.getLat()); - - // now we have to check if the buildings center is inside a residential area, if yes go on, if - // no go next - if (GeoUtils.isInsideLanduse(center, osmDataProvider.getLandUses())) { - Vector2D p0fin = new Vector2D(); - Way highwayfin = new Way(); - OsmGridNode n1Fin = new OsmGridNode(); - OsmGridNode n2Fin = new OsmGridNode(); - boolean aFin = false; - boolean bFin = false; - - double distance = 1000; - - // get highways near building - int xCoord = - (int) - Math.ceil( - ((center.getLon() - osmDataProvider.getMinLongitude())) - / ((osmDataProvider.getMaxLongitude() - - osmDataProvider.getMinLongitude())) - * highwayDistanceMatrix[0].length) - - 1; - int yCoord = - (int) - Math.ceil( - -((center.getLat() - osmDataProvider.getMaxLatitude())) - / ((osmDataProvider.getMaxLatitude() - - osmDataProvider.getMinLatitude())) - * highwayDistanceMatrix.length) - - 1; - - Set highways = highwayDistanceMatrix[yCoord][xCoord]; // the highways in the own cell - if (yCoord < highwayDistanceMatrix.length - 1) { - highways.addAll(highwayDistanceMatrix[yCoord + 1][xCoord]); // the highways above - } - if (yCoord != 0) { - highways.addAll(highwayDistanceMatrix[yCoord - 1][xCoord]); // the highways below - } - if (xCoord < highwayDistanceMatrix[0].length - 1) { - highways.addAll(highwayDistanceMatrix[yCoord][xCoord + 1]); // the highways @right - } - if (xCoord != 0) { - highways.addAll(highwayDistanceMatrix[yCoord][xCoord - 1]); // the highways @left - } - - for (Way highway : highways) { - for (int i = 0; i < highway.getNodes().size(); i++) { - - if (i != 0) { - OsmGridNode n = new OsmGridNode(highway.getNodes().get(i - 1)); - OsmGridNode n1 = new OsmGridNode(highway.getNodes().get(i)); - - Vector2D a = new Vector2D(n.getLatlon().getLon(), n.getLatlon().getLat()); - Vector2D b = new Vector2D(n1.getLatlon().getLon(), n1.getLatlon().getLat()); - Vector2D u = - new Vector2D( - n1.getLatlon().getLon() - n.getLatlon().getLon(), - n1.getLatlon().getLat() - n.getLatlon().getLat()); - - // intermediate steps to calculate orthogonal projection direction vector - double t = (p.minus(a)).dot(u); // x - r0 * u - double t1 = u.dot(u); // u*u - double t2 = t / t1; // [(x-r0)*u] / [u*u] - - Vector2D pd = - a.plus((u.times(t2)).minus(p)); // resulting orthogonal projection direction - Vector2D p0 = p.plus(pd); // resulting orthogonal projection point on way - - double s1 = (p0.x() - a.x()) / u.x(); - double s2 = (p0.y() - a.y()) / u.y(); - - // round them because only the first few numbers are interesting - s1 = Math.round(s1 * 100000000.0) / 100000000.0; - s2 = Math.round(s2 * 100000000.0) / 100000000.0; - - if (s1 == s2 && s1 > 0 && s1 < 1) { // lambda a to b is always 1 because of u = a - b - - // calculate length of orthogonal vector - double l = Math.sqrt(Math.pow(pd.x(), 2) + Math.pow(pd.y(), 2)); - - // get the minimal distance - if (distance > l) { - distance = l; - p0fin = p0; - highwayfin = highway; - n1Fin = n; - n2Fin = n1; - bFin = false; - aFin = false; - } - } - - // check if distance between corners a & b is even smaller than current distance - // calculate distance between building center and corners a & b - double ap = Math.sqrt(Math.pow(a.minus(p).x(), 2) + Math.pow(a.minus(p).y(), 2)); - double bp = Math.sqrt(Math.pow(b.minus(p).x(), 2) + Math.pow(b.minus(p).y(), 2)); - - double small = - Math.min(Math.min(distance, ap), bp); // get the smallest number of them - - if (distance > small && small == ap) { - distance = small; - p0fin = a; - highwayfin = highway; - n1Fin = n; - n2Fin = n1; - aFin = true; - bFin = false; - } - - if (distance > small && small == bp) { - distance = small; - p0fin = b; - highwayfin = highway; - n1Fin = n; - n2Fin = n1; - bFin = true; - aFin = false; - } - - if (small == bp && small == ap) { - // TODO: Specify the error! - logger.error("ERROR!"); - } - } - } - } - - // check if a or b are reusable or create new node - OsmGridNode n; - if (aFin) { - n = n1Fin; - } else if (bFin) { - n = n2Fin; - } else { - LatLon latLon = new LatLon(p0fin.y(), p0fin.x()); - n = - new OsmGridNode( - UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE, - new Tags(), - latLon); // unique id necessary - } - - // calc building power consumption - double geoArea = GeoUtils.calculateBuildingArea(building); - Quantity area = GeoUtils.calcGeo2qmNew(geoArea, GEO2QM_CORRECTION); - Quantity load = OsmoGridUtils.calcPower(area, powerDensity); - - // check if highway has already a perp - if (hasPerp.contains(highwayfin)) { // highway has already a perp node - - // add node to graph or modify node if existent - if (!fullGraph.addVertex(n)) { - long id = n.getId(); - OsmGridNode tempNode = - fullGraph.vertexSet().stream() - .filter(node -> node.getId() == id) - .findFirst() - .orElseThrow(); - tempNode.setHouseConnectionPoint(building.getCenter()); - tempNode.setSubStation(isSubstation); - if (tempNode.getLoad() != null) { - tempNode.setLoad(tempNode.getLoad().add(load)); - } else { - tempNode.setLoad(load); - } - } else { - n.setHouseConnectionPoint(building.getCenter()); - n.setLoad(load); - n.setSubStation(isSubstation); - } - - // get the nodes that are on specific highway - Set nodes = highwayPerps.get(highwayfin); - - // extract nodes that are connected to node under investigation but are not on the - // specific highway - for (OsmGridNode edn : fullGraph.vertexSet()) { - if (!fullGraph.getAllEdges(n, edn).isEmpty()) { - nodes.add(edn); - } - } - - // check if vertex/node is already part of the fullGraph - // --> it is either a perp node or a highway node - if (fullGraph.edgesOf(n).isEmpty()) { - // vertex/node is no perp node of highway yet - // --> node/vertex is a new created perpNode or an existing node on highway without - // perpnode yet - double d1 = 1000; - double d2 = 1000; - OsmGridNode nd1 = n1Fin; - OsmGridNode nd2 = n2Fin; - - // iterator through all nodes on highway and near highway to find the nearest ones - // idea: 1. criteria: part of the straight - // 2. criteria: smallest distance - - for (OsmGridNode node : nodes) { - Quantity d = - GeoUtils.calcHaversine( - n.getLatlon().getLat(), - n.getLatlon().getLon(), - node.getLatlon().getLat(), - node.getLatlon().getLon()); - - if (d.getValue().doubleValue() < d1 - && GeoUtils.isBetween(node, nd2, n) - && !(node.equals(nd2))) { - d1 = d.getValue().doubleValue(); - nd1 = node; - } - - if (d.getValue().doubleValue() < d2 - && GeoUtils.isBetween(node, nd1, n) - && !(node.equals(nd1))) { - d2 = d.getValue().doubleValue(); - nd2 = node; - } - } - - fullGraph.removeEdge(nd1, nd2); - - // add new edges - if (!nd1.equals(n)) { - fullGraph.addEdge(nd1, n); - } - if (!nd2.equals(n)) { - fullGraph.addEdge(n, nd2); - } - } - - } else { // highway has no perp node yet - - // remove old connection between n1 and n2 - fullGraph.removeEdge(n1Fin, n2Fin); - - // p0fin node is new vertex - - // add node to graph or modify node if existent - if (!fullGraph.addVertex(n)) { - long id = n.getId(); - OsmGridNode tempNode = - fullGraph.vertexSet().stream() - .filter(node -> node.getId() == id) - .findFirst() - .orElseThrow(); - tempNode.setHouseConnectionPoint(building.getCenter()); - tempNode.setSubStation(isSubstation); - if (tempNode.getLoad() != null) { - tempNode.setLoad(tempNode.getLoad().add(load)); - } else { - tempNode.setLoad(load); - } - } else { - n.setHouseConnectionPoint(building.getCenter()); - n.setLoad(load); - n.setSubStation(isSubstation); - } - - // connect new vertex with new points - if (aFin || bFin) { // node is a or b - if (aFin) { - fullGraph.addEdge(n, n2Fin); - } - if (bFin) { - fullGraph.addEdge(n1Fin, n); - } - } else { // node is between a and b - fullGraph.addEdge(n1Fin, n); - fullGraph.addEdge(n, n2Fin); - } - } - - // add highwayfin to hasPerp because it has at least one - hasPerp.add(highwayfin); - - if (highwayPerps.containsKey(highwayfin)) { - highwayPerps.get(highwayfin).add(n); - highwayPerps.get(highwayfin).add(n1Fin); - highwayPerps.get(highwayfin).add(n2Fin); - } else { - Set nodes = new HashSet<>(); - nodes.add(n); - nodes.add(n1Fin); - nodes.add(n2Fin); - nodes.addAll(OsmoGridUtils.getOsmoGridNodeList(highwayfin.getNodes())); - highwayPerps.put(highwayfin, nodes); - } - } - } - } - - /** - * Calculates the perpendicular point on the street for each building using orthogonal projection. - */ - @SuppressWarnings("unused") - private void calcPerpendicularOrthogonalProjection( - ComparableQuantity powerDensity) { - - List highways = osmDataProvider.getHighways(); - List buildings = osmDataProvider.getBuildings(); - - logger.info("Calculating Perpendiculars..."); - long tStart = System.currentTimeMillis(); - - // add highways that already has been visited and have a Perp here - Set hasPerp = new HashSet<>(); - Map> highwayPerps = new HashMap<>(); - - // TODO: restrict search for highways to highways near the house to speed up calculations - for (Way building : buildings) { - boolean isSubstation = osmDataProvider.getRealSubstations().contains(building); - - Vector2D p = new Vector2D(building.getCenter().getLon(), building.getCenter().getLat()); - - // now we have to check if the building center point is inside a residential area, - // if yes go on, if not go next - if (GeoUtils.isInsideLanduse(building.getCenter(), osmDataProvider.getLandUses())) { - Vector2D p0Fin = new Vector2D(); - Way highwayFin = new Way(); - OsmGridNode n1Fin = new OsmGridNode(); - OsmGridNode n2Fin = new OsmGridNode(); - boolean aFin = false; - boolean bFin = false; - double distance = 1000; - - for (Way highway : highways) { - - for (int i = 1; i < highway.getNodes().size(); i++) { - - OsmGridNode n = new OsmGridNode(highway.getNodes().get(i - 1)); - OsmGridNode n1 = new OsmGridNode(highway.getNodes().get(i)); - - Vector2D a = new Vector2D(n.getLatlon().getLon(), n.getLatlon().getLat()); - Vector2D b = new Vector2D(n1.getLatlon().getLon(), n1.getLatlon().getLat()); - - Vector2D u = - new Vector2D( - n1.getLatlon().getLon() - n.getLatlon().getLon(), - n1.getLatlon().getLat() - n.getLatlon().getLat()); - - // intermediate steps to calculate orthogonal projection direction vector - double t = (p.minus(a)).dot(u); // x - r0 * u - double t1 = u.dot(u); // u*u - double t2 = t / t1; // [(x-r0)*u] / [u*u] - - Vector2D pd = - a.plus((u.times(t2)).minus(p)); // resulting orthogonal projection direction - // vector r0 + [(x-r0)*u] / [u*u] - x - Vector2D p0 = p.plus(pd); // resulting orthogonal projection point on way - - double s1 = (p0.x() - a.x()) / u.x(); - double s2 = (p0.y() - a.y()) / u.y(); - - // round them because only the first few numbers are interesting - s1 = Math.round(s1 * 100000000.0) / 100000000.0; - s2 = Math.round(s2 * 100000000.0) / 100000000.0; - - if (s1 == s2 && s1 > 0 && s1 < 1) { // lambda a to b is always 1 because of u = a - b - - // calculate length of orthogonal vector - double l = Math.sqrt(Math.pow(pd.x(), 2) + Math.pow(pd.y(), 2)); - - // get the minimal distance - if (distance > l) { - distance = l; - p0Fin = p0; - highwayFin = highway; - n1Fin = n; - n2Fin = n1; - bFin = false; - aFin = false; - } - } - - // check if distance between corners a & b is even smaller than current distance - // calculate distance between building center and corners a & b - double ap = Math.sqrt(Math.pow(a.minus(p).x(), 2) + Math.pow(a.minus(p).y(), 2)); - double bp = Math.sqrt(Math.pow(b.minus(p).x(), 2) + Math.pow(b.minus(p).y(), 2)); - - double small = Math.min(Math.min(distance, ap), bp); // get the smallest number of them - - if (distance > small && small == ap) { - distance = small; - p0Fin = a; - highwayFin = highway; - n1Fin = n; - n2Fin = n1; - aFin = true; - bFin = false; - } - - if (distance > small && small == bp) { - distance = small; - p0Fin = b; - highwayFin = highway; - n1Fin = n; - n2Fin = n1; - bFin = true; - aFin = false; - } - - if (small == bp && small == ap) { - // TODO: Specify error - logger.error("ERROR!"); - } - } - } - - // create new Node - OsmGridNode n; - if (aFin) { - n = n1Fin; - } else if (bFin) { - n = n2Fin; - } else { - LatLon latLon = new LatLon(p0Fin.y(), p0Fin.x()); - n = - new OsmGridNode( - UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE, - new Tags(), - latLon); // unique id necessary - } - - // calc building power consumption - double geoArea = GeoUtils.calculateBuildingArea(building); - Quantity area = GeoUtils.calcGeo2qmNew(geoArea, GEO2QM_CORRECTION); - Quantity load = OsmoGridUtils.calcPower(area, powerDensity); - - n.setHouseConnectionPoint(building.getCenter()); - n.setLoad(load); - n.setSubStation(isSubstation); - - // check if highway has already a perp - if (hasPerp.contains(highwayFin)) { // highway has already a perp node - - // add node to graph or modify node if existent - if (!fullGraph.addVertex(n)) { - long id = n.getId(); - OsmGridNode tempNode = - fullGraph.vertexSet().stream() - .filter(node -> node.getId() == id) - .findFirst() - .orElseThrow(); - tempNode.setHouseConnectionPoint(building.getCenter()); - tempNode.setSubStation(isSubstation); - if (tempNode.getLoad() != null) { - tempNode.setLoad(tempNode.getLoad().add(load)); - } else { - tempNode.setLoad(load); - } - } - - // get the nodes that are on specific highway - Set nodes = highwayPerps.get(highwayFin); - - // extract nodes that are connected to node under investigation but are not on the - // specific highway - for (OsmGridNode edn : fullGraph.vertexSet()) { - if (!fullGraph.getAllEdges(n, edn).isEmpty()) { - nodes.add(edn); - } - } - - // check if node is already part of the fullGraph --> it is either a perp node or a - // highway node - if (fullGraph.edgesOf(n).isEmpty()) { - // vertex/node is no perp node of highway yet --> node/vertex is a new created perpNode - // or - // an existing node on highway without perpNode yet - double d1 = 1000; - double d2 = 1000; - OsmGridNode nd1 = n1Fin; - OsmGridNode nd2 = n2Fin; - // iterator through all nodes on highway and near highway to find the nearest ones - // idea: 1. criteria: part of the straigt - // 2. criteria: smallest distance - Iterator nodesIterator = nodes.iterator(); - int nodesSize = nodes.size(); - double nodesCounter = 0; - while (nodesIterator.hasNext()) { - OsmGridNode nx = nodesIterator.next(); - Quantity d = - GeoUtils.calcHaversine( - n.getLatlon().getLat(), - n.getLatlon().getLon(), - nx.getLatlon().getLat(), - nx.getLatlon().getLon()); - - if (d.getValue().doubleValue() < d1 - && GeoUtils.isBetween(nx, nd2, n) - && !(nx.equals(nd2))) { - d1 = d.getValue().doubleValue(); - nd1 = nx; - } - - if (d.getValue().doubleValue() < d2 - && GeoUtils.isBetween(nx, nd1, n) - && !(nx.equals(nd1))) { - d2 = d.getValue().doubleValue(); - nd2 = nx; - } - } - - fullGraph.removeEdge(nd1, nd2); - // add new edges - fullGraph.addEdge(nd1, n); - fullGraph.addEdge(n, nd2); - } - - } else { // highway has no perp node yet - // remove old connection between n1 and n2 - fullGraph.removeEdge(n1Fin, n2Fin); - - // p0Fin node is new vertex - // add node to graph or modify node if existent - if (!fullGraph.addVertex(n)) { - long id = n.getId(); - OsmGridNode tempNode = - fullGraph.vertexSet().stream() - .filter(node -> node.getId() == id) - .findFirst() - .orElseThrow(); - tempNode.setHouseConnectionPoint(building.getCenter()); - tempNode.setSubStation(isSubstation); - if (tempNode.getLoad() != null) { - tempNode.setLoad(tempNode.getLoad().add(load)); - } else { - tempNode.setLoad(load); - } - } - - // connect new vertex with new points - if (aFin || bFin) { // node is a or b - if (aFin) { - fullGraph.addEdge(n, n2Fin); - } - if (bFin) { - fullGraph.addEdge(n1Fin, n); - } - } else { // node is between a and b - fullGraph.addEdge(n1Fin, n); - fullGraph.addEdge(n, n2Fin); - } - } - - // add highwayFin to hasPerp because it has at least one - hasPerp.add(highwayFin); - - if (highwayPerps.containsKey(highwayFin)) { - highwayPerps.get(highwayFin).add(n); - highwayPerps.get(highwayFin).add(n1Fin); - highwayPerps.get(highwayFin).add(n2Fin); - } else { - Set nodes = new HashSet<>(); - nodes.add(n); - nodes.add(n1Fin); - nodes.add(n2Fin); - nodes.addAll(OsmoGridUtils.getOsmoGridNodeList(highwayFin.getNodes())); - highwayPerps.put(highwayFin, nodes); - } - } - } - - long tEnd = System.currentTimeMillis(); - long tDelta = tEnd - tStart; - double elapsedSeconds = tDelta / 1000.0; - logger.debug("Perpendiculars calculation took " + elapsedSeconds + "seconds."); - } - - /** - * Refreshes all {@link DistanceWeightedOsmEdge}s. This is necessary after {@link OsmGridNode}s - * are modified, because the modification of {@link OsmGridNode}s is not communicated to the - * {@link DistanceWeightedOsmEdge}s. - */ - private OsmGraph refreshGraph() { - - OsmGraph refreshedGraph = new OsmGraph(); - fullGraph.vertexSet().forEach(refreshedGraph::addVertex); - - // iterate through all edges, get the edges source and target node from the graph, remove the - // old edge and add - // the edge again with the correct nodes - for (DistanceWeightedOsmEdge edge : fullGraph.edgeSet()) { - OsmGridNode source = - fullGraph.vertexSet().stream() - .filter(node -> node.getId() == fullGraph.getEdgeSource(edge).getId()) - .findFirst() - .orElse(null); - OsmGridNode target = - fullGraph.vertexSet().stream() - .filter(node -> node.getId() == fullGraph.getEdgeTarget(edge).getId()) - .findFirst() - .orElse(null); - ComparableQuantity weight = - Quantities.getQuantity(fullGraph.getEdgeWeight(edge), METRE); - - DistanceWeightedOsmEdge e = new DistanceWeightedOsmEdge(); - refreshedGraph.setEdgeWeight(e, weight); - refreshedGraph.addEdge(source, target, e); - } - return refreshedGraph; - } - - /** Checks for every land use whether it contains at least one building. */ - private void removeEmptyLandUses() { - Set landUsesToBeRemoved = new HashSet<>(); - - // check for the land uses - for (Way landUse : osmDataProvider.getLandUses()) { - boolean anyBuildingInLandUse = false; - for (Way building : osmDataProvider.getBuildings()) { - // check if building center is in land use - if (GeoUtils.rayCasting(new Polygon(landUse), building.getCenter())) { - anyBuildingInLandUse = true; - break; - } - } - if (!anyBuildingInLandUse) { - landUsesToBeRemoved.add(landUse); - } - } - - // remove empty land uses - logger.info("Found " + landUsesToBeRemoved.size() + " empty land use(s) that will be deleted."); - osmDataProvider.getLandUses().removeAll(landUsesToBeRemoved); - } - - /** - * Calculates distances for all {@link DistanceWeightedOsmEdge}s and adds them as edge weights. - */ - private void addEdgeWeights() { - for (DistanceWeightedOsmEdge edge : fullGraph.edgeSet()) { - OsmGridNode edgeSource = fullGraph.getEdgeSource(edge); - OsmGridNode edgeTarget = fullGraph.getEdgeTarget(edge); - Quantity distance = - GeoUtils.calcHaversine( - edgeSource.getLatlon().getLat(), - edgeSource.getLatlon().getLon(), - edgeTarget.getLatlon().getLat(), - edgeTarget.getLatlon().getLon()); - fullGraph.setEdgeWeight(edge, distance.getValue().doubleValue()); - } - } - - /** Removes dead ends without a load from the {@link Graph}. */ - private void cleanGraph(Graph graph) { - - boolean graphClean = false; - while (!graphClean) { - List deadEnds = - graph.vertexSet().stream() - .filter(n -> graph.degreeOf(n) < 2 && n.getLoad() == null) - .collect(Collectors.toList()); - if (deadEnds.size() == 0) { - graphClean = true; - } else { - graph.removeAllVertices(deadEnds); - } - } - } - - /** - * Builds convex hulls around the land uses to also consider {@link OsmGridNode}s that are nearby - * the land uses. - * - * @return A list of {@link Polygon}s representing the convex hulls. - */ - private List buildConvexHulls() throws GeoPreparationException { - - List landUses = osmDataProvider.getLandUses(); - List convexLandUses = new LinkedList<>(); - - // TODO: if the method buildConvexHull fails, we could retry with another precision value - // TODO: adjust exception handling - - if (osmogridConfig.grid.separateClustersByLandUses) { - // separate clusters by land uses: true - for (Way landUse : landUses) { - Set points = new HashSet<>(); - for (Node node : landUse.getNodes()) { - points.add(GeoUtils.latlonToPoint(node.getLatlon())); - } - Polygon convexLandUse; - - try { - convexLandUse = - GeoUtils.buildConvexHull( - OsmoGridUtils.toJavaAwtPoints(points), 5, GeoUtils.ConvexHullAlgorithm.GRAHAM); - convexLandUses.add(convexLandUse); - } catch (GeoPreparationException e) { - // only throw the exception if the convexLandUses is empty and the current land use was - // the last one - if (convexLandUses.isEmpty() && landUses.indexOf(landUse) == landUses.size() - 1) { - throw e; - } else { - logger.warn( - "Could not build the convex land use for land use " + landUses.indexOf(landUse)); - } - } - } - } else { - // separate clusters by land uses: false - Set points = new HashSet<>(); - for (Way landUse : landUses) { - for (Node node : landUse.getNodes()) { - points.add(GeoUtils.latlonToPoint(node.getLatlon())); - } - } - Polygon convexLandUse; - try { - convexLandUse = - GeoUtils.buildConvexHull( - OsmoGridUtils.toJavaAwtPoints(points), 5, GeoUtils.ConvexHullAlgorithm.GRAHAM); - convexLandUses.add(convexLandUse); - } catch (GeoPreparationException e) { - logger.error("Could not build convex hull for landuse", e); - System.exit(-1); - } - } - return convexLandUses; - } - - /** - * Collects and separates all nodes that are inside one of the {@link Polygon}s. - * - * @param convexLandUses List of {@link Polygon}s (has to contain at least one element). - * @return All nodes that have to be clustered separated by {@link Polygon}s. - */ - private Set> collectClusterNodes(List convexLandUses) { - - // Map to check whether a node has already been assigned to a cluster set - Map addedNodes = new HashMap<>(); - fullGraph.vertexSet().forEach(node -> addedNodes.put(node, false)); - - Set> clusterSets = new HashSet<>(); - for (Polygon convexLandUse : convexLandUses) { - Set clusterNodes = new HashSet<>(); - for (OsmGridNode node : fullGraph.vertexSet()) { - if (!addedNodes.get(node)) { - if (node.getHouseConnectionPoint() != null) { - if (GeoUtils.rayCasting(convexLandUse, node.getHouseConnectionPoint())) { - clusterNodes.add(node); - addedNodes.put(node, true); - } else if (GeoUtils.rayCasting(convexLandUse, node.getCenter())) { - clusterNodes.add(node); - addedNodes.put(node, true); - } - } else if (GeoUtils.rayCasting(convexLandUse, node.getCenter())) { - clusterNodes.add(node); - addedNodes.put(node, true); - } - } - } - clusterSets.add(clusterNodes); - } - - // each cluster set has to be fully connected (if not, split into separate cluster sets) - List> unconnectedParts = new LinkedList<>(); - List> setsToRemove = new LinkedList<>(); - double minClusterSize = osmogridConfig.grid.ignoreClustersSmallerThan; - int ignoredParts = 0; - for (Set clusterSet : clusterSets) { - AsSubgraph tempSubgraph = - new AsSubgraph<>(fullGraph, new HashSet<>(clusterSet)); - ConnectivityInspector conIn = - new ConnectivityInspector<>(tempSubgraph); - if (!conIn.isConnected()) { - List> connectedSets = conIn.connectedSets(); - for (Set connectedSet : connectedSets) { - // add up load - Quantity loadSum = Quantities.getQuantity(0.0, KILOWATT); - for (OsmGridNode node : connectedSet) { - if (node.getLoad() != null) { - loadSum = loadSum.add(node.getLoad()); - if (loadSum.getValue().doubleValue() >= minClusterSize) { - break; - } - } - } - if (loadSum.getValue().doubleValue() < minClusterSize) { - // delete connected set - ignoredParts++; - } else { - // separate connected set - unconnectedParts.add(connectedSet); - } - } - setsToRemove.add(clusterSet); - } - } - logger.info( - "Found " - + ignoredParts - + " unconnected part(s) that is/are too small and will be left out"); - clusterSets.removeAll(setsToRemove); - clusterSets.addAll(unconnectedParts); - - return clusterSets; - } - - /** Creates clusters based on the k-medoids algorithm. */ - private List> createClusterKMedoids(List convexLandUses) { - - Quantity loadSubstation = - Quantities.getQuantity(osmogridConfig.grid.loadSubstation, KILOVOLTAMPERE); - - // collect cluster nodes (all nodes inside the land use/convex hull) - Set> clusterSets = collectClusterNodes(convexLandUses); - - // calculate the number of required clusters - Map, Quantity> landUseLoadMap = new LinkedHashMap<>(); - Map, Integer> numberOfClustersMap = new HashMap<>(); - for (Set clusterSet : clusterSets) { - // sum of load in the current grid area - Quantity loadSum = Quantities.getQuantity(0.0, KILOWATT); - for (OsmGridNode node : clusterSet) { - if (node.getLoad() != null) { - loadSum = loadSum.add(node.getLoad()); - } - } - int numberOfClusters = - QuantityUtils.ceil(loadSum.divide(loadSubstation).asType(Dimensionless.class)) - .getValue() - .intValue(); - - numberOfClustersMap.put(clusterSet, numberOfClusters); - landUseLoadMap.put(clusterSet, loadSum); - - logger.info( - "Overall load of cluster set is: " - + loadSum - + ".\n\t\tThe maximum load allowed is: " - + loadSubstation - + ".\n\t\tThe number of necessary clusters is: " - + numberOfClusters); - } - - // k-medoids algorithm for each set of nodes - List> clusters = new LinkedList<>(); - for (Set clusterSet : clusterSets) { - - // get number of required clusters - int numberOfClusters = numberOfClustersMap.get(clusterSet); - - AbstractMap.SimpleEntry< - Graph, Map>> - simplifiedSubgraphMap = null; - - if (numberOfClusters > 1) { - AsSubgraph clusterSubgraph = - new AsSubgraph<>(fullGraph, new HashSet<>(clusterSet)); - - cleanGraph(clusterSubgraph); - - simplifiedSubgraphMap = simplifyGraph(clusterSubgraph); - Graph simplifiedSubgraph = - simplifiedSubgraphMap.getKey(); - - ShortestPathAlgorithm shortestPaths = - new JohnsonShortestPaths<>(simplifiedSubgraph); - - // start k-medoids - KMedoidsSameSize kMedoids = - new KMedoidsSameSize( - shortestPaths, - simplifiedSubgraph, - numberOfClusters, - landUseLoadMap.get(clusterSet).divide(numberOfClusters).getValue().doubleValue() - * 1.1, - true, - 500); - try { - clusters.addAll(kMedoids.run()); - } catch (EmptyClusterException e) { - logger.error("Detected at least one empty cluster three times in a row. Abort!", e); - System.exit(-1); - } - } else { - // if only one cluster is needed for this cluster set, we only have to set the cluster - for (OsmGridNode node : clusterSet) { - node.setCluster(0); - } - clusterSet.stream() - .filter(node -> node.getLoad() != null) - .findAny() - .orElseThrow() - .setSubStation(true); - clusters.add(clusterSet); - } - - // rebuild simplified graph - if (simplifiedSubgraphMap != null) { - while (!simplifiedSubgraphMap.getValue().isEmpty()) { - Set nodeIterator = - clusterSet.stream() - .filter(node -> node.getCluster() >= 0) - .collect(Collectors.toSet()); - for (OsmGridNode node : nodeIterator) { - // if the node represents other nodes in the simplified graph, the simplified nodes have - // to be assigned to the same cluster - if (simplifiedSubgraphMap.getValue().containsKey(node)) { - for (OsmGridNode simplifiedNode : simplifiedSubgraphMap.getValue().get(node)) { - // the previous added load has to be subtracted again - if (node.getLoad() != null) { - if (simplifiedNode.getLoad() != null) { - node.setLoad(node.getLoad().subtract(simplifiedNode.getLoad())); - } - if (node.getLoad().getValue().intValue() == 0) { - node.setLoad(null); - } - } - simplifiedNode.setCluster(node.getCluster()); - for (Set cluster : clusters) { - if (cluster.contains(node)) { - cluster.add(simplifiedNode); - } - } - } - simplifiedSubgraphMap.getValue().remove(node); - } - } - } - } - } - // set a unique cluster id for each cluster - for (Set cluster : clusters) { - for (OsmGridNode node : cluster) { - node.setCluster(clusters.indexOf(cluster)); - } - } - return clusters; - } - - /** - * Recursive helper method for graph simplification. Has to be called at a dead end. Walks - * recursively to the next intersection. - * - * @param graph The {@link Graph} that is simplified during the call of this method. - * @param deadEnd The dead end node where the recursion starts. - * @param lastNode The last visited {@link OsmGridNode}. Used for determining the next {@link - * OsmGridNode} to examine. - * @param visitedNodes A list with all {@link OsmGridNode}s visited. - * @param loadSum The added up load from all {@link OsmGridNode}s visited until now. - * @return A list with all visited {@link OsmGridNode}s from the dead end to the intersection. - */ - private List walkDeadEnd( - Graph graph, - OsmGridNode deadEnd, - OsmGridNode lastNode, - List visitedNodes, - Quantity loadSum) { - if (loadSum == null) { - loadSum = Quantities.getQuantity(0.0, KILOWATT); - } - - // since the passed node should at most have two neighbor nodes, - // the one that not equals the last node is the next node - OsmGridNode neighborNode = - Graphs.neighborSetOf(graph, deadEnd).stream() - .filter(node -> node != lastNode) - .findFirst() - .orElseThrow(); - - if (graph.degreeOf(neighborNode) == 2) { - // test whether the added up load would fit in the maximum transformer load - if (neighborNode.getLoad() != null) { - loadSum = loadSum.add(neighborNode.getLoad()); - } - visitedNodes.add(0, deadEnd); - visitedNodes = walkDeadEnd(graph, neighborNode, deadEnd, visitedNodes, loadSum); - } else { - // if the degree of the node unequals 2, we either reached an intersection or another dead end - // (unlikely) - // -> add up load, add neighbor node to visitedNodes and complete recursive method call - visitedNodes.add(0, deadEnd); - if (neighborNode.getLoad() != null) { - loadSum = loadSum.add(neighborNode.getLoad()); - } - neighborNode.setLoad(loadSum); - visitedNodes.add(0, neighborNode); - } - return visitedNodes; - } - - /** - * Simplifies a {@link Graph} by pooling dead ends and cycles (like turning cycles) to one - * representing node each. - * - * @param graph The {@link Graph} to simplify. - * @return The simplified {@link Graph} mapped with a {@link Map}, representing the simplified - * nodes and their representing nodes. - */ - private AbstractMap.SimpleEntry< - Graph, Map>> - simplifyGraph(Graph graph) { - - // defines the maximum transformer load, the load sum of simplified parts must not be greater - // than this value - double maxLoad = osmogridConfig.grid.loadSubstation; - Graph simplifiedGraph = new AsSubgraph<>(graph); - Map> simplifiedNodes = new HashMap<>(); - - // detect dead ends and walk to the next intersection - boolean noDeadEndsLeft = false; - boolean noCyclesLeft = false; - while (!noDeadEndsLeft && !noCyclesLeft) { - // get all dead ends - Set deadEnds = - simplifiedGraph.vertexSet().stream() - .filter(node -> simplifiedGraph.degreeOf(node) == 1) - .collect(Collectors.toSet()); - - if (!deadEnds.isEmpty()) { - noDeadEndsLeft = false; - noCyclesLeft = false; - for (OsmGridNode deadEnd : deadEnds) { - // since it is possible that a single street (two dead ends) already has been simplified, - // the - // resulting representing node has now a degree of zero and cannot be more simplified - if (simplifiedGraph.degreeOf(deadEnd) == 0) { - continue; - } - - // recursive method call, returns a list containing all nodes from the dead end (first - // index) to the - // next intersection (last index) - List visitedNodes = - walkDeadEnd(simplifiedGraph, deadEnd, null, new LinkedList<>(), deadEnd.getLoad()); - - // now the pair is put in the simplifiedNodesMap - OsmGridNode representingNode = visitedNodes.remove(0); - if (simplifiedNodes.containsKey(representingNode)) { - simplifiedNodes.get(representingNode).addAll(visitedNodes); - } else { - simplifiedNodes.put(representingNode, new HashSet<>(visitedNodes)); - } - - // remove the nodes from the simplified graph - simplifiedGraph.removeAllVertices(visitedNodes); - } - } else { - noDeadEndsLeft = true; - } - - // get all cycles - // we are going to simplify cycles that do have exactly one node whose degree is greater than - // 2 (all other - // nodes degrees are equal 2), the node whose degree is greater than 2 serves as the - // representing node - BiconnectivityInspector inspector = - new BiconnectivityInspector<>(simplifiedGraph); - Set> blocks = - inspector.getBlocks().stream() - .filter(g -> g.vertexSet().size() > 2) - .collect(Collectors.toSet()); - - for (Graph block : blocks) { - int counter = 0; // counts the number of nodes with degree greater than 2 - for (OsmGridNode node : block.vertexSet()) { - if (simplifiedGraph.degreeOf(node) > 2) { - counter++; - } - } - - // only process the block/cycle if the condition above is met - if (counter == 1) { - Quantity loadSum = Quantities.getQuantity(0.0, KILOWATT); - // check whether the added up load would fit the maximum transformer load - for (OsmGridNode node : block.vertexSet()) { - if (node.getLoad() != null) { - loadSum = loadSum.add(node.getLoad()); - } - } - if (loadSum.getValue().doubleValue() < maxLoad) { - // simplify cycle to one node (the one whose degree is greater than 2) - OsmGridNode representingNode = - block.vertexSet().stream() - .filter(node -> simplifiedGraph.degreeOf(node) > 2) - .findFirst() - .orElseThrow(); - - representingNode.setLoad(loadSum); - - // add all vertices except the representing node itself to the simplified nodes - if (simplifiedNodes.containsKey(representingNode)) { - simplifiedNodes.get(representingNode).addAll(block.vertexSet()); - simplifiedNodes.get(representingNode).remove(representingNode); - } else { - simplifiedNodes.put(representingNode, new HashSet<>(block.vertexSet())); - simplifiedNodes.get(representingNode).remove(representingNode); - } - // remove the nodes from the simplified graph - simplifiedGraph.removeAllVertices(simplifiedNodes.get(representingNode)); - - // there may be new dead ends to simplify again - noDeadEndsLeft = false; - noCyclesLeft = false; - } else { - noCyclesLeft = true; - } - } - } - } - return new AbstractMap.SimpleEntry<>(simplifiedGraph, simplifiedNodes); - } - - /** Creates a {@link AsSubgraph} for each cluster. */ - private void createSubgraphs(List> clusters) { - - // create a subgraph for each cluster set - for (Set cluster : clusters) { - AsSubgraph subgraph = - new AsSubgraph<>(fullGraph, cluster); - ConnectivityInspector conIn = - new ConnectivityInspector<>(subgraph); - if (!conIn.isConnected()) { - logger.warn("Cluster " + clusters.indexOf(cluster) + " is not fully connected."); - logger.warn("\t\tSplit into " + conIn.connectedSets().size() + " parts."); - } - - // check if load sum is higher than minimum cluster size from config file - double load = 0.0; - for (OsmGridNode node : cluster) { - if (node.getLoad() != null) { - load += node.getLoad().getValue().doubleValue(); - } - if (load >= osmogridConfig.grid.ignoreClustersSmallerThan) { - break; - } - } - // add subgraph to graph model - if (load >= osmogridConfig.grid.ignoreClustersSmallerThan) { - graphModel.add(subgraph); - } - } - } - - /** Calculates the overall load for each {@link AsSubgraph} in the graph model. */ - private void calculateClusterLoads() { - for (AsSubgraph subgraph : graphModel) { - double loadSum = 0.0; - for (OsmGridNode loadNode : subgraph.vertexSet()) { - if (loadNode.getLoad() != null) { - loadSum += loadNode.getLoad().getValue().doubleValue(); - } - } - logger.info("\t\tLoad sum of cluster " + graphModel.indexOf(subgraph) + ": " + loadSum); - } - } -} diff --git a/src/main/java/de/osmogrid/controller/graph/KMedoidsSameSize.java b/src/main/java/de/osmogrid/controller/graph/KMedoidsSameSize.java deleted file mode 100644 index 461f8372..00000000 --- a/src/main/java/de/osmogrid/controller/graph/KMedoidsSameSize.java +++ /dev/null @@ -1,532 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.controller.graph; - -import de.osmogrid.model.graph.DistanceWeightedOsmEdge; -import de.osmogrid.model.graph.OsmGridNode; -import de.osmogrid.util.OsmDataProvider; -import de.osmogrid.util.exceptions.EmptyClusterException; -import de.osmogrid.util.exceptions.UnconnectedClusterException; -import edu.ie3.util.geo.GeoUtils; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.concurrent.ThreadLocalRandom; -import java.util.stream.Collectors; -import net.morbz.osmonaut.osm.LatLon; -import org.jgrapht.Graph; -import org.jgrapht.alg.connectivity.ConnectivityInspector; -import org.jgrapht.alg.interfaces.ShortestPathAlgorithm; -import org.jgrapht.graph.AsSubgraph; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Performs a K-Medoids based algorithm and tries to generate clusters that have the same load sum. - * Call run() to start the algorithm. - * - * @author Mahr - * @since 17.12.2018 - */ -public class KMedoidsSameSize { - - public static final Logger logger = LoggerFactory.getLogger(KMedoidsSameSize.class); - - private final Graph clusterSubgraph; - private final ShortestPathAlgorithm shortestPaths; - private final List clusterNodes; - private final List> clusters; - private final List medoids; - private final int k; - private final double maxSize; - private final boolean considerRealSubstations; - private final int maxIterations; - - /** - * Creates a new instance of this class. - * - * @param shortestPaths Instance of {@link ShortestPathAlgorithm}. - * @param clusterSubgraph {@link Graph} that contains all nodes that have to be clustered. - * @param k Number of desired clusters. - * @param maxSize Maximum load sum of the clusters. - * @param considerRealSubstations Whether to consider real substation or not. - * @param maxIterations Number of maximum iterations. Set to -1 to iterate until no nodes are - * moved (Not stable yet) - */ - KMedoidsSameSize( - ShortestPathAlgorithm shortestPaths, - Graph clusterSubgraph, - int k, - double maxSize, - boolean considerRealSubstations, - int maxIterations) { - this.shortestPaths = shortestPaths; - this.clusterSubgraph = clusterSubgraph; - this.clusterNodes = new LinkedList<>(clusterSubgraph.vertexSet()); - this.k = k; - this.clusters = new LinkedList<>(); - this.medoids = new LinkedList<>(); - this.maxSize = maxSize; - this.considerRealSubstations = considerRealSubstations; - this.maxIterations = maxIterations; - } - - /** - * Starts the K-Medoids algorithm - * - * @return Clustered nodes grouped by cluster - * @throws EmptyClusterException If a cluster does not contain any nodes. - */ - List> run() throws EmptyClusterException { - - logger.info( - "Starting K-Medoids, " + k + " clusters, highest allowed cluster load: " + this.maxSize); - logger.info("Finding initial medoids and assigning nodes ..."); - initialMedoidSelection(clusterSubgraph.vertexSet(), considerRealSubstations); - try { - initialAssignment(); - } catch (UnconnectedClusterException e) { - logger.warn("At least one cluster is not fully connected", e); - } - - logger.info("Refining results ..."); - int tries = 0; - while (tries < 3) { - try { - refineResults(); - tries = 3; - } catch (EmptyClusterException e) { - tries++; - if (tries == 3) { - throw e; - } - } - } - - logger.info("Updating medoids ..."); - updateMedoids(); - - return clusters; - } - - /** - * Randomly selects initial medoids for k-medoids algorithm. - * - * @param nodes All {@link OsmGridNode}s that have to be clustered. - * @param considerRealSubstations If set to true, considers previous detected real substations - * (from {@link OsmDataProvider}). - */ - private void initialMedoidSelection(Set nodes, boolean considerRealSubstations) { - - LinkedList clusterNodes = new LinkedList<>(nodes); - - // look for real substations and add them to medoids list - if (considerRealSubstations) { - for (OsmGridNode node : nodes) { - if (node.isSubStation()) { - medoids.add(node); - } - } - } - - // find medoids randomly - for (int i = medoids.size(); i < k; i++) { - int random = ThreadLocalRandom.current().nextInt(0, clusterNodes.size()); - medoids.add(i, clusterNodes.get(random)); - } - - // set substation value for each medoid to true - for (OsmGridNode medoid : medoids) { - medoid.setSubStation(true); - } - } - - /** - * Randomly determines initial medoids for k-medoids algorithm (using the k-medoids++ - * initialization) (Does not work properly for all regions). - * - * @param nodes All {@link OsmGridNode}s that have to be clustered. - */ - @SuppressWarnings("unused") - private void initializeKMedoidsPlusPlus(Set nodes) { - - // TODO: fix this method and add consideration of real substations - - LinkedList clusterNodes = new LinkedList<>(nodes); - - // find first medoid randomly - int random = ThreadLocalRandom.current().nextInt(0, clusterNodes.size()); - medoids.add(clusterNodes.get(random)); - - // repeat k-1 times: - for (int i = 1; i < k; i++) { - - Map squaredDistances = new HashMap<>(); - - // for each node calculate the distance to each medoid and save the one to the closest medoid - for (OsmGridNode node : clusterNodes) { - if (!medoids.contains(node)) { - double lowestWeight = Double.MAX_VALUE; - for (OsmGridNode medoid : medoids) { - // calculate distance in graph from node to medoid - double weight = shortestPaths.getPathWeight(medoid, node); - if (weight < lowestWeight) { - lowestWeight = weight; - } - } - squaredDistances.put(Math.pow(lowestWeight, 2.0), node); - } - } - - // sort and cumulate squaredDistances - TreeMap sortedSquaredDistances = new TreeMap<>(squaredDistances); - List osmGridNodes = new LinkedList<>(sortedSquaredDistances.values()); - double[] cumulatedDistances = new double[sortedSquaredDistances.size()]; - - int j = 0; - for (Double distance : sortedSquaredDistances.keySet()) { - if (j == 0) { - cumulatedDistances[j] = distance; - } else { - cumulatedDistances[j] = cumulatedDistances[j - 1] + distance; - } - j++; - } - - double nextMedoid = ThreadLocalRandom.current().nextDouble(0.0, cumulatedDistances[j - 1]); - - // find the least entry in cumulatedDistances that is greater than nextMedoid - for (int l = 0; l < cumulatedDistances.length; l++) { - if (cumulatedDistances[l] > nextMedoid) { - medoids.add(osmGridNodes.get(l)); - break; - } - } - squaredDistances.clear(); - } - - for (OsmGridNode medoid : medoids) { - medoid.setSubStation(true); - } - } - - /** - * Initializes all nodes by assigning them to their closest medoid. - * - * @throws UnconnectedClusterException If a cluster is not fully connected. - */ - private void initialAssignment() throws UnconnectedClusterException { - - // initialize cluster list - for (int i = 0; i < k; i++) { - clusters.add(i, new HashSet<>()); - } - - // get the medoid with the shortest distance and assign to the corresponding cluster - List nodesToRemove = new LinkedList<>(); - for (OsmGridNode node : clusterNodes) { - double shortestDistance = Double.POSITIVE_INFINITY; - int cluster = -1; - for (OsmGridNode medoid : medoids) { - double distance = shortestPaths.getPathWeight(node, medoid); - if (distance < shortestDistance) { - shortestDistance = distance; - cluster = medoids.indexOf(medoid); - } - } - if (cluster < 0) { - logger.error("Node " + node.getId() + " could not be assigned to any cluster"); - nodesToRemove.add(node); - } else { - node.setCluster(cluster); - clusters.get(cluster).add(node); - } - } - clusterNodes.removeAll(nodesToRemove); - - // check for each cluster whether its connected - for (Set cluster : clusters) { - AsSubgraph subgraph = - new AsSubgraph<>(clusterSubgraph, new HashSet<>(cluster)); - ConnectivityInspector connectivityInspector = - new ConnectivityInspector<>(subgraph); - if (connectivityInspector.connectedSets().size() > 1) { - throw new UnconnectedClusterException( - "Cluster " + clusters.indexOf(cluster) + " is not fully connected!"); - } - } - } - - /** - * Tries to optimize the cluster allocation iteratively by moving nodes from clusters with less - * load to clusters with higher load. - * - * @throws EmptyClusterException If a cluster does not contain any nodes. - */ - private void refineResults() throws EmptyClusterException { - // TODO: throw and handle UnconnectedClusterException here too - // - // int iterator = 0; - // - // for (int iterations = 0; maxIterations < 0 || iterations < maxIterations; iterations++) { - // // calculate load map - // Map loadMap = new LinkedHashMap<>(); - // for (Set cluster : clusters) { - // if (cluster.isEmpty()) { - // throw new EmptyClusterException("Detected empty cluster"); - // } - // double loadSum = 0.0; - // for (OsmGridNode loadNode : cluster) { - // if (loadNode.getLoad() != null) { - // loadSum += loadNode.getLoad().getValue().doubleValue(); - // } - // } - // loadMap.put(clusters.indexOf(cluster), loadSum); - // } - // // TODO: think on a way to terminate the algorithm (i.e. standard deviation, all cluster - // // between min/max values) - // - // // check movability for each node to each cluster - // Map movable = new LinkedHashMap<>(clusterNodes.size()); - // List movableNodes = new LinkedList<>(); - // for (OsmGridNode node : clusterNodes) { - // double load = 0.0; - // if (node.getLoad() != null) { - // load = node.getLoad().getValue().doubleValue(); - // } - // Boolean[] movableArray = new Boolean[k]; - // Arrays.fill(movableArray, false); - // for (OsmGridNode neighbor : Graphs.neighborSetOf(clusterSubgraph, node)) { - // if (neighbor.getCluster() != node.getCluster() - // && loadMap.get(node.getCluster()) > loadMap.get(neighbor.getCluster()) + load) { - // movableArray[neighbor.getCluster()] = true; - // if (!movableNodes.contains(node)) { - // movableNodes.add(node); - // } - // } - // } - // movable.put(node, movableArray); - // } - // - // // if a node is moved, the neighbor node becomes invalid - // List invalidNodes = new LinkedList<>(); - // - // // Track if anything has changed - // int active = 0; - // - // for (OsmGridNode node : movableNodes) { - // if (invalidNodes.contains(node)) { - // continue; - // } - // - // int source = node.getCluster(); - // - // for (int i = 0; i < k; i++) { // i indicates the destination cluster - // - // // continue with next i if node is not movable to current cluster - // if (!movable.get(node)[i]) { - // continue; - // } - // - // double sourceLoad = calculateLoad(source); - // double destinationLoad = calculateLoad(i); - // - // if (sourceLoad > destinationLoad) { - // // move node from source to destination - // transfer(source, i, node); - // active++; - // - // // if the node is an intersection we have to check whether the source cluster is - // still - // // connected - // if (clusterSubgraph.degreeOf(node) > 2) { - // // create a temporary subgraph for the source cluster and check the number of - // // connected sets - // AsSubgraph testSubgraph = - // new AsSubgraph<>(clusterSubgraph, new HashSet<>(clusters.get(source))); - // - // ConnectivityInspector - // connectivityInspector = - // new ConnectivityInspector<>(testSubgraph); - // - // if (!connectivityInspector.isConnected()) { - // // not connected: check if one of the new connected sets could be completely - // moved - // // to - // // the destination cluster (check if it would be an advantage too) - // List> connectedSets = connectivityInspector.connectedSets(); - // - // // sort connected sets by size and start we the smallest - // connectedSets.sort(Comparator.comparingInt(Set::size)); - // - // List tempMovedNodes = new LinkedList<>(); - // tempMovedNodes.add(node); - // - // for (Set connectedSet : connectedSets) { - // - // // calculate the load sum for the connected set - // double loadSum = 0.0; - // for (OsmGridNode n : connectedSet) { - // if (n.getLoad() != null) { - // loadSum += n.getLoad().getValue().doubleValue(); - // } - // } - // // check if the connected set could be completely moved to the destination - // cluster - // // (check if it would be an advantage too) - // if (destinationLoad + loadSum < maxSize - // && destinationLoad + loadSum < sourceLoad) { - // // move the connected set completely to destination - // for (OsmGridNode n : connectedSet) { - // transfer(source, i, n); - // tempMovedNodes.add(n); - // active++; - // } - // // check whether source cluster is reconnected - // testSubgraph = - // new AsSubgraph<>(clusterSubgraph, new - // HashSet<>(clusters.get(source))); - // connectivityInspector = new ConnectivityInspector<>(testSubgraph); - // if (connectivityInspector.isConnected()) { - // break; - // } - // } else { - // // if the cluster is still not connected and moving the unconnected parts - // is not - // // possible, undo all transfers - // for (OsmGridNode tempMovedNode : tempMovedNodes) { - // transfer(i, source, tempMovedNode); - // active--; - // } - // tempMovedNodes.clear(); - // } - // invalidNodes.addAll(tempMovedNodes); - // } - // } - // } - // // set all neighbors of the current node invalid for transfers - // invalidNodes.addAll(Graphs.neighborSetOf(clusterSubgraph, node)); - // } - // // go on with the next node - // break; - // } - // } - // if (active <= 0) { - // break; - // } - // - // // Clear movable node list and invalid node list for next iteration - // invalidNodes.clear(); - // movableNodes.clear(); - // iterator = iterations; - // } - // - // logger.info("Finished K-Medoids after " + (iterator + 1) + " iterations"); - } - - /** - * Calculates the load sum for a cluster. - * - * @param k The cluster for which to calculate the load. - * @return The load sum of the cluster. - */ - private double calculateLoad(int k) { - - double loadSum = 0.0; - for (OsmGridNode node : clusters.get(k)) { - if (node.getLoad() != null) { - loadSum += node.getLoad().getValue().doubleValue(); - } - } - return loadSum; - } - - /** - * Recalculates the medoid for each cluster by calculating a centroid and picking the closest - * cluster node. - */ - private void updateMedoids() { - - for (Set cluster : clusters) { - - int clusterIndex = clusters.indexOf(cluster); - - // calculate the centroid of all nodes in the current cluster - double medoidLat = 0.0; - double medoidLon = 0.0; - - for (OsmGridNode node : cluster) { - medoidLat += node.getLatlon().getLat(); - medoidLon += node.getLatlon().getLon(); - } - - medoidLat = (1.0 / cluster.size()) * medoidLat; - medoidLon = (1.0 / cluster.size()) * medoidLon; - LatLon medoidLatLon = new LatLon(medoidLat, medoidLon); - - // get the closest node in full graph - Map distances = new LinkedHashMap<>(); - - // calculate the distance from each node to the mean - Set loadNodes = - cluster.stream().filter(node -> node.getLoad() != null).collect(Collectors.toSet()); - for (OsmGridNode node : loadNodes) { - double distance = - GeoUtils.calcHaversine( - medoidLatLon.getLat(), - medoidLatLon.getLon(), - node.getLatlon().getLat(), - node.getLatlon().getLon()) - .getValue() - .doubleValue(); - distances.put(distance, node); - } - - // sort by distance and choose the node with the smallest distance - List sortedDistances = - distances.keySet().stream() - .sorted(Comparator.naturalOrder()) - .collect(Collectors.toList()); - - // set isSubstation from old medoid to false - medoids.get(clusterIndex).setSubStation(false); - // replace medoid - medoids.set(clusterIndex, distances.get(sortedDistances.get(0))); - // set isSubstation from new medoid to true - medoids.get(clusterIndex).setSubStation(true); - } - } - - /** - * Moves a node to another cluster. - * - * @param source The cluster the node currently belongs to. - * @param destination The cluster the node has to be moved to. - * @param node The node that has to be moved. - */ - private void transfer(int source, int destination, OsmGridNode node) { - - if (clusters.get(source).contains(node)) { - clusters.get(source).remove(node); - clusters.get(destination).add(node); - node.setCluster(destination); - } else { - logger.error( - "Could not remove node " - + node.getId() - + " from cluster " - + source - + ". That should never happen!"); - } - } -} diff --git a/src/main/java/de/osmogrid/controller/grid/GridController.java b/src/main/java/de/osmogrid/controller/grid/GridController.java deleted file mode 100644 index 99846074..00000000 --- a/src/main/java/de/osmogrid/controller/grid/GridController.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.controller.grid; - -import de.osmogrid.config.OsmogridConfig; -import de.osmogrid.model.graph.DistanceWeightedOsmEdge; -import de.osmogrid.model.graph.OsmGridNode; -import de.osmogrid.util.OsmoGridUtils; -import de.osmogrid.util.enums.TypeSourceFormat; -import edu.ie3.datamodel.exceptions.VoltageLevelException; -import edu.ie3.datamodel.io.naming.FileNamingStrategy; -import edu.ie3.datamodel.io.source.TypeSource; -import edu.ie3.datamodel.io.source.csv.CsvTypeSource; -import edu.ie3.datamodel.models.BdewLoadProfile; -import edu.ie3.datamodel.models.input.NodeInput; -import edu.ie3.datamodel.models.input.connector.LineInput; -import edu.ie3.datamodel.models.input.connector.type.LineTypeInput; -import edu.ie3.datamodel.models.input.container.GraphicElements; -import edu.ie3.datamodel.models.input.container.JointGridContainer; -import edu.ie3.datamodel.models.input.container.RawGridElements; -import edu.ie3.datamodel.models.input.container.SubGridContainer; -import edu.ie3.datamodel.models.input.container.SystemParticipants; -import edu.ie3.datamodel.models.input.system.LoadInput; -import edu.ie3.datamodel.models.input.system.characteristic.CosPhiFixed; -import edu.ie3.datamodel.models.input.system.characteristic.OlmCharacteristicInput; -import edu.ie3.datamodel.models.voltagelevels.CommonVoltageLevel; -import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils; -import edu.ie3.datamodel.utils.GridAndGeoUtils; -import edu.ie3.util.OneToOneMap; -import edu.ie3.util.geo.GeoUtils; -import edu.ie3.util.quantities.PowerSystemUnits; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import javax.measure.quantity.Dimensionless; -import javax.measure.quantity.ElectricPotential; -import javax.measure.quantity.Energy; -import javax.measure.quantity.Length; -import javax.measure.quantity.Power; -import org.jetbrains.annotations.NotNull; -import org.jgrapht.graph.AsSubgraph; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import tech.units.indriya.ComparableQuantity; -import tech.units.indriya.quantity.Quantities; -import tech.units.indriya.unit.Units; - -/** - * Controls all operations on the grid. - * - * @author Mahr - * @since 17.12.2018 - */ -public class GridController { - - public static final Logger logger = LoggerFactory.getLogger(GridController.class); - - private static final Map> nodeCodeMaps = new HashMap<>(); - private OsmogridConfig osmogridConfig; - private LineTypeInput lineType; - - /** Initializes the GridController. */ - public void initialize(OsmogridConfig osmogridConfig) { - this.osmogridConfig = osmogridConfig; - - loadTypes(); - } - - private JointGridContainer buildGridContainer( - Set nodes, Set lines, Set loads) { - RawGridElements rawGridElements = - new RawGridElements( - nodes, lines, new HashSet<>(), new HashSet<>(), new HashSet<>(), new HashSet<>()); - - SystemParticipants systemParticipants = - new SystemParticipants( - new HashSet<>(), - new HashSet<>(), - new HashSet<>(), - new HashSet<>(), - new HashSet<>(), - new HashSet<>(), - loads, - new HashSet<>(), - new HashSet<>(), - new HashSet<>()); - - GraphicElements graphicElements = new GraphicElements(new HashSet<>(), new HashSet<>()); - - return new JointGridContainer( - osmogridConfig.runtime.name, rawGridElements, systemParticipants, graphicElements); - } - - /** - * Calls the methods that are necessary for building the complete electrical grid out of a - * GraphModel. - * - * @param graphModel GraphModel that was generated in the GraphController. - * @return Returns the complete electrical grid as a List of GridInputModels (one for each - * subnet). - */ - public JointGridContainer generateGrid( - List> graphModel) { - - JointGridContainer gridModel = buildGrid(graphModel); - - // build node code maps and admittance matrices for each sub net - for (SubGridContainer subGrid : gridModel.getSubGridTopologyGraph().vertexSet()) { - OneToOneMap nodeCodeMap = - OsmoGridUtils.buildNodeCodeMap(subGrid.getRawGrid().getNodes()); - nodeCodeMaps.put(subGrid.getSubnet(), nodeCodeMap); - } - return gridModel; - } - - /** Reads line types from csv files. Transformer types. */ - private void loadTypes() { - TypeSource typeSource; - TypeSourceFormat sourceFormat = TypeSourceFormat.valueOf(osmogridConfig.io.typeSourceFormat); - - if (osmogridConfig.io.readTypes) { - if (sourceFormat == TypeSourceFormat.CSV) { - typeSource = new CsvTypeSource(";", "", new FileNamingStrategy()); - - lineType = - typeSource.getLineTypes().stream() - .filter(lineTypeInput -> lineTypeInput.getId().equals(osmogridConfig.grid.lineType)) - .findAny() - .orElse(builtDefaultLineType()); - } else { - logger.error("Invalid TypeSource in config file. Use standard LineTypeInput"); - lineType = builtDefaultLineType(); - } - } else { - logger.info("Use default line type."); - lineType = builtDefaultLineType(); - } - } - - private static LineTypeInput builtDefaultLineType() { - return new LineTypeInput( - UUID.randomUUID(), - "Default generated line type", - Quantities.getQuantity(0.0, PowerSystemUnits.SIEMENS_PER_KILOMETRE), - Quantities.getQuantity(0.07, PowerSystemUnits.SIEMENS_PER_KILOMETRE), - Quantities.getQuantity(0.32, PowerSystemUnits.OHM_PER_KILOMETRE), - Quantities.getQuantity(0.07, PowerSystemUnits.OHM_PER_KILOMETRE), - Quantities.getQuantity(235.0, Units.AMPERE), - Quantities.getQuantity(0.4, PowerSystemUnits.KILOVOLT)); - } - - /** - * Generates a GridInputModel for each sub graph in graphModel - * - * @param graphModel GraphModel from which the GridInputModels shall be generated - */ - private JointGridContainer buildGrid( - @NotNull List> graphModel) { - - ComparableQuantity vRated = - Quantities.getQuantity(osmogridConfig.grid.ratedVoltage, PowerSystemUnits.KILOVOLT); - ComparableQuantity vTarget = Quantities.getQuantity(1d, PowerSystemUnits.PU); - - CommonVoltageLevel voltLvl; - try { - voltLvl = GermanVoltageLevelUtils.parse(osmogridConfig.grid.voltageLevel, vRated); - } catch (VoltageLevelException e) { - voltLvl = GermanVoltageLevelUtils.LV; - logger.error("Could not set voltage level from config file. Continue with {}", voltLvl, e); - } - - // set id counters - int nodeIdCounter = 1; - int lineIdCounter = 1; - int loadIdCounter = 1; - int subNetCounter = 1; - - Set nodeInputs = new HashSet<>(); - Set loadInputs = new HashSet<>(); - Set lineInputs = new HashSet<>(); - - for (AsSubgraph subgraph : graphModel) { - Map geoGridNodesMap = new HashMap<>(); - - for (OsmGridNode osmGridNode : subgraph.vertexSet()) { - if (osmGridNode.getLoad() != null) { - NodeInput nodeInput = - new NodeInput( - UUID.randomUUID(), - "Node " + nodeIdCounter++, - vTarget, - osmGridNode.isSubStation(), - GeoUtils.latlonToPoint(osmGridNode.getLatlon()), - voltLvl, - subNetCounter); - - geoGridNodesMap.put(osmGridNode, nodeInput); - nodeInputs.add(nodeInput); - - if (osmogridConfig.grid.considerHouseConnectionPoints) { - // If parameter considerHouseConnectionPoints is set to true, create another NodeInput - // at the nodes house connection point. - NodeInput houseConnectionPoint = - new NodeInput( - UUID.randomUUID(), - "Node " + nodeIdCounter++, - vTarget, - false, - GeoUtils.latlonToPoint(osmGridNode.getHouseConnectionPoint()), - voltLvl, - subNetCounter); - - // The load will then be set to the node that represents the house connection point. - ComparableQuantity eConsAnnual = - Quantities.getQuantity( - osmGridNode.getLoad().toSystemUnit().getValue().doubleValue(), - PowerSystemUnits.KILOWATTHOUR); - - LoadInput loadInput = - new LoadInput( - UUID.randomUUID(), - "Load " + loadIdCounter, - houseConnectionPoint, - CosPhiFixed.CONSTANT_CHARACTERISTIC, - BdewLoadProfile.H0, - false, - eConsAnnual, - (ComparableQuantity) - osmGridNode.getLoad().to(PowerSystemUnits.KILOVOLTAMPERE), - 1d); - - // Create a LineInput between the NodeInputs from the OsmogridNode and the house - // connection point - ComparableQuantity length = - GeoUtils.calcHaversine( - nodeInput.getGeoPosition().getY(), - nodeInput.getGeoPosition().getX(), - houseConnectionPoint.getGeoPosition().getY(), - houseConnectionPoint.getGeoPosition().getX()); - - LineInput lineInput = - new LineInput( - UUID.randomUUID(), - "Line " + lineIdCounter++, - nodeInput, - houseConnectionPoint, - 1, - lineType, - length, - GridAndGeoUtils.buildSafeLineStringBetweenNodes( - nodeInput, houseConnectionPoint), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC); - - lineInputs.add(lineInput); - nodeInputs.add(houseConnectionPoint); - loadInputs.add(loadInput); - - } else { - // If parameter considerHouseConnectionPoints is set to false, solely create the load - // and set it to the NodeInput. - ComparableQuantity eConsAnnual = - Quantities.getQuantity( - osmGridNode.getLoad().toSystemUnit().getValue().doubleValue(), - PowerSystemUnits.KILOWATTHOUR); - - LoadInput loadInput = - new LoadInput( - UUID.randomUUID(), - "Load " + loadIdCounter++, - nodeInput, - CosPhiFixed.CONSTANT_CHARACTERISTIC, - BdewLoadProfile.H0, - false, - eConsAnnual, - (ComparableQuantity) - osmGridNode.getLoad().to(PowerSystemUnits.KILOVOLTAMPERE), - 1d); - loadInputs.add(loadInput); - } - } else if (subgraph.degreeOf(osmGridNode) > 2) { - // If the node is an intersection, create a NodeInput - NodeInput nodeInput = - new NodeInput( - UUID.randomUUID(), - "Node " + nodeIdCounter++, - vTarget, - osmGridNode.isSubStation(), - GeoUtils.latlonToPoint(osmGridNode.getLatlon()), - voltLvl, - subNetCounter); - - geoGridNodesMap.put(osmGridNode, nodeInput); - nodeInputs.add(nodeInput); - } - } - - // Depth-first-search for adding LineInputModels: - LineBuilder lineBuilder = new LineBuilder(lineType); - lineBuilder.initialize(subgraph, geoGridNodesMap, lineIdCounter); - lineBuilder.start(); - - // add all lines from Gridbuilder to list - lineInputs.addAll(lineBuilder.getLineInputModels()); - - // refresh lineIdCounter - lineIdCounter = lineBuilder.getLineIdCounter(); - - subNetCounter++; - } - - // Build and return a JointGridContainer - return buildGridContainer(nodeInputs, lineInputs, loadInputs); - } -} diff --git a/src/main/java/de/osmogrid/controller/grid/LineBuilder.java b/src/main/java/de/osmogrid/controller/grid/LineBuilder.java deleted file mode 100644 index 62ab3bf2..00000000 --- a/src/main/java/de/osmogrid/controller/grid/LineBuilder.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.controller.grid; - -import de.osmogrid.model.graph.DistanceWeightedOsmEdge; -import de.osmogrid.model.graph.OsmGridNode; -import de.osmogrid.util.OsmoGridUtils; -import edu.ie3.datamodel.models.input.NodeInput; -import edu.ie3.datamodel.models.input.connector.LineInput; -import edu.ie3.datamodel.models.input.connector.type.LineTypeInput; -import edu.ie3.util.geo.GeoUtils; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import javax.measure.quantity.Length; -import org.jgrapht.graph.AsSubgraph; -import tech.units.indriya.ComparableQuantity; - -/** - * Provides the methods, based on depth first search, to build the {@link LineInput}s of the - * electrical grid from the graph. A special algorithm is necessary because not all {@link - * OsmGridNode}s from the graph are connected with one {@link LineInput} but only those with a load - * (or intersections). - * - * @author Mahr - * @since 17.12.2018 - */ -public class LineBuilder { - - private AsSubgraph subgraph; - private final LineTypeInput lineTypeInput; - private Map geoGridNodesMap; - private OsmGridNode startNode; - private OsmGridNode endNode; - private List geoNodes; - private Map nodeColorMap; - private OsmGridNode lastVisitedNode; - private int lineIdCounter; - private List lineInputModels; - - protected enum VisitColor { - WHITE, // Vertex has not been visited yet. - GRAY, // Vertex has been visited, but we're not done with all of its edges yet. - BLACK // Vertex has been visited and we're done with all of its edges. - } - - public LineBuilder(LineTypeInput lineTypeInput) { - this.lineTypeInput = lineTypeInput; - } - - public void initialize( - AsSubgraph subgraph, - Map geoGridNodesMap, - int lineIdCounter) { - this.subgraph = subgraph; - this.geoGridNodesMap = geoGridNodesMap; - this.startNode = null; - this.endNode = null; - this.geoNodes = new LinkedList<>(); - this.nodeColorMap = new HashMap<>(); - this.lineIdCounter = lineIdCounter; - this.lineInputModels = new LinkedList<>(); - - // set the visit color for all nodes to white - this.subgraph.vertexSet().forEach(node -> nodeColorMap.put(node, VisitColor.WHITE)); - } - - /** Starts the algorithm by looking for a node with a load. */ - public void start() { - boolean startVertexFound = false; - - for (OsmGridNode node : subgraph.vertexSet()) { - if (!startVertexFound && (node.getLoad() != null || subgraph.degreeOf(node) > 2)) - startVertexFound = true; - if (startVertexFound && nodeColorMap.get(node).equals(VisitColor.WHITE)) visitNode(node); - } - } - - /** - * Recursive method for visiting nodes based on the depth first search algorithm. - * - * @param node Node that has to be visited. - */ - private void visitNode(OsmGridNode node) { - nodeColorMap.remove(node); - nodeColorMap.put(node, VisitColor.GRAY); - - boolean isDeadEnd = false; - - // investigate the current node - if (node.getLoad() != null || subgraph.degreeOf(node) > 2) { - // node has a load or is an intersection - if (startNode == null) { - // startNode not yet set - startNode = node; - geoNodes.add(0, startNode); - } else { - // startNode already set -> line complete, build line - endNode = node; - geoNodes.add(endNode); - buildLineInputModel(); - - // reset values - geoNodes.clear(); - if (subgraph.degreeOf(node) < 2) { - // if a dead end is reached, reset the start node - startNode = null; - isDeadEnd = true; - } else { - // otherwise set the start node to the current node - startNode = node; - geoNodes.add(startNode); - } - } - } else { - // node has neither a load nor is an intersection -> it's only going to be used to display - // lines more detailed - if (subgraph.degreeOf(node) < 2) { - // unless the node is a dead end - geoNodes.clear(); - startNode = null; - isDeadEnd = true; - } else { - // node is not a dead end - geoNodes.add(node); - } - } - - if (!isDeadEnd) { - - // create neighbor list (consider only "forward" nodes) - List neighborNodes = new LinkedList<>(); - for (DistanceWeightedOsmEdge connectedEdge : subgraph.edgesOf(node)) { - if (subgraph.getEdgeSource(connectedEdge).equals(node) - && !subgraph.getEdgeTarget(connectedEdge).equals(lastVisitedNode)) - neighborNodes.add(subgraph.getEdgeTarget(connectedEdge)); - else if (subgraph.getEdgeTarget(connectedEdge).equals(node) - && !subgraph.getEdgeSource(connectedEdge).equals(lastVisitedNode)) - neighborNodes.add(subgraph.getEdgeSource(connectedEdge)); - } - - // investigate the neighbor nodes - for (OsmGridNode neighborNode : neighborNodes) { - // set startNode again if it's null (this could happen if we have reached a dead end or - // closed a circle in the step before) - if (startNode == null && (node.getLoad() != null || subgraph.degreeOf(node) > 2)) { - startNode = node; - geoNodes.clear(); - geoNodes.add(startNode); - } - - if (!nodeColorMap.get(neighborNode).equals(VisitColor.WHITE) - && subgraph.containsEdge(node, neighborNode)) { - // if(subgraph.degreeOf(neighborNode) > 2 && - // nodeColorMap.get(neighborNode).equals(VisitColor.GRAY) && subgraph.containsEdge(node, - // neighborNode)) { - // Node is an intersection and has already been visited but is not finished yet -> finish - // the line - endNode = neighborNode; - geoNodes.add(endNode); - buildLineInputModel(); - - // reset all values - geoNodes.clear(); - startNode = null; - } else if (nodeColorMap.get(neighborNode).equals(VisitColor.WHITE)) { - lastVisitedNode = node; - visitNode(neighborNode); - } - } - } - nodeColorMap.remove(node); - nodeColorMap.put(node, VisitColor.BLACK); - } - - /** Builds the LineInputModel when a line is complete (start and end node set). */ - private void buildLineInputModel() { - if (startNode != null && endNode != null && startNode != endNode) { - ComparableQuantity length = - GeoUtils.calcHaversine( - startNode.getLatlon().getLat(), - startNode.getLatlon().getLon(), - endNode.getLatlon().getLat(), - endNode.getLatlon().getLon()); // TODO: calculate length correctly - LineInput lineInput = - new LineInput( - UUID.randomUUID(), - "Line " + lineIdCounter, - geoGridNodesMap.get(startNode), - geoGridNodesMap.get(endNode), - 1, - lineTypeInput, - length, - OsmoGridUtils.nodesToLineString(geoNodes), - null); - - if (lineInput.getNodeA() != null - && lineInput.getNodeB() != null - && lineInput.getNodeA() != lineInput.getNodeB()) { - lineInputModels.add(lineInput); - lineIdCounter++; - } - } - } - - List getLineInputModels() { - return lineInputModels; - } - - public int getLineIdCounter() { - return lineIdCounter; - } - - public void setLineIdCounter(int lineIdCounter) { - this.lineIdCounter = lineIdCounter; - } -} diff --git a/src/main/java/de/osmogrid/interfaces/MissionControlOsmogrid.java b/src/main/java/de/osmogrid/interfaces/MissionControlOsmogrid.java deleted file mode 100644 index 64cf8b73..00000000 --- a/src/main/java/de/osmogrid/interfaces/MissionControlOsmogrid.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.interfaces; - -/** - * Interface of the MissionControl. - * - * @author hiry - * @version 0.1 - * @since 26.07.2018 - */ -public interface MissionControlOsmogrid { - void startGridGeneration(String configFilePath); -} diff --git a/src/main/java/de/osmogrid/interfaces/OsmogridMainControl.java b/src/main/java/de/osmogrid/interfaces/OsmogridMainControl.java deleted file mode 100644 index cd8f969c..00000000 --- a/src/main/java/de/osmogrid/interfaces/OsmogridMainControl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.interfaces; - -import java.io.File; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Main interface to control an OSMoGrid instance. - * - * @author Mahr - * @version 0.1 - * @since 17.12.2018 - */ -public interface OsmogridMainControl { - - Logger logger = LoggerFactory.getLogger(OsmogridMainControl.class); - - /** - * Builds the configuration class. - * - * @param configFile Indicates which config file to use. - */ - void setup(File configFile); - - /** Starts generating the grid. */ - void start(); - - /** Shuts down OSMoGrid properly. */ - void shutdown(); - - /** Get the current status of the session. */ - void getSessionStatus(); -} diff --git a/src/main/java/de/osmogrid/main/MainController.java b/src/main/java/de/osmogrid/main/MainController.java deleted file mode 100644 index 56a22f40..00000000 --- a/src/main/java/de/osmogrid/main/MainController.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.main; - -import com.typesafe.config.Config; -import com.typesafe.config.ConfigFactory; -import de.osmogrid.config.OsmogridConfig; -import de.osmogrid.controller.SessionController; -import de.osmogrid.interfaces.OsmogridMainControl; -import java.io.File; - -/** - * Controls the main functionality operations. - * - * @author Mahr - * @since 17.12.2018 - */ -public class MainController implements OsmogridMainControl { - - private OsmogridConfig osmogridConfig; - - @Override - public void setup(File configFile) { - // Build the config class - logger.info("Building the config class ..."); - Config tsConfig = ConfigFactory.parseFile(configFile); - osmogridConfig = new OsmogridConfig(tsConfig); - } - - @Override - public void start() { - // start new session - logger.info("Start new session \"{}\"", osmogridConfig.runtime.name); - SessionController sessionController = new SessionController(); - sessionController.initialize(osmogridConfig); - } - - @Override - public void shutdown() { - // TODO: implement - } - - @Override - public void getSessionStatus() { - // TODO: implement - } - - /** Prints an opening message. */ - private static void printOpener() { - System.out.print(" .-:+s::.` \n"); - System.out.print(" ./+/-./s`.:++- \n"); - System.out.print(" /o. :s `:o. \n"); - System.out.print(" ++ :s .s. \n"); - System.out.print(" -s///////+s///////o+ \n"); - System.out.print(" `:o````````````````:s`` \n"); - System.out.print(" ./+s////+s////+o////os// \n"); - System.out.print(" :o `++--:o- :o` \n"); - System.out.print(" .ooo `--.` -s+/ \n"); - System.out.print(" :o/o +o: `oo- -s:s \n"); - System.out.print(" :+o :/. :/` -s/. \n"); - System.out.print(" .s` /+ \n"); - System.out.print(" ++` -o. \n"); - System.out.print(" `/+- `/o. \n"); - System.out.print(" `/o+o/-.....:+o+o- .-:` \n"); - System.out.print(" `:o/``:oo::::/s+. .o+- :sss/ \n"); - System.out.print(" `:+s/ `/+-`/+-: .so+. .+++/` \n"); - System.out.print(" `:oo.s. .+o- .s.: +/.+/. .+/. \n"); - System.out.print(" `:o//s`s` :s .o+s +/ -+/. ``./+. \n"); - System.out.print(" `:o+//:.`s` :s .o +/ -o++/+o. \n"); - System.out.print(" -+:-+/. `:s-....-+/+o///..-..+o. .+/-+/+/ \n"); - System.out.print(" s- -+++/s/:::+:s:--`+o:so::o++++/. o/ \n"); - System.out.print(" /+.``:+:``s:---/:s::-`+o:oo:-o/ .+/.``:o. \n"); - System.out.print(" .:::-` `s-....-+/+o/+/.....+/ .:::-` \n"); - System.out.print(" `s:-------/s--------+/ \n"); - System.out.print(" ..:s-..../s.....++..` \n"); - System.out.print(" .s` :s // \n"); - System.out.print(" .s` :s // \n"); - System.out.print(" .s` :s // \n"); - System.out.print(" .s` :s // \n"); - System.out.print(" .s`...`:s .-.`// \n"); - System.out.print(" .so/--/sso:-:+s/ \n"); - System.out.print(" .s+////os+////s/ \n"); - } -} diff --git a/src/main/java/de/osmogrid/main/MissionControlOsmogridStandalone.java b/src/main/java/de/osmogrid/main/MissionControlOsmogridStandalone.java deleted file mode 100644 index 8b1a84fc..00000000 --- a/src/main/java/de/osmogrid/main/MissionControlOsmogridStandalone.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.main; - -import de.osmogrid.interfaces.MissionControlOsmogrid; -import java.io.File; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import picocli.CommandLine.Command; -import picocli.CommandLine.Parameters; - -/** - * MissionControl implementation including OSMoGrid and picocli to serve as a standalone - * implementation of OSMoGrid with a CLI. - * - * @author mahr - * @version 0.1 - * @since 17.12.2018 - */ -@Command( - name = "osmogrid", - description = "Starts OSMoGrid", - mixinStandardHelpOptions = true, - header = { - "\n" - + "\n" - + " ██████╗ ███████╗███╗ ███╗ ██████╗ ██████╗ ██████╗ ██╗██████╗ \n" - + "██╔═══██╗██╔════╝████╗ ████║██╔═══██╗██╔════╝ ██╔══██╗██║██╔══██╗\n" - + "██║ ██║███████╗██╔████╔██║██║ ██║██║ ███╗██████╔╝██║██║ ██║\n" - + "██║ ██║╚════██║██║╚██╔╝██║██║ ██║██║ ██║██╔══██╗██║██║ ██║\n" - + "╚██████╔╝███████║██║ ╚═╝ ██║╚██████╔╝╚██████╔╝██║ ██║██║██████╔╝\n" - + " ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚═════╝ \n" - + "\n" - }, - footer = { - "\n\n© 2019 Technische Universität Dortmund", - "Institut für Energiesysteme, Energieeffizienz und Energiewirtschaft", - "Forschungsgruppe Verteilnetzplanung und -betrieb" - }) -public class MissionControlOsmogridStandalone implements MissionControlOsmogrid { - - public static final Logger logger = - LoggerFactory.getLogger(MissionControlOsmogridStandalone.class); - - /** - * Starts the grid generation. - * - * @param configFilePath The path to the config file. - */ - @Command(name = "--config", description = "Starts grid generation using the given config file.") - @Override - public void startGridGeneration(@Parameters String configFilePath) { - File configFile = new File(configFilePath); - if (configFile.exists()) { - logger.debug( - "CLI input started grid generation method with configFilePath = {}", configFilePath); - // create, initialize and start a new MainController object - logger.info("Starting OSMoGrid ..."); - MainController mainController = new MainController(); - mainController.setup(configFile); - mainController.start(); - } else { - logger.error("Invalid path to config file"); - System.exit(1); - } - } -} diff --git a/src/main/java/de/osmogrid/main/StartMissionControl.java b/src/main/java/de/osmogrid/main/StartMissionControl.java deleted file mode 100644 index f755e1ae..00000000 --- a/src/main/java/de/osmogrid/main/StartMissionControl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.main; - -import de.osmogrid.interfaces.MissionControlOsmogrid; -import picocli.CommandLine; - -/** - * Main class to start a MissionControl by its wanted implementation - * - * @author hiry - * @version 0.1 - * @since 24.07.2018 - */ -public class StartMissionControl { - - /** - * @param args Pass "generate [name]" as parameters to start the application properly (i.e. - * "generate fuerweiler"). - */ - public static void main(String[] args) { - MissionControlOsmogrid mc; - mc = new MissionControlOsmogridStandalone(); - new CommandLine(mc).execute(args); - } -} diff --git a/src/main/java/de/osmogrid/model/SessionModel.java b/src/main/java/de/osmogrid/model/SessionModel.java deleted file mode 100644 index 0c1ba67c..00000000 --- a/src/main/java/de/osmogrid/model/SessionModel.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.model; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Model class for the session. - * - * @author Mahr - * @version 0.1 - * @since 17.12.2018 - */ -public class SessionModel { - - // TODO: implement - - private static final Logger logger = LoggerFactory.getLogger(SessionModel.class); - - private String sessionName; - - public SessionModel(String sessionName) { - super(); - this.sessionName = sessionName; - } - - public String getSessionName() { - return sessionName; - } - - public void setSessionName(String sessionName) { - this.sessionName = sessionName; - } -} diff --git a/src/main/java/de/osmogrid/model/graph/DistanceWeightedOsmEdge.java b/src/main/java/de/osmogrid/model/graph/DistanceWeightedOsmEdge.java deleted file mode 100644 index 2aebba3c..00000000 --- a/src/main/java/de/osmogrid/model/graph/DistanceWeightedOsmEdge.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.model.graph; - -import static tech.units.indriya.unit.Units.METRE; - -import javax.measure.Quantity; -import javax.measure.Unit; -import javax.measure.quantity.Length; -import org.jgrapht.graph.DefaultWeightedEdge; -import tech.units.indriya.quantity.Quantities; - -/** - * //ToDo: Class Description - * - * @version 0.1 - * @since 17.07.20 - */ -public class DistanceWeightedOsmEdge extends DefaultWeightedEdge { - private static final long serialVersionUID = -3331046813188425728L; - - protected static final Unit DEFAULT_DISTANCE_UNIT = METRE; - - public Quantity getDistance() { - return Quantities.getQuantity(getWeight(), DEFAULT_DISTANCE_UNIT); - } - - @Override - public String toString() { - return "DistanceWeightedEdge{" + "distance=" + getDistance() + "} " + super.toString(); - } -} diff --git a/src/main/java/de/osmogrid/model/graph/OsmGraph.java b/src/main/java/de/osmogrid/model/graph/OsmGraph.java deleted file mode 100644 index 030d5995..00000000 --- a/src/main/java/de/osmogrid/model/graph/OsmGraph.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.model.graph; - -import edu.ie3.datamodel.graph.DistanceWeightedEdge; -import java.util.function.Supplier; -import javax.measure.Quantity; -import javax.measure.quantity.Length; -import org.jgrapht.graph.SimpleWeightedGraph; -import tech.units.indriya.ComparableQuantity; - -/** - * //ToDo: Class Description - * - * @version 0.1 - * @since 17.07.20 - */ -public class OsmGraph extends SimpleWeightedGraph { - - private static final long serialVersionUID = -2797654003980753341L; - - public OsmGraph() { - super(DistanceWeightedOsmEdge.class); - } - - public OsmGraph( - Supplier vertexSupplier, Supplier edgeSupplier) { - super(vertexSupplier, edgeSupplier); - } - - /** - * Assigns a {@link Quantity} of type {@link Length} to an instance of edge {@link - * DistanceWeightedOsmEdge} - * - * @param edge edge whose weight should be altered - * @param weight the weight of the {@link DistanceWeightedOsmEdge} - */ - public void setEdgeWeight(DistanceWeightedOsmEdge edge, ComparableQuantity weight) { - double weightDouble = - weight.to(DistanceWeightedOsmEdge.DEFAULT_DISTANCE_UNIT).getValue().doubleValue(); - super.setEdgeWeight(edge, weightDouble); - } - - /** - * The only purpose for overriding this method is to provide a better indication of the unit that - * is expected to be passed in. It is highly advised to use the {@link - * #setEdgeWeight(DistanceWeightedOsmEdge, ComparableQuantity)} for safety purposes that the - * provided edge weight is correct. - * - * @param edge the edge whose weight should be altered - * @param distanceInMeters the weight of the {@link DistanceWeightedEdge} in meters - */ - @Override - public final void setEdgeWeight(DistanceWeightedOsmEdge edge, double distanceInMeters) { - super.setEdgeWeight(edge, distanceInMeters); - } -} diff --git a/src/main/java/de/osmogrid/model/graph/OsmGridNode.java b/src/main/java/de/osmogrid/model/graph/OsmGridNode.java deleted file mode 100644 index 3eafa0a9..00000000 --- a/src/main/java/de/osmogrid/model/graph/OsmGridNode.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.model.graph; - -import java.util.Objects; -import javax.measure.Quantity; -import javax.measure.quantity.Power; -import net.morbz.osmonaut.osm.LatLon; -import net.morbz.osmonaut.osm.Node; -import net.morbz.osmonaut.osm.Tags; -import net.morbz.osmonaut.util.StringUtil; - -/** - * Implementation of {@link Node} that extends {@link Node} with information about load, house - * connection point, substation and cluster belonging. - * - * @author Mahr - * @since 17.12.2018 - */ -public class OsmGridNode extends Node { - - private static final long serialVersionUID = -7214964092396827554L; - - private Quantity load; - private LatLon houseConnectionPoint; - private boolean subStation; - private int cluster = -1; - - public OsmGridNode() { - super(); - } - - public OsmGridNode(long id, Tags tags, LatLon latLon) { - super(id, tags, latLon); - } - - public OsmGridNode(Node n) { - super(n.getId(), n.getTags(), n.getLatlon()); - } - - public Quantity getLoad() { - return load; - } - - public void setLoad(Quantity load) { - this.load = load; - } - - public LatLon getHouseConnectionPoint() { - return houseConnectionPoint; - } - - public void setHouseConnectionPoint(LatLon houseConnectionPoint) { - this.houseConnectionPoint = houseConnectionPoint; - } - - public boolean isSubStation() { - return subStation; - } - - public void setSubStation(boolean subStation) { - this.subStation = subStation; - } - - public int getCluster() { - return cluster; - } - - public void setCluster(int cluster) { - this.cluster = cluster; - } - - @Override - public String toString() { - String str = ""; - str += "{" + "\t" + "NODE" + "\n"; - str += "\t" + "id: " + id + "\n"; - str += "\t" + "latlon: " + getLatlon() + "\n"; - str += "\t" + "tags: " + StringUtil.indent(getTags().toString()); - if (getLoad() != null) { - str += "\t" + "load: " + StringUtil.indent(getLoad().toString()); - } else { - str += "\t" + "load: null"; - } - if (getHouseConnectionPoint() != null) { - str += "\t" + "houseConnectionPoint: " + StringUtil.indent(houseConnectionPoint.toString()); - } else { - str += "\t" + "houseConnectionPoint: null"; - } - str += "\t" + "sub station: " + StringUtil.indent(String.valueOf(isSubStation())); - str += "\t" + "cluster: " + StringUtil.indent(String.valueOf(getCluster())); - str += "}"; - return str; - } - - @Override - public boolean equals(Object obj) { - return super.equals(obj); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } -} diff --git a/src/main/java/de/osmogrid/util/OsmDataProvider.java b/src/main/java/de/osmogrid/util/OsmDataProvider.java deleted file mode 100644 index 397c2f0d..00000000 --- a/src/main/java/de/osmogrid/util/OsmDataProvider.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util; - -import de.osmogrid.model.graph.DistanceWeightedOsmEdge; -import de.osmogrid.model.graph.OsmGraph; -import de.osmogrid.model.graph.OsmGridNode; -import edu.ie3.util.geo.GeoUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import javax.measure.quantity.Length; -import net.morbz.osmonaut.EntityFilter; -import net.morbz.osmonaut.Osmonaut; -import net.morbz.osmonaut.osm.Way; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import tech.units.indriya.ComparableQuantity; - -/** - * Provides reading and filtering for OSM input data and building a graph from this data. - * - * @author Mahr - * @since 17.12.2018 - */ -public class OsmDataProvider { - - public static final Logger logger = LoggerFactory.getLogger(OsmDataProvider.class); - - private List nodes; - private List ways; - private final List buildings = new ArrayList<>(); - private final List landUses = new ArrayList<>(); - private final List highways = new ArrayList<>(); - private final List realSubstations = new ArrayList<>(); - private Set[][] highwayDistanceMatrix; - private double maxLongitude; - private double minLongitude; - private double maxLatitude; - private double minLatitude; - - private static final OsmGraph rawGraph = new OsmGraph(); - - public void initialize(String pbfFilePath, boolean cutArea, boolean plot) { - logger.debug("Read OSM-Data ..."); - - // Set which OSM entities should be scanned (only nodes this case) - EntityFilter filter = new EntityFilter(true, true, false); - - // The scanned entities will be stored here - OsmReader osmReader = new OsmReader(); - - // Set the binary OSM source (pbf) file and scan for nodes and ways - Osmonaut osmonaut = new Osmonaut(pbfFilePath, filter); - osmonaut.scan(osmReader); - this.nodes = OsmoGridUtils.getOsmoGridNodeList(osmReader.getNodes()); - this.ways = osmReader.getWays(); - - logger.debug(this.nodes.size() + " nodes have been found."); - logger.debug(this.ways.size() + " ways have been found."); - - // cut draw area to residential part if cutArea is true - if (cutArea && plot) { - maxLatitude = -1000; - minLatitude = 1000; - maxLongitude = -1000; - minLongitude = 1000; - - for (Way way : this.ways) { - if (way.getTags().hasKey("building")) { - for (OsmGridNode node : OsmoGridUtils.getOsmoGridNodeList(way.getNodes())) { - if (node.getLatlon().getLat() > maxLatitude) { - maxLatitude = node.getLatlon().getLat(); - } - if (node.getLatlon().getLat() < minLatitude) { - minLatitude = node.getLatlon().getLat(); - } - if (node.getLatlon().getLon() > maxLongitude) { - maxLongitude = node.getLatlon().getLon(); - } - if (node.getLatlon().getLon() < minLongitude) { - minLongitude = node.getLatlon().getLon(); - } - } - } - } - - } else { - // extract max/min lat and long - maxLatitude = -1000; - minLatitude = 1000; - maxLongitude = -1000; - minLongitude = 1000; - - for (OsmGridNode node : this.nodes) { - if (node.getLatlon().getLat() > maxLatitude) { - maxLatitude = node.getLatlon().getLat(); - } - if (node.getLatlon().getLat() < minLatitude) { - minLatitude = node.getLatlon().getLat(); - } - if (node.getLatlon().getLon() > maxLongitude) { - maxLongitude = node.getLatlon().getLon(); - } - if (node.getLatlon().getLon() < minLongitude) { - minLongitude = node.getLatlon().getLon(); - } - } - } - - logger.debug("Extract buildings, land uses and highways ..."); - extractBuildings(); - extractLandUses(); - extractHighways(); - - logger.debug(this.buildings.size() + " buildings have been found"); - logger.debug(this.landUses.size() + " residential landuses have been found"); - logger.debug(this.highways.size() + " highways have been found"); - - logger.debug("Build up raw graph ..."); - createRawGraph(); - - logger.debug("Create highway distance matrix ..."); - createHighwayDistanceMatrix(); - } - - /** - * Extracts buildings and real sub stations from ways with specified building values (tags from - * OSM). - */ - private void extractBuildings() { - for (Way way : this.ways) { - if (way.getTags().hasKey("building")) { - if (way.getTags().hasKeyValue("building", "transformer_tower") - || way.getTags().hasKeyValue("power", "sub_station")) { - this.realSubstations.add(way); - } - this.buildings.add(way); - } - } - } - - /** Extracts land uses from ways with specified land use values (tags from OSM). */ - private void extractLandUses() { - // Array with all land use values that have to be considered - String[] landuseValues = { - "residential", "commercial", "retail", /*"greenfield", "meadow",*/ "farmyard" - }; - for (String landUseValue : landuseValues) { - for (Way way : this.ways) { - if (way.getTags().hasKeyValue("landuse", landUseValue)) { - this.landUses.add(way); - } - } - } - } - - /** Extracts highways from ways with specified highway values (tags from OSM). */ - private void extractHighways() { - // Array with all highway values that have to be considered - String[] highwayValues = { - "residential", - "unclassified", - "secondary", - "tertiary", - "living_street", - "footway", - "path", - "primary", - "service", - "cycleway", - "proposed", - "bus_stop", - "steps", - "track", - "traffic_signals", - "turning_cycle" - }; - - for (String highwayValue : highwayValues) { - for (Way way : this.ways) { - if (way.getTags().hasKeyValue("highway", highwayValue)) this.highways.add(way); - } - } - } - - /** Builds up the rawGraph from the extracted highway nodes. */ - private void createRawGraph() { - - for (Way way : this.highways) { - List osmGridNodes = OsmoGridUtils.getOsmoGridNodeList(way.getNodes()); - - for (int i = 1; i < osmGridNodes.size(); i++) { - OsmGridNode n1 = osmGridNodes.get(i - 1); - OsmGridNode n2 = osmGridNodes.get(i); - - rawGraph.addVertex(n1); - rawGraph.addVertex(n2); - - // calculate edge weight - ComparableQuantity weight = - GeoUtils.calcHaversine( - n1.getLatlon().getLat(), - n1.getLatlon().getLon(), - n2.getLatlon().getLat(), - n2.getLatlon().getLon()); - - // create edge and add edge to rawGraph - DistanceWeightedOsmEdge e = new DistanceWeightedOsmEdge(); - rawGraph.setEdgeWeight(e, weight.getValue().doubleValue()); - rawGraph.addEdge(n1, n2, e); // TODO: consider checking boolean from this method - } - } - } - - /** Creates an highway distance matrix. */ - @SuppressWarnings("unchecked") - private void createHighwayDistanceMatrix() { - // - // // TODO: calculate or pass max/min laditude/longitude (vorher: Berechnung in - // // GeoPreparator.readOSM) - // - // double minCellDistance = 0.0005; // min distance between two cells in lat/lon - // - // // calculate number of cells - // int columns = (int) Math.ceil((maxLongitude - minLongitude) / minCellDistance); - // int rows = (int) Math.ceil((maxLatitude - minLatitude) / minCellDistance); - // - // // create distance matrix - // highwayDistanceMatrix = new HashSet[rows][columns]; - // - // // add highways to fields - // for (Way way : this.highways) { - // List nodes = OsmoGridUtils.getOsmoGridNodeList(way.getNodes()); - // - // for (OsmGridNode n : nodes) { - // int xCoord = - // (int) - // Math.ceil( - // ((n.getLatlon().getLon() - minLongitude)) - // / ((maxLongitude - minLongitude)) - // * columns) - // - 1; - // int yCoord = - // (int) - // Math.ceil( - // -((n.getLatlon().getLat() - maxLatitude)) - // / ((maxLatitude - minLatitude)) - // * rows) - // - 1; - // - // if (xCoord < 0 || xCoord > columns - 1 || yCoord < 0 || yCoord > rows - 1) { - // // TODO: add exception ("at least one coordinate out of range") - // } else { - // if (highwayDistanceMatrix[yCoord][xCoord] == null) - // highwayDistanceMatrix[yCoord][xCoord] = new HashSet<>(); - // - // highwayDistanceMatrix[yCoord][xCoord].add(way); - // } - // } - // } - // - // // fill null values with neighbor values - // boolean nullFound = true; - // while (nullFound) { - // nullFound = false; - // boolean[][] filled = - // new boolean[highwayDistanceMatrix.length][highwayDistanceMatrix[0].length]; - // - // for (int i = 0; i < highwayDistanceMatrix.length; i++) { - // for (int j = 0; j < highwayDistanceMatrix[0].length; j++) { - // if (highwayDistanceMatrix[i][j] == null || highwayDistanceMatrix[i][j].isEmpty()) { - // nullFound = true; - // - // // look to neighbor, copy over - // highwayDistanceMatrix[i][j] = new HashSet<>(); - // if (i > 0) { - // if (j > 0 && highwayDistanceMatrix[i - 1][j - 1] != null && !filled[i - 1][j - - // 1]) { - // highwayDistanceMatrix[i][j].addAll(highwayDistanceMatrix[i - 1][j - 1]); - // filled[i - 1][j - 1] = true; - // } - // if (j < highwayDistanceMatrix[i].length - 1 - // && highwayDistanceMatrix[i - 1][j + 1] != null - // && !filled[i - 1][j + 1]) { - // highwayDistanceMatrix[i][j].addAll(highwayDistanceMatrix[i - 1][j + 1]); - // filled[i - 1][j + 1] = true; - // } - // } - // if (i < highwayDistanceMatrix.length - 1) { - // if (j > 0 && highwayDistanceMatrix[i + 1][j - 1] != null & !filled[i + 1][j - - // 1]) { - // highwayDistanceMatrix[i][j].addAll(highwayDistanceMatrix[i + 1][j - 1]); - // filled[i + 1][j - 1] = true; - // } - // if (j < highwayDistanceMatrix[i].length - 1 - // && highwayDistanceMatrix[i + 1][j + 1] != null - // && !filled[i + 1][j + 1]) { - // highwayDistanceMatrix[i][j].addAll(highwayDistanceMatrix[i + 1][j + 1]); - // filled[i + 1][j + 1] = true; - // } - // } - // } - // } - // } - // } - // - // LatLon center = buildings.get(5).getCenter(); - // - // // determine the grid point - // int xCoord = - // (int) - // Math.ceil( - // ((center.getLon() - minLongitude)) / ((maxLongitude - minLongitude)) * - // columns) - // - 1; - // int yCoord = - // (int) Math.ceil(-((center.getLat() - maxLatitude)) / ((maxLatitude - minLatitude)) * - // rows) - // - 1; - // - // Set highways = highwayDistanceMatrix[yCoord][xCoord]; - // - // if (yCoord < highwayDistanceMatrix.length - 1) - // highways.addAll(highwayDistanceMatrix[yCoord + 1][xCoord]); // the highways above - // if (yCoord != 0) - // highways.addAll(highwayDistanceMatrix[yCoord - 1][xCoord]); // the highways below - // if (xCoord < highwayDistanceMatrix[0].length - 1) - // highways.addAll(highwayDistanceMatrix[yCoord][xCoord + 1]); // the highways at right - // if (xCoord != 0) - // highways.addAll(highwayDistanceMatrix[yCoord][xCoord - 1]); // the highways at left - } - - public List getNodes() { - return nodes; - } - - public List getBuildings() { - return buildings; - } - - public List getWays() { - return ways; - } - - public List getHighways() { - return highways; - } - - public List getLandUses() { - return landUses; - } - - public List getRealSubstations() { - return realSubstations; - } - - public double getMaxLongitude() { - return maxLongitude; - } - - public double getMinLongitude() { - return minLongitude; - } - - public double getMaxLatitude() { - return maxLatitude; - } - - public double getMinLatitude() { - return minLatitude; - } - - public Set[][] getHighwayDistanceMatrix() { - return highwayDistanceMatrix; - } - - public OsmGraph getRawGraph() { - return rawGraph; - } -} diff --git a/src/main/java/de/osmogrid/util/OsmReader.java b/src/main/java/de/osmogrid/util/OsmReader.java deleted file mode 100644 index 2e31067d..00000000 --- a/src/main/java/de/osmogrid/util/OsmReader.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util; - -import java.util.ArrayList; -import java.util.List; -import net.morbz.osmonaut.IOsmonautReceiver; -import net.morbz.osmonaut.osm.*; - -/** - * Reads all nodes and ways from a .pbf file. - * - * @author Mahr - * @since 17.12.2018 - */ -public class OsmReader implements IOsmonautReceiver { - - private List nodes = new ArrayList<>(); - private List ways = new ArrayList<>(); - - public List getNodes() { - return this.nodes; - } - - public List getWays() { - return this.ways; - } - - @Override - public void foundEntity(Entity entity) { - if (entity.getEntityType() == EntityType.NODE) { - nodes.add((Node) entity); - } else if (entity.getEntityType() == EntityType.WAY) { - ways.add((Way) entity); - } - } - - @Override - public boolean needsEntity(EntityType entityType, Tags tags) { - return true; - } -} diff --git a/src/main/java/de/osmogrid/util/OsmoGridUtils.java b/src/main/java/de/osmogrid/util/OsmoGridUtils.java deleted file mode 100644 index 161e011a..00000000 --- a/src/main/java/de/osmogrid/util/OsmoGridUtils.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util; - -import de.osmogrid.model.graph.OsmGridNode; -import de.osmogrid.util.quantities.OsmoGridUnits; -import de.osmogrid.util.quantities.PowerDensity; -import edu.ie3.datamodel.models.input.NodeInput; -import edu.ie3.util.OneToOneMap; -import edu.ie3.util.quantities.PowerSystemUnits; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; -import javax.measure.Quantity; -import javax.measure.quantity.Area; -import javax.measure.quantity.Power; -import net.morbz.osmonaut.osm.LatLon; -import net.morbz.osmonaut.osm.Node; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.Point; -import tech.units.indriya.quantity.Quantities; -import tech.units.indriya.unit.Units; - -public class OsmoGridUtils { - /** area correction factor set to 0 (see calGeo2qm for details) */ - public static final Quantity GEO2QM_CORRECTION = - Quantities.getQuantity(0.0, Units.SQUARE_METRE); - - /** - * Converts a list of Nodes to a list of OsmogridNodes - * - * @param nodes List of Nodes which shall be converted to OsmogridNodes - * @return List of converted OsmogridNodes - */ - public static List getOsmoGridNodeList(List nodes) { - List osmGridNodes = new LinkedList<>(); - for (Node node : nodes) { - OsmGridNode osmGridNode = new OsmGridNode(node); - osmGridNodes.add(osmGridNode); - } - return osmGridNodes; - } - - /** - * Map geom points to java awt points. Can be removed when GeoUtils in PSU is fixed and tested. - * - * @param points - * @return - */ - public static Set toJavaAwtPoints(Set points) { - return points.stream().map(OsmoGridUtils::toJavaAwtPoint).collect(Collectors.toSet()); - } - - /** - * Map geom points to java awt points. Can be removed when GeoUtils in PSU is fixed and tested. - * - * @param point - * @return - */ - public static java.awt.Point toJavaAwtPoint(org.locationtech.jts.geom.Point point) { - return new java.awt.Point((int) point.getX(), (int) point.getY()); - } - - /** - * Calculates the power value of a household load based on the provided building area and the - * provided average power density value and the provided average household area size - * - * @param area - * @param density - */ - public static Quantity calcPower(Quantity area, Quantity density) { - Quantity power = - area.to(Units.SQUARE_METRE) - .multiply(density.to(OsmoGridUnits.WATT_PER_SQUARE_METRE)) - .asType(Power.class) - .to(PowerSystemUnits.KILOWATT); - - return QuantityUtils.ceil(power).asType(Power.class); - } - - /** - * Calculates the geo position as a {@link LineString} from a given collection of {@link - * OsmGridNode}s. - * - * @param nodes Node list from which the geo position shall be calculated. - * @return Calculated LineString from the given node list. - */ - public static LineString nodesToLineString(Collection nodes) { - - Set latLons = nodes.stream().map(Node::getLatlon).collect(Collectors.toSet()); - return latLonsToLineString(latLons); - } - - /** - * Calculates the geo position as a {@link LineString} from a given collection of {@link LatLon}s. - * - * @param latLons LatLon list from which the geo position shall be calculated. - * @return Calculated LineString from the given LatLon list. - */ - public static LineString latLonsToLineString(Collection latLons) { - org.locationtech.jts.geom.GeometryFactory geometryFactory = - new org.locationtech.jts.geom.GeometryFactory(); - LineString geoPosition; - - if (latLons.size() >= 2) { - org.locationtech.jts.geom.Coordinate[] coordinates = - new org.locationtech.jts.geom.Coordinate[latLons.size()]; - int cnt = 0; - for (LatLon latLon : latLons) { - coordinates[cnt++] = - new org.locationtech.jts.geom.Coordinate(latLon.getLon(), latLon.getLat()); - } - geoPosition = geometryFactory.createLineString(coordinates); - geoPosition.setSRID(4326); // Use WGS84 reference system - } else { - // If there are less than two geo coordinates, set geo position to null - geoPosition = null; - } - - return geoPosition; - } - - public static OneToOneMap buildNodeCodeMap(Collection nodes) { - OneToOneMap nodeCodeMap = new OneToOneMap<>(nodes.size()); - int counter = 0; - - for (NodeInput node : nodes) { - nodeCodeMap.put(node.getId(), counter); - counter++; - } - return nodeCodeMap; - } -} diff --git a/src/main/java/de/osmogrid/util/QuantityUtils.java b/src/main/java/de/osmogrid/util/QuantityUtils.java deleted file mode 100644 index b82fd237..00000000 --- a/src/main/java/de/osmogrid/util/QuantityUtils.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util; - -import javax.measure.Quantity; -import tech.units.indriya.quantity.Quantities; - -/** - * Provides utils for quantities. - * - * @author Mahr - * @since 17.12.2018 - */ -public class QuantityUtils { - - /** - * Description copied from {@link Math}: Returns the smallest (closest to negative infinity) - * double value that is greater than or equal to the argument and is equal to a mathematical - * integer. For more information look at description from {@link Math}. - * - * @param quantity A {@link Quantity} value. - * @return The smallest (closest to negative infinity) floating-point value that is greater than - * or equal to the argument and is equal to a mathematical integer. - */ - public static Quantity ceil(Quantity quantity) { - double ceilVal = Math.ceil(quantity.getValue().doubleValue()); - return Quantities.getQuantity(ceilVal, quantity.getUnit()); - } - - /** - * Description copied from {@link Math}: Returns the largest (closest to positive infinity) double - * value that is less than or equal to the argument and is equal to a mathematical integer. For - * more information look at description from {@link Math}. - * - * @param quantity A {@link Quantity} value. - * @return The largest (closest to positive infinity) floating-point value that less than or equal - * to the argument and is equal to a mathematical integer. - */ - public static Quantity floor(Quantity quantity) { - double floorVal = Math.floor(quantity.getValue().doubleValue()); - return Quantities.getQuantity(floorVal, quantity.getUnit()); - } - - /** - * Description copied from {@link Math}: Returns the closest long to the argument, with ties - * rounding to positive infinity. For more information look at description from {@link Math}. - * - * @param quantity A {@link Quantity} value to be rounded. - * @return The value of the argument rounded to the nearest long value. - */ - public static Quantity round(Quantity quantity, int precision) { - double divisor = Math.pow(0.1, precision); - double roundVal = (Math.round(quantity.getValue().doubleValue() / divisor)) * divisor; - return Quantities.getQuantity(roundVal, quantity.getUnit()); - } -} diff --git a/src/main/java/de/osmogrid/util/enums/TargetFormat.java b/src/main/java/de/osmogrid/util/enums/TargetFormat.java deleted file mode 100644 index 4b038f65..00000000 --- a/src/main/java/de/osmogrid/util/enums/TargetFormat.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util.enums; - -/** - * Defines the supported target types for writing the grid structure - * - * @author Kittl - * @since 13.02.2018 - */ -public enum TargetFormat { - CSV -} diff --git a/src/main/java/de/osmogrid/util/enums/TypeSourceFormat.java b/src/main/java/de/osmogrid/util/enums/TypeSourceFormat.java deleted file mode 100644 index 9912b913..00000000 --- a/src/main/java/de/osmogrid/util/enums/TypeSourceFormat.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util.enums; - -/** - * Defines the supported types for reading - * - * @author Mahr - * @since 17.12.2018 - */ -public enum TypeSourceFormat { - CSV -} diff --git a/src/main/java/de/osmogrid/util/enums/VoltageLevel.java b/src/main/java/de/osmogrid/util/enums/VoltageLevel.java deleted file mode 100644 index 98d2cd69..00000000 --- a/src/main/java/de/osmogrid/util/enums/VoltageLevel.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util.enums; - -/** - * Defines the supported voltage levels. - * - * @author Mahr - * @since 17.12.2018 - */ -public enum VoltageLevel { - LV, - MV, - HV -} diff --git a/src/main/java/de/osmogrid/util/exceptions/EmptyClusterException.java b/src/main/java/de/osmogrid/util/exceptions/EmptyClusterException.java deleted file mode 100644 index 20b1a9dc..00000000 --- a/src/main/java/de/osmogrid/util/exceptions/EmptyClusterException.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util.exceptions; - -/** - * Thrown during clustering algorithm to indicate that a cluster does not contain any nodes anymore. - * - * @author Mahr - * @since 17.12.2018 - */ -public class EmptyClusterException extends Exception { - - public EmptyClusterException(String message) { - super(message); - } -} diff --git a/src/main/java/de/osmogrid/util/exceptions/GridGenerationException.java b/src/main/java/de/osmogrid/util/exceptions/GridGenerationException.java deleted file mode 100644 index 7041c339..00000000 --- a/src/main/java/de/osmogrid/util/exceptions/GridGenerationException.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util.exceptions; - -/** - * Thrown to indicate an error during the grid generation. - * - * @author Kittl - * @since 26.04.2018 - */ -public class GridGenerationException extends Throwable { - private static final long serialVersionUID = 1269694751531161934L; - - public GridGenerationException(String message) { - super(message); - } -} diff --git a/src/main/java/de/osmogrid/util/exceptions/UnconnectedClusterException.java b/src/main/java/de/osmogrid/util/exceptions/UnconnectedClusterException.java deleted file mode 100644 index 072e03d1..00000000 --- a/src/main/java/de/osmogrid/util/exceptions/UnconnectedClusterException.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util.exceptions; - -/** - * Thrown to indicate that a cluster is not fully connected. - * - * @author Mahr - * @since 17.12.2018 - */ -public class UnconnectedClusterException extends Exception { - - public UnconnectedClusterException(String message) { - super(message); - } -} diff --git a/src/main/java/de/osmogrid/util/quantities/OsmoGridUnits.java b/src/main/java/de/osmogrid/util/quantities/OsmoGridUnits.java deleted file mode 100644 index 5cc37336..00000000 --- a/src/main/java/de/osmogrid/util/quantities/OsmoGridUnits.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util.quantities; - -import static tech.units.indriya.unit.Units.SQUARE_METRE; -import static tech.units.indriya.unit.Units.WATT; - -import edu.ie3.util.quantities.PowerSystemUnits; -import java.util.HashSet; -import javax.measure.Unit; -import tech.units.indriya.format.SimpleUnitFormat; -import tech.units.indriya.unit.ProductUnit; - -public class OsmoGridUnits { - - public static final Unit WATT_PER_SQUARE_METRE = - new ProductUnit<>(WATT.divide(SQUARE_METRE)); - - public static final Unit KILOWATT_PER_SQUARE_METRE = - new ProductUnit<>(PowerSystemUnits.KILOWATT.divide(SQUARE_METRE)); - - private static final HashSet REGISTERED_LABELS = new HashSet<>(); - - static { - addUnit(WATT_PER_SQUARE_METRE, "W/m²"); - addUnit(KILOWATT_PER_SQUARE_METRE, "kW/m²"); - } - - /** - * Units must be registered via this method or they cannot be serialized/deserialized! If the - * return-value is null, the unit was already registered - */ - private static Unit addUnit(Unit unit, String label) { - if (REGISTERED_LABELS.contains(label)) { - return null; - } - - SimpleUnitFormat.getInstance().label(unit, label); - REGISTERED_LABELS.add(label); - return unit; - } -} diff --git a/src/main/java/de/osmogrid/util/quantities/PowerDensity.java b/src/main/java/de/osmogrid/util/quantities/PowerDensity.java deleted file mode 100644 index 34b677c4..00000000 --- a/src/main/java/de/osmogrid/util/quantities/PowerDensity.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package de.osmogrid.util.quantities; - -import tech.units.indriya.ComparableQuantity; - -/** - * The power density of households loads. That is, the installed capacity of a household derived - * from its surface area. This interface should not be confused with {@link - * edu.ie3.util.quantities.interfaces.Irradiance} which is the radiance received by a surface but - * with the same SI units (watt per square metre). - */ -public interface PowerDensity extends ComparableQuantity {} diff --git a/src/test/java/utils/TestObjectFactory.java b/src/test/java/utils/TestObjectFactory.java deleted file mode 100644 index 85e38f6b..00000000 --- a/src/test/java/utils/TestObjectFactory.java +++ /dev/null @@ -1,3503 +0,0 @@ -/* - * © 2021. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package utils; - -import de.osmogrid.model.graph.OsmGraph; -import de.osmogrid.model.graph.OsmGridNode; -import edu.ie3.util.quantities.PowerSystemUnits; -import java.util.HashMap; -import java.util.Map; -import javax.measure.Quantity; -import javax.measure.quantity.Power; -import net.morbz.osmonaut.osm.LatLon; -import net.morbz.osmonaut.osm.Tags; -import org.apache.commons.lang3.tuple.Pair; -import tech.units.indriya.quantity.Quantities; - -public class TestObjectFactory { - - @Deprecated - public static OsmGraph calcPerpGraphFuerweiler() { - - OsmGraph graph = new OsmGraph(); - - graph.addVertex( - createOsmogridNode( - 271045355L, new Tags(), new LatLon(49.3784618, 6.5919926), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307406L, new Tags(), new LatLon(49.3777125, 6.5922686), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388305991L, new Tags(), new LatLon(49.3758757, 6.5958673), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388305660L, new Tags(), new LatLon(49.3758914, 6.5959366), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388305663L, new Tags(), new LatLon(49.3759923, 6.5962463), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388305665L, new Tags(), new LatLon(49.3761821, 6.5964674), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1324280445L, new Tags(), new LatLon(49.3764586, 6.5966353), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388305671L, new Tags(), new LatLon(49.3767235, 6.5970328), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307503L, new Tags(), new LatLon(49.3771619, 6.5978165), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1324280399L, new Tags(), new LatLon(49.3772829, 6.5977057), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307507L, new Tags(), new LatLon(49.3776450, 6.5972922), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307698L, new Tags(), new LatLon(49.3779964, 6.5968005), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307699L, new Tags(), new LatLon(49.3779080, 6.5966495), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729089L, new Tags(), new LatLon(49.3776295, 6.5961583), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307701L, new Tags(), new LatLon(49.3772902, 6.5956041), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307702L, new Tags(), new LatLon(49.3772416, 6.5952255), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307703L, new Tags(), new LatLon(49.3772312, 6.5951187), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729126L, new Tags(), new LatLon(49.3772111, 6.5949578), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045356L, new Tags(), new LatLon(49.3769247, 6.5945180), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303824L, new Tags(), new LatLon(49.3753664, 6.5961804), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382189L, new Tags(), new LatLon(49.3753865, 6.5959867), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1324280451L, new Tags(), new LatLon(49.3754546, 6.5958271), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308826L, new Tags(), new LatLon(49.3754829, 6.5957025), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308827L, new Tags(), new LatLon(49.3755108, 6.5954879), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308828L, new Tags(), new LatLon(49.3755052, 6.5952647), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308521L, new Tags(), new LatLon(49.3754526, 6.5950676), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308522L, new Tags(), new LatLon(49.3753499, 6.5947287), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308523L, new Tags(), new LatLon(49.3752204, 6.5942703), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 3388089388L, new Tags(), new LatLon(49.3751522, 6.5940221), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308524L, new Tags(), new LatLon(49.3751218, 6.5937997), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308525L, new Tags(), new LatLon(49.3750917, 6.5932906), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382194L, new Tags(), new LatLon(49.3750896, 6.5931434), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308526L, new Tags(), new LatLon(49.3750861, 6.5928958), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308829L, new Tags(), new LatLon(49.3750917, 6.5926984), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308830L, new Tags(), new LatLon(49.3751476, 6.5924323), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308831L, new Tags(), new LatLon(49.3751979, 6.5921748), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308832L, new Tags(), new LatLon(49.3751979, 6.5920718), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308833L, new Tags(), new LatLon(49.3752817, 6.5920718), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308834L, new Tags(), new LatLon(49.3753935, 6.5920547), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308835L, new Tags(), new LatLon(49.3754941, 6.5921662), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382186L, new Tags(), new LatLon(49.3756531, 6.5924326), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308836L, new Tags(), new LatLon(49.3756785, 6.5924752), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308837L, new Tags(), new LatLon(49.3758517, 6.5926898), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2714782555L, new Tags(), new LatLon(49.3759237, 6.5927174), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308838L, new Tags(), new LatLon(49.3760753, 6.5927756), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308839L, new Tags(), new LatLon(49.3763204, 6.5927755), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308840L, new Tags(), new LatLon(49.3766014, 6.5927643), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 3388072359L, new Tags(), new LatLon(49.3766653, 6.5927805), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308841L, new Tags(), new LatLon(49.3767275, 6.5928123), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308842L, new Tags(), new LatLon(49.3768409, 6.5928529), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308842L, new Tags(), new LatLon(49.3768409, 6.5928529), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308843L, new Tags(), new LatLon(49.3770812, 6.5925782), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308844L, new Tags(), new LatLon(49.3772991, 6.5924237), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308845L, new Tags(), new LatLon(49.3775450, 6.5923207), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307406L, new Tags(), new LatLon(49.3777125, 6.5922686), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307406L, new Tags(), new LatLon(49.3777125, 6.5922686), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307407L, new Tags(), new LatLon(49.3776678, 6.5926186), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307408L, new Tags(), new LatLon(49.3775948, 6.5929292), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307409L, new Tags(), new LatLon(49.3772151, 6.5932970), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1324280356L, new Tags(), new LatLon(49.3771362, 6.5933673), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307410L, new Tags(), new LatLon(49.3770768, 6.5935926), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307411L, new Tags(), new LatLon(49.3770291, 6.5942958), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045356L, new Tags(), new LatLon(49.3769247, 6.5945180), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729119L, new Tags(), new LatLon(49.3766553, 6.5949310), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382190L, new Tags(), new LatLon(49.3763556, 6.5954315), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045357L, new Tags(), new LatLon(49.3760784, 6.5957810), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388305991L, new Tags(), new LatLon(49.3758757, 6.5958673), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1324280451L, new Tags(), new LatLon(49.3754546, 6.5958271), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382191L, new Tags(), new LatLon(49.3752749, 6.5958166), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271118834L, new Tags(), new LatLon(49.3750945, 6.5958590), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308832L, new Tags(), new LatLon(49.3751979, 6.5920718), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 672818010L, new Tags(), new LatLon(49.3750914, 6.5915919), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 672818011L, new Tags(), new LatLon(49.3744810, 6.5905760), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729126L, new Tags(), new LatLon(49.3772111, 6.5949578), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729051L, new Tags(), new LatLon(49.3773897, 6.5947067), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729131L, new Tags(), new LatLon(49.3777182, 6.5950096), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729144L, new Tags(), new LatLon(49.3778180, 6.5951504), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729071L, new Tags(), new LatLon(49.3780603, 6.5955896), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382188L, new Tags(), new LatLon(49.3783780, 6.5961745), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729047L, new Tags(), new LatLon(49.3787741, 6.5969679), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729089L, new Tags(), new LatLon(49.3776295, 6.5961583), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729082L, new Tags(), new LatLon(49.3773274, 6.5965460), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729071L, new Tags(), new LatLon(49.3780603, 6.5955896), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729091L, new Tags(), new LatLon(49.3783944, 6.5950592), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729087L, new Tags(), new LatLon(49.3780864, 6.5945649), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729131L, new Tags(), new LatLon(49.3777182, 6.5950096), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307701L, new Tags(), new LatLon(49.3772902, 6.5956041), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729044L, new Tags(), new LatLon(49.3769490, 6.5959648), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729110L, new Tags(), new LatLon(49.3760731, 6.5939994), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729083L, new Tags(), new LatLon(49.3762777, 6.5943388), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729119L, new Tags(), new LatLon(49.3766553, 6.5949310), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388308842L, new Tags(), new LatLon(49.3768409, 6.5928529), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1324280356L, new Tags(), new LatLon(49.3771362, 6.5933673), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382194L, new Tags(), new LatLon(49.3750896, 6.5931434), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382187L, new Tags(), new LatLon(49.3756790, 6.5929183), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2714782553L, new Tags(), new LatLon(49.3757858, 6.5928672), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2714782555L, new Tags(), new LatLon(49.3759237, 6.5927174), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2714782558L, new Tags(), new LatLon(49.3760156, 6.5935158), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2714782553L, new Tags(), new LatLon(49.3757858, 6.5928672), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1556736951L, new Tags(), new LatLon(49.3862298, 6.5958277), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1556736947L, new Tags(), new LatLon(49.3861093, 6.5956742), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1567348065L, new Tags(), new LatLon(49.3856043, 6.5927280), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1556736945L, new Tags(), new LatLon(49.3855010, 6.5925646), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1556736944L, new Tags(), new LatLon(49.3853717, 6.5925232), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1556736933L, new Tags(), new LatLon(49.3845245, 6.5923524), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1567348061L, new Tags(), new LatLon(49.3839139, 6.5923724), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1237112153L, new Tags(), new LatLon(49.3834113, 6.5924950), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1237112183L, new Tags(), new LatLon(49.3831622, 6.5925110), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1237112192L, new Tags(), new LatLon(49.3830208, 6.5925200), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392078670L, new Tags(), new LatLon(49.3811037, 6.5919599), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045353L, new Tags(), new LatLon(49.3800476, 6.5919522), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 672818021L, new Tags(), new LatLon(49.3797622, 6.5919564), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 3951344064L, new Tags(), new LatLon(49.3797264, 6.5919515), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045354L, new Tags(), new LatLon(49.3790634, 6.5918610), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045355L, new Tags(), new LatLon(49.3784618, 6.5919926), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 672818011L, new Tags(), new LatLon(49.3744810, 6.5905760), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092365253L, new Tags(), new LatLon(49.3741226, 6.5899254), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092365275L, new Tags(), new LatLon(49.3738443, 6.5895513), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 672818012L, new Tags(), new LatLon(49.3735728, 6.5892015), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 672818013L, new Tags(), new LatLon(49.3733775, 6.5889447), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 672818014L, new Tags(), new LatLon(49.3732278, 6.5884787), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 672818015L, new Tags(), new LatLon(49.3731736, 6.5880480), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303910L, new Tags(), new LatLon(49.3809246, 6.6148849), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303911L, new Tags(), new LatLon(49.3806932, 6.6146638), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303912L, new Tags(), new LatLon(49.3803732, 6.6139758), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303841L, new Tags(), new LatLon(49.3800149, 6.6130255), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303842L, new Tags(), new LatLon(49.3792574, 6.6111276), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303843L, new Tags(), new LatLon(49.3784674, 6.6088386), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303844L, new Tags(), new LatLon(49.3781969, 6.6078053), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303845L, new Tags(), new LatLon(49.3780870, 6.6068690), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303846L, new Tags(), new LatLon(49.3780423, 6.6060107), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303814L, new Tags(), new LatLon(49.3780088, 6.6053670), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1324280287L, new Tags(), new LatLon(49.3779423, 6.6050133), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303815L, new Tags(), new LatLon(49.3777104, 6.6042125), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303816L, new Tags(), new LatLon(49.3773128, 6.6028979), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303817L, new Tags(), new LatLon(49.3769526, 6.6018136), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303818L, new Tags(), new LatLon(49.3762709, 6.6003202), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076818L, new Tags(), new LatLon(49.3760187, 6.5998606), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271118834L, new Tags(), new LatLon(49.3750945, 6.5958590), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388301760L, new Tags(), new LatLon(49.3749047, 6.5958880), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382198L, new Tags(), new LatLon(49.3746104, 6.5960731), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045360L, new Tags(), new LatLon(49.3733537, 6.5971273), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2154980835L, new Tags(), new LatLon(49.3730296, 6.5973264), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045362L, new Tags(), new LatLon(49.3712764, 6.5984034), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 380424744L, new Tags(), new LatLon(49.3709709, 6.5986187), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388309403L, new Tags(), new LatLon(49.3703021, 6.5989383), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388309682L, new Tags(), new LatLon(49.3694079, 6.5997708), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388309683L, new Tags(), new LatLon(49.3683346, 6.6015731), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388309684L, new Tags(), new LatLon(49.3676361, 6.6026033), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045365L, new Tags(), new LatLon(49.3670325, 6.6036332), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388309685L, new Tags(), new LatLon(49.3665574, 6.6047919), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388309686L, new Tags(), new LatLon(49.3660879, 6.6058648), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388309687L, new Tags(), new LatLon(49.3656183, 6.6065515), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 3912465423L, new Tags(), new LatLon(49.3653542, 6.6069526), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 958457205L, new Tags(), new LatLon(49.3651512, 6.6072611), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388309688L, new Tags(), new LatLon(49.3650985, 6.6073411), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 4368122618L, new Tags(), new LatLon(49.3647967, 6.6077955), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388309689L, new Tags(), new LatLon(49.3645483, 6.6081260), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404072L, new Tags(), new LatLon(49.3643098, 6.6083248), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 4368122607L, new Tags(), new LatLon(49.3640613, 6.6084527), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404069L, new Tags(), new LatLon(49.3638175, 6.6085545), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 470047441L, new Tags(), new LatLon(49.3621192, 6.6090206), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404066L, new Tags(), new LatLon(49.3618296, 6.6090916), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 4368122455L, new Tags(), new LatLon(49.3615109, 6.6092439), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 4368122439L, new Tags(), new LatLon(49.3611790, 6.6094934), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404064L, new Tags(), new LatLon(49.3608395, 6.6097823), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 4368122349L, new Tags(), new LatLon(49.3595072, 6.6111027), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404063L, new Tags(), new LatLon(49.3592752, 6.6112920), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404060L, new Tags(), new LatLon(49.3590821, 6.6114055), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 380433106L, new Tags(), new LatLon(49.3588970, 6.6114677), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404058L, new Tags(), new LatLon(49.3587354, 6.6114889), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404055L, new Tags(), new LatLon(49.3586500, 6.6114734), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 4368122268L, new Tags(), new LatLon(49.3585569, 6.6114085), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045371L, new Tags(), new LatLon(49.3584817, 6.6113262), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404053L, new Tags(), new LatLon(49.3584142, 6.6112330), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 380433105L, new Tags(), new LatLon(49.3583332, 6.6110082), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1564404051L, new Tags(), new LatLon(49.3581672, 6.6104693), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271045372L, new Tags(), new LatLon(49.3580296, 6.6100494), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 4368122218L, new Tags(), new LatLon(49.3579367, 6.6098528), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 380433109L, new Tags(), new LatLon(49.3574687, 6.6091462), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 958456409L, new Tags(), new LatLon(49.3572107, 6.6086725), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076818L, new Tags(), new LatLon(49.3760187, 6.5998606), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303819L, new Tags(), new LatLon(49.3759279, 6.5995430), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303820L, new Tags(), new LatLon(49.3758908, 6.5989640), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303821L, new Tags(), new LatLon(49.3758629, 6.5984061), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303822L, new Tags(), new LatLon(49.3757288, 6.5977195), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303823L, new Tags(), new LatLon(49.3754717, 6.5966123), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303824L, new Tags(), new LatLon(49.3753664, 6.5961804), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388303824L, new Tags(), new LatLon(49.3753664, 6.5961804), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 271118834L, new Tags(), new LatLon(49.3750945, 6.5958590), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997254L, new Tags(), new LatLon(49.3757563, 6.5875836), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997252L, new Tags(), new LatLon(49.3755775, 6.5880009), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729117L, new Tags(), new LatLon(49.3756761, 6.5877642), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729095L, new Tags(), new LatLon(49.3754756, 6.5882469), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997249L, new Tags(), new LatLon(49.3754001, 6.5884214), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997247L, new Tags(), new LatLon(49.3753354, 6.5886083), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997245L, new Tags(), new LatLon(49.3752491, 6.5888072), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997243L, new Tags(), new LatLon(49.3752136, 6.5889225), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729062L, new Tags(), new LatLon(49.3751882, 6.5890498), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997241L, new Tags(), new LatLon(49.3751453, 6.5894322), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729042L, new Tags(), new LatLon(49.3751041, 6.5898210), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997239L, new Tags(), new LatLon(49.3750402, 6.5903048), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997237L, new Tags(), new LatLon(49.3750119, 6.5905780), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1868997237L, new Tags(), new LatLon(49.3750119, 6.5905780), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729085L, new Tags(), new LatLon(49.3749936, 6.5908040), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 672818010L, new Tags(), new LatLon(49.3750914, 6.5915919), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 388307503L, new Tags(), new LatLon(49.3771619, 6.5978165), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382193L, new Tags(), new LatLon(49.3770412, 6.5980252), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382187L, new Tags(), new LatLon(49.3756790, 6.5929183), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382197L, new Tags(), new LatLon(49.3756267, 6.5925052), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092382186L, new Tags(), new LatLon(49.3756531, 6.5924326), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392064950L, new Tags(), new LatLon(49.3609021, 6.6187958), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076670L, new Tags(), new LatLon(49.3608505, 6.6185057), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076671L, new Tags(), new LatLon(49.3607276, 6.6183168), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076672L, new Tags(), new LatLon(49.3604648, 6.6179907), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076673L, new Tags(), new LatLon(49.3601685, 6.6175100), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076674L, new Tags(), new LatLon(49.3600288, 6.6170809), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076675L, new Tags(), new LatLon(49.3598108, 6.6163942), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076676L, new Tags(), new LatLon(49.3596654, 6.6158278), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076677L, new Tags(), new LatLon(49.3596654, 6.6156389), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076678L, new Tags(), new LatLon(49.3597213, 6.6154501), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076679L, new Tags(), new LatLon(49.3598667, 6.6152870), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076680L, new Tags(), new LatLon(49.3599785, 6.6152184), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076681L, new Tags(), new LatLon(49.3601853, 6.6152784), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076682L, new Tags(), new LatLon(49.3603139, 6.6153643), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076683L, new Tags(), new LatLon(49.3610741, 6.6161625), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076684L, new Tags(), new LatLon(49.3617058, 6.6167032), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076685L, new Tags(), new LatLon(49.3620524, 6.6169607), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076686L, new Tags(), new LatLon(49.3623598, 6.6172783), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076687L, new Tags(), new LatLon(49.3627567, 6.6174929), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076688L, new Tags(), new LatLon(49.3628294, 6.6174929), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076689L, new Tags(), new LatLon(49.3633101, 6.6173985), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076690L, new Tags(), new LatLon(49.3642995, 6.6174843), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076691L, new Tags(), new LatLon(49.3649423, 6.6175701), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076692L, new Tags(), new LatLon(49.3666639, 6.6171410), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076693L, new Tags(), new LatLon(49.3672899, 6.6171495), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076695L, new Tags(), new LatLon(49.3679439, 6.6173813), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1237112228L, new Tags(), new LatLon(49.3683376, 6.6174307), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076697L, new Tags(), new LatLon(49.3684916, 6.6174500), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 1237112226L, new Tags(), new LatLon(49.3689501, 6.6174867), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076699L, new Tags(), new LatLon(49.3690282, 6.6174929), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076700L, new Tags(), new LatLon(49.3697324, 6.6173813), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076701L, new Tags(), new LatLon(49.3700677, 6.6174328), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076702L, new Tags(), new LatLon(49.3705205, 6.6174585), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076703L, new Tags(), new LatLon(49.3708558, 6.6174070), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 958456238L, new Tags(), new LatLon(49.3721483, 6.6170581), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076704L, new Tags(), new LatLon(49.3727951, 6.6168835), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076705L, new Tags(), new LatLon(49.3739296, 6.6166346), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076706L, new Tags(), new LatLon(49.3743935, 6.6165487), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076707L, new Tags(), new LatLon(49.3747008, 6.6165916), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076708L, new Tags(), new LatLon(49.3751535, 6.6167032), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076709L, new Tags(), new LatLon(49.3753323, 6.6153213), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076710L, new Tags(), new LatLon(49.3754888, 6.6139652), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076711L, new Tags(), new LatLon(49.3756397, 6.6128494), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076712L, new Tags(), new LatLon(49.3755447, 6.6118195), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076713L, new Tags(), new LatLon(49.3752653, 6.6106007), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076714L, new Tags(), new LatLon(49.3752094, 6.6096394), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076715L, new Tags(), new LatLon(49.3752653, 6.6085579), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076716L, new Tags(), new LatLon(49.3751759, 6.6073391), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076717L, new Tags(), new LatLon(49.3752206, 6.6069529), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076718L, new Tags(), new LatLon(49.3754162, 6.6059229), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076719L, new Tags(), new LatLon(49.3754553, 6.6055796), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076720L, new Tags(), new LatLon(49.3754162, 6.6051762), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076721L, new Tags(), new LatLon(49.3752653, 6.6044037), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076722L, new Tags(), new LatLon(49.3752653, 6.6040947), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076723L, new Tags(), new LatLon(49.3753044, 6.6038029), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076724L, new Tags(), new LatLon(49.3758912, 6.6007730), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 392076818L, new Tags(), new LatLon(49.3760187, 6.5998606), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729056L, new Tags(), new LatLon(49.3734240, 6.5856651), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729139L, new Tags(), new LatLon(49.3746245, 6.5856651), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729128L, new Tags(), new LatLon(49.3749440, 6.5877078), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 970729062L, new Tags(), new LatLon(49.3751882, 6.5890498), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2092365275L, new Tags(), new LatLon(49.3738443, 6.5895513), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2154980840L, new Tags(), new LatLon(49.3731316, 6.5896725), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2154980839L, new Tags(), new LatLon(49.3731707, 6.5904975), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2154980828L, new Tags(), new LatLon(49.3721465, 6.5909278), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2154980829L, new Tags(), new LatLon(49.3719342, 6.5910447), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2154980832L, new Tags(), new LatLon(49.3718671, 6.5912175), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2154980836L, new Tags(), new LatLon(49.3718811, 6.5916037), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2154980833L, new Tags(), new LatLon(49.3720487, 6.5942108), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 2154980835L, new Tags(), new LatLon(49.3730296, 6.5973264), null, null, false, -1)); - graph.addVertex( - createOsmogridNode( - 7584032811027286594L, - new Tags(), - new LatLon(49.3774666, 6.5923535), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3773781, 6.5921422), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4998727616509923180L, - new Tags(), - new LatLon(49.3755017, 6.5921789), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3756091, 6.5921148), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3043955112838185573L, - new Tags(), - new LatLon(49.3777523, 6.5963748), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3778958, 6.5962935), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 388307698L, - new Tags(), - new LatLon(49.3779964, 6.5968005), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3782094, 6.5966890), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6021715049468872232L, - new Tags(), - new LatLon(49.3757122, 6.5925169), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3759261, 6.5923443), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8084083437137248903L, - new Tags(), - new LatLon(49.3775678, 6.5948710), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3776956, 6.5947325), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3827915409570024960L, - new Tags(), - new LatLon(49.3771119, 6.5925564), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3769467, 6.5923234), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4437497689979176156L, - new Tags(), - new LatLon(49.3751149, 6.5925881), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3749720, 6.5925581), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7801906562737718204L, - new Tags(), - new LatLon(49.3761569, 6.5956820), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3759019, 6.5954797), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 388308840L, - new Tags(), - new LatLon(49.3766014, 6.5927643), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3765879, 6.5923831), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3693633237338964728L, - new Tags(), - new LatLon(49.3784649, 6.5963485), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3785985, 6.5962818), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5496130406750373111L, - new Tags(), - new LatLon(49.3776449, 6.5961854), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3778028, 6.5960959), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2581337076587448376L, - new Tags(), - new LatLon(49.3762236, 6.5927755), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3762237, 6.5930036), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8378328344009394040L, - new Tags(), - new LatLon(49.3777569, 6.5963830), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3776220, 6.5964595), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 933295862165426117L, - new Tags(), - new LatLon(49.3750863, 6.5929134), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3751936, 6.5929119), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5765036547391112411L, - new Tags(), - new LatLon(49.3750281, 6.5914866), - Quantities.getQuantity(8.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3747792, 6.5916362), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 88054582532394834L, - new Tags(), - new LatLon(49.3750905, 6.5932062), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3749307, 6.5932085), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8350808787971557777L, - new Tags(), - new LatLon(49.3773219, 6.5931936), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3775404, 6.5934192), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1439824552153533531L, - new Tags(), - new LatLon(49.3762686, 6.5927755), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3762685, 6.5925327), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3993789031083688389L, - new Tags(), - new LatLon(49.3751511, 6.5924143), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3752487, 6.5924334), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6270815926028619033L, - new Tags(), - new LatLon(49.3770497, 6.5939927), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3771914, 6.5940023), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7840955676788212143L, - new Tags(), - new LatLon(49.3754175, 6.5949519), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3752215, 6.5950114), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6407100744050753997L, - new Tags(), - new LatLon(49.3770025, 6.5931344), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3771651, 6.5930412), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1032021398069726705L, - new Tags(), - new LatLon(49.3773711, 6.5976050), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3772330, 6.5974841), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2429362061069861692L, - new Tags(), - new LatLon(49.3776930, 6.5972251), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3775210, 6.5971022), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2718064068870032588L, - new Tags(), - new LatLon(49.3764877, 6.5952109), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3763090, 6.5951038), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2714782558L, - new Tags(), - new LatLon(49.3760156, 6.5935158), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3760991, 6.5935838), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1298484650948840734L, - new Tags(), - new LatLon(49.3769394, 6.5944867), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3767965, 6.5944196), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3132526446030638532L, - new Tags(), - new LatLon(49.3768196, 6.5972046), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3769611, 6.5971255), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7138083082522935359L, - new Tags(), - new LatLon(49.3769237, 6.5973907), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3770920, 6.5972966), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3694468447708201780L, - new Tags(), - new LatLon(49.3782595, 6.5959564), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3783870, 6.5958872), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6355715002474382105L, - new Tags(), - new LatLon(49.3759512, 6.5933340), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3760705, 6.5932918), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 459102476665766029L, - new Tags(), - new LatLon(49.3765342, 6.5967488), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3764020, 6.5968369), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5285354126639187738L, - new Tags(), - new LatLon(49.3770152, 6.5958948), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3770951, 6.5959704), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3646157420429592233L, - new Tags(), - new LatLon(49.3764897, 6.5927688), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3764760, 6.5924255), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 9201669643006003591L, - new Tags(), - new LatLon(49.3746346, 6.5908317), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3744686, 6.5909315), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8052286791415320450L, - new Tags(), - new LatLon(49.3757294, 6.5977225), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3758974, 6.5976897), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1060887076877125589L, - new Tags(), - new LatLon(49.3767170, 6.5970230), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3768460, 6.5969371), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6336769097111062092L, - new Tags(), - new LatLon(49.3776886, 6.5949823), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3775960, 6.5950828), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 970729082L, - new Tags(), - new LatLon(49.3773274, 6.5965460), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3773121, 6.5967856), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1275397096939406253L, - new Tags(), - new LatLon(49.3779071, 6.5953119), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3780605, 6.5952273), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5790691016049312648L, - new Tags(), - new LatLon(49.3782455, 6.5920723), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3781303, 6.5917593), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1998696969552415861L, - new Tags(), - new LatLon(49.3745322, 6.5906612), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3746445, 6.5905937), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2092382193L, - new Tags(), - new LatLon(49.3770412, 6.5980252), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3771179, 6.5981702), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7130420768753732398L, - new Tags(), - new LatLon(49.3775486, 6.5948532), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3774545, 6.5949553), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5243348599735340493L, - new Tags(), - new LatLon(49.3773340, 6.5965375), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3774668, 6.5966410), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 970729051L, - new Tags(), - new LatLon(49.3773897, 6.5947067), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3775882, 6.5944277), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2803027553190235188L, - new Tags(), - new LatLon(49.3757572, 6.5978651), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3760343, 6.5978110), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1997433474448051218L, - new Tags(), - new LatLon(49.3771160, 6.5978959), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3772625, 6.5979807), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7311476090275187063L, - new Tags(), - new LatLon(49.3772928, 6.5976944), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3774261, 6.5978111), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1812292526948040847L, - new Tags(), - new LatLon(49.3758334, 6.5982550), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3761483, 6.5981935), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 970729044L, - new Tags(), - new LatLon(49.3769490, 6.5959648), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3769984, 6.5962008), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 9146167944477951202L, - new Tags(), - new LatLon(49.3775467, 6.5962646), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3774432, 6.5961840), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2459300685067669267L, - new Tags(), - new LatLon(49.3753349, 6.5930497), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3753803, 6.5931685), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4933810452401768723L, - new Tags(), - new LatLon(49.3779563, 6.5968566), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3780852, 6.5969487), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7024592874196386841L, - new Tags(), - new LatLon(49.3779161, 6.5966633), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3778090, 6.5967261), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2734646973726673811L, - new Tags(), - new LatLon(49.3775826, 6.5929410), - Quantities.getQuantity(5.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3777520, 6.5931158), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 970729110L, - new Tags(), - new LatLon(49.3760731, 6.5939994), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3759475, 6.5940124), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8766091262754244376L, - new Tags(), - new LatLon(49.3774158, 6.5964325), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3772992, 6.5963416), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7914733434204210917L, - new Tags(), - new LatLon(49.3751238, 6.5925454), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3742592, 6.5923638), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2024279690927686243L, - new Tags(), - new LatLon(49.3779051, 6.5953083), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3778134, 6.5953589), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 9030512673428226653L, - new Tags(), - new LatLon(49.3745627, 6.5907119), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3743170, 6.5908596), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8914517618344873751L, - new Tags(), - new LatLon(49.3778280, 6.5970361), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3776787, 6.5969294), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1519599971976891479L, - new Tags(), - new LatLon(49.3751751, 6.5919689), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3750147, 6.5920045), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8571089117169403965L, - new Tags(), - new LatLon(49.3753324, 6.5946669), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3751175, 6.5947277), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4654899987586174208L, - new Tags(), - new LatLon(49.3778167, 6.5970519), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3779487, 6.5971463), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3210866191244610803L, - new Tags(), - new LatLon(49.3758244, 6.5982089), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3759836, 6.5981779), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2411194461765912863L, - new Tags(), - new LatLon(49.3753484, 6.5947234), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3756065, 6.5946506), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7973951764520779810L, - new Tags(), - new LatLon(49.3765789, 6.5948111), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3764821, 6.5948729), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2589635373340705695L, - new Tags(), - new LatLon(49.3757754, 6.5979582), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3759368, 6.5979267), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7424833642358263333L, - new Tags(), - new LatLon(49.3759292, 6.5932720), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3757829, 6.5933239), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 970729082L, - new Tags(), - new LatLon(49.3773274, 6.5965460), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3771629, 6.5965472), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8666940762377373251L, - new Tags(), - new LatLon(49.3771002, 6.5977061), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3769731, 6.5977773), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 304882005755120410L, - new Tags(), - new LatLon(49.3764582, 6.5946218), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3763556, 6.5946873), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4280465131080797064L, - new Tags(), - new LatLon(49.3763359, 6.5965608), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3762227, 6.5967472), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8475986428622163431L, - new Tags(), - new LatLon(49.3761393, 6.5964176), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3763262, 6.5962572), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4513119705808323274L, - new Tags(), - new LatLon(49.3757138, 6.5976548), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3759834, 6.5975922), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 892349675621468443L, - new Tags(), - new LatLon(49.3765306, 6.5951392), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3766502, 6.5952108), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 680671198064297448L, - new Tags(), - new LatLon(49.3767951, 6.5947168), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3766608, 6.5946292), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3976457997697240688L, - new Tags(), - new LatLon(49.3760353, 6.5957994), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3760890, 6.5959255), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4286756911375468464L, - new Tags(), - new LatLon(49.3763176, 6.5944013), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3762228, 6.5944618), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7529881389863751140L, - new Tags(), - new LatLon(49.3763708, 6.5954062), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3761794, 6.5952916), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1145959346490526892L, - new Tags(), - new LatLon(49.3764707, 6.5966535), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3766122, 6.5965592), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2317961701649173903L, - new Tags(), - new LatLon(49.3762969, 6.5943690), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3764132, 6.5942949), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5923904934485574477L, - new Tags(), - new LatLon(49.3765942, 6.5968387), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3767268, 6.5967504), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1688380869059233279L, - new Tags(), - new LatLon(49.3779559, 6.5947226), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3780643, 6.5948124), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4238963248129851794L, - new Tags(), - new LatLon(49.3761850, 6.5941851), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3760932, 6.5942404), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 87417343118559515L, - new Tags(), - new LatLon(49.3755010, 6.5955631), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3753207, 6.5955397), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7753119416939135292L, - new Tags(), - new LatLon(49.3780131, 6.5921579), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3779309, 6.5919347), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2667341346163280785L, - new Tags(), - new LatLon(49.3766586, 6.5969354), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3765179, 6.5970292), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5732106181316660937L, - new Tags(), - new LatLon(49.3750136, 6.5909648), - Quantities.getQuantity(5.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3749280, 6.5909755), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3349247679943167851L, - new Tags(), - new LatLon(49.3770798, 6.5935814), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3769867, 6.5935569), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6392877151096292852L, - new Tags(), - new LatLon(49.3755089, 6.5954118), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3756269, 6.5954088), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2196588529475928917L, - new Tags(), - new LatLon(49.3771004, 6.5947878), - Quantities.getQuantity(7.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3769436, 6.5948900), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2626056003933654963L, - new Tags(), - new LatLon(49.3777014, 6.5972133), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3778258, 6.5973022), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8535974006583345975L, - new Tags(), - new LatLon(49.3782454, 6.5952957), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3783821, 6.5953819), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6683501840636068357L, - new Tags(), - new LatLon(49.3768940, 6.5973376), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3767322, 6.5974282), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3892150939695599412L, - new Tags(), - new LatLon(49.3750004, 6.5908585), - Quantities.getQuantity(12.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3753491, 6.5908153), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1661380344260215149L, - new Tags(), - new LatLon(49.3758299, 6.5929917), - Quantities.getQuantity(5.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3759576, 6.5929465), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3142294360397729573L, - new Tags(), - new LatLon(49.3761285, 6.5964050), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3760249, 6.5964940), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 134890294000108424L, - new Tags(), - new LatLon(49.3764158, 6.5945554), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3765469, 6.5944718), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 686464964686857733L, - new Tags(), - new LatLon(49.3770343, 6.5942191), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3769106, 6.5942107), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3001070114674265383L, - new Tags(), - new LatLon(49.3763708, 6.5965820), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3764876, 6.5963897), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8903718498648147400L, - new Tags(), - new LatLon(49.3748275, 6.5911528), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3746623, 6.5912521), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 9080254421840773650L, - new Tags(), - new LatLon(49.3775605, 6.5973887), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3776753, 6.5974892), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7489504300060853487L, - new Tags(), - new LatLon(49.3773651, 6.5957264), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3775392, 6.5956198), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6391815535295352315L, - new Tags(), - new LatLon(49.3770523, 6.5939537), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3769308, 6.5939455), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1842047865910282586L, - new Tags(), - new LatLon(49.3767851, 6.5971428), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3766243, 6.5972328), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 64291990424077358L, - new Tags(), - new LatLon(49.3783183, 6.5960646), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3786116, 6.5959053), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 388308841L, - new Tags(), - new LatLon(49.3767275, 6.5928123), - Quantities.getQuantity(8.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3766517, 6.5929971), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7609839868254768021L, - new Tags(), - new LatLon(49.3763732, 6.5954021), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3764900, 6.5954720), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2714356250432982263L, - new Tags(), - new LatLon(49.3781187, 6.5921190), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3782073, 6.5923596), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8060314717796977964L, - new Tags(), - new LatLon(49.3778738, 6.5965891), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3780375, 6.5964963), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 9001575307390307353L, - new Tags(), - new LatLon(49.3778098, 6.5948989), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3779414, 6.5950079), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6526675762620156274L, - new Tags(), - new LatLon(49.3779423, 6.5921839), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3777739, 6.5917267), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7001984334661044938L, - new Tags(), - new LatLon(49.3771317, 6.5957716), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3769600, 6.5956092), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8692206324610779672L, - new Tags(), - new LatLon(49.3781222, 6.5954913), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3782570, 6.5955762), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4968962965725594200L, - new Tags(), - new LatLon(49.3773975, 6.5957794), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3772719, 6.5958563), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6233703070244750130L, - new Tags(), - new LatLon(49.3775062, 6.5959568), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3776545, 6.5958661), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5141469655394372348L, - new Tags(), - new LatLon(49.3769957, 6.5975194), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3768700, 6.5975897), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6169233413584274315L, - new Tags(), - new LatLon(49.3750921, 6.5932976), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3752222, 6.5932899), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7130026094235306005L, - new Tags(), - new LatLon(49.3776414, 6.5927310), - Quantities.getQuantity(10.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3779696, 6.5928081), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 296232887093380762L, - new Tags(), - new LatLon(49.3751427, 6.5918230), - Quantities.getQuantity(8.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3752931, 6.5917897), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 830011807837013527L, - new Tags(), - new LatLon(49.3752074, 6.5942230), - Quantities.getQuantity(7.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3749559, 6.5942922), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6358237269264515869L, - new Tags(), - new LatLon(49.3778041, 6.5922349), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3777269, 6.5920252), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1043383221157251323L, - new Tags(), - new LatLon(49.3761507, 6.5941281), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3762881, 6.5940454), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8606320085903429403L, - new Tags(), - new LatLon(49.3773870, 6.5931304), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3776634, 6.5934157), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7106417206342730336L, - new Tags(), - new LatLon(49.3770958, 6.5935205), - Quantities.getQuantity(6.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3772910, 6.5935719), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7001787228082294321L, - new Tags(), - new LatLon(49.3751421, 6.5924584), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3744090, 6.5923044), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8422283110615632732L, - new Tags(), - new LatLon(49.3776171, 6.5928343), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3774418, 6.5927932), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3896569637154277718L, - new Tags(), - new LatLon(49.3755015, 6.5955595), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3756956, 6.5955848), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1638784503241328128L, - new Tags(), - new LatLon(49.3747755, 6.5910661), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3744335, 6.5912716), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7196320059751154154L, - new Tags(), - new LatLon(49.3754434, 6.5921100), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3755732, 6.5919930), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3188821732849568178L, - new Tags(), - new LatLon(49.3750863, 6.5929073), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3742828, 6.5929187), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6925886492835529034L, - new Tags(), - new LatLon(49.3750873, 6.5929811), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3749156, 6.5929835), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 388308834L, - new Tags(), - new LatLon(49.3753935, 6.5920547), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3755323, 6.5918544), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8119972202863806476L, - new Tags(), - new LatLon(49.3758914, 6.5931653), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3761512, 6.5930733), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4852974727684441800L, - new Tags(), - new LatLon(49.3769390, 6.5927408), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3770364, 6.5928260), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4268303527865371422L, - new Tags(), - new LatLon(49.3763229, 6.5927754), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3763292, 6.5929337), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 388308526L, - new Tags(), - new LatLon(49.3750861, 6.5928958), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3743929, 6.5928951), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7454249236436438068L, - new Tags(), - new LatLon(49.3748995, 6.5912725), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3745069, 6.5915084), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5787363696224848186L, - new Tags(), - new LatLon(49.3770297, 6.5942869), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3771951, 6.5942982), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2900530286981171935L, - new Tags(), - new LatLon(49.3770595, 6.5938477), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3776125, 6.5938852), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8047696828710144620L, - new Tags(), - new LatLon(49.3772449, 6.5932681), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3774413, 6.5934709), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7368707314296308751L, - new Tags(), - new LatLon(49.3772717, 6.5954596), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3775658, 6.5954219), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6340600088584605243L, - new Tags(), - new LatLon(49.3753096, 6.5920675), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3753273, 6.5921831), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7690246658304986048L, - new Tags(), - new LatLon(49.3779786, 6.5954415), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3777553, 6.5955648), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2147773720947672586L, - new Tags(), - new LatLon(49.3776372, 6.5973011), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3781424, 6.5977435), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5443737985321419651L, - new Tags(), - new LatLon(49.3770433, 6.5940868), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3772838, 6.5941031), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 513618694971805307L, - new Tags(), - new LatLon(49.3772262, 6.5950784), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3773080, 6.5950682), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 544133599336091077L, - new Tags(), - new LatLon(49.3766135, 6.5927674), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3766562, 6.5925990), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 388307507L, - new Tags(), - new LatLon(49.3776450, 6.5972922), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3780520, 6.5976274), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2763521509518099421L, - new Tags(), - new LatLon(49.3751172, 6.5937212), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3752423, 6.5937139), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2494294375757988114L, - new Tags(), - new LatLon(49.3787402, 6.5968999), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3786738, 6.5969331), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3296906060377901311L, - new Tags(), - new LatLon(49.3785990, 6.5966171), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3786890, 6.5965722), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5592705687116006062L, - new Tags(), - new LatLon(49.3763045, 6.5954959), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3764127, 6.5955818), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 970729051L, - new Tags(), - new LatLon(49.3773897, 6.5947067), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3774248, 6.5946322), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5105125748883407655L, - new Tags(), - new LatLon(49.3751828, 6.5941334), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3753325, 6.5940923), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2638979301239113785L, - new Tags(), - new LatLon(49.3780496, 6.5955701), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3779229, 6.5956401), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 2492480840685932176L, - new Tags(), - new LatLon(49.3751208, 6.5917243), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3750093, 6.5917491), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8703044937646623709L, - new Tags(), - new LatLon(49.3750817, 6.5915136), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3752299, 6.5914953), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 4393061227427020840L, - new Tags(), - new LatLon(49.3756303, 6.5925339), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3754654, 6.5925548), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 964650462412032466L, - new Tags(), - new LatLon(49.3772525, 6.5924567), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3771184, 6.5922676), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6649840792907566349L, - new Tags(), - new LatLon(49.3752925, 6.5945256), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3754294, 6.5944870), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3776874449008937337L, - new Tags(), - new LatLon(49.3752303, 6.5943054), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3754084, 6.5942552), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7954896405919779106L, - new Tags(), - new LatLon(49.3763734, 6.5927734), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3763616, 6.5924773), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1753028448782208694L, - new Tags(), - new LatLon(49.3751570, 6.5923840), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3750079, 6.5923549), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6661912841003157672L, - new Tags(), - new LatLon(49.3776352, 6.5927574), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3775144, 6.5927290), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3722501285985469782L, - new Tags(), - new LatLon(49.3776709, 6.5925945), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3774988, 6.5925726), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 790919506390304281L, - new Tags(), - new LatLon(49.3755867, 6.5923213), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3754463, 6.5924051), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1360843264331631155L, - new Tags(), - new LatLon(49.3756553, 6.5927308), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3755087, 6.5927494), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6834598874174670950L, - new Tags(), - new LatLon(49.3751392, 6.5939268), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3752774, 6.5939079), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 388308840L, - new Tags(), - new LatLon(49.3766014, 6.5927643), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3766330, 6.5924691), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5823242403824617170L, - new Tags(), - new LatLon(49.3750427, 6.5911994), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3751332, 6.5911882), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8878887242267838478L, - new Tags(), - new LatLon(49.3771905, 6.5925007), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3770099, 6.5922459), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3981575480206445807L, - new Tags(), - new LatLon(49.3750987, 6.5934095), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3749465, 6.5934186), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1090085942029468665L, - new Tags(), - new LatLon(49.3755275, 6.5922221), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3754024, 6.5922968), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6955418595997927893L, - new Tags(), - new LatLon(49.3753940, 6.5930271), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3753372, 6.5928785), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1158815579581465300L, - new Tags(), - new LatLon(49.3750893, 6.5927839), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3749334, 6.5927795), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 8470901461510799545L, - new Tags(), - new LatLon(49.3774048, 6.5923794), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3774519, 6.5924918), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1361479772216381079L, - new Tags(), - new LatLon(49.3759310, 6.5927202), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3760145, 6.5925027), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 63032227231976117L, - new Tags(), - new LatLon(49.3775103, 6.5930111), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3773476, 6.5928431), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 5124099288808835058L, - new Tags(), - new LatLon(49.3751087, 6.5935774), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3749590, 6.5935863), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 748426143412273979L, - new Tags(), - new LatLon(49.3755785, 6.5923075), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3757301, 6.5922171), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 6694291219951734364L, - new Tags(), - new LatLon(49.3772672, 6.5954246), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3771138, 6.5954443), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1620564222610262814L, - new Tags(), - new LatLon(49.3751233, 6.5938110), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3749830, 6.5938302), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 298569470487711238L, - new Tags(), - new LatLon(49.3774220, 6.5930966), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3772703, 6.5929401), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 7080936905058110772L, - new Tags(), - new LatLon(49.3755067, 6.5953246), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3752453, 6.5953312), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 631267178578002493L, - new Tags(), - new LatLon(49.3769604, 6.5927163), - Quantities.getQuantity(4.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3768143, 6.5925885), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 3543561509980622302L, - new Tags(), - new LatLon(49.3751584, 6.5918937), - Quantities.getQuantity(2.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3747874, 6.5919760), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 1561872608925860803L, - new Tags(), - new LatLon(49.3761554, 6.5927756), - Quantities.getQuantity(3.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3761553, 6.5924506), - false, - -1)); - graph.addVertex( - createOsmogridNode( - 395484186890030123L, - new Tags(), - new LatLon(49.3754671, 6.5951219), - Quantities.getQuantity(1.0, PowerSystemUnits.KILOWATT), - new LatLon(49.3755351, 6.5951038), - true, - -1)); - - return graph; - } - - /** - * Builds a map from node id to a pair of actual node lat lon (first element) and house connection - * point lat lon (second element). - * - * @return The said map - */ - public static Map> getNodeToLatLon() { - Map> map = new HashMap<>(); - - map.put( - 388307507L, Pair.of(new LatLon(49.377645, 6.5972922), new LatLon(49.378052, 6.59762735))); - map.put( - 388307698L, - Pair.of( - new LatLon(49.3779964, 6.5968005000000005), - new LatLon(49.378209350000006, 6.5966890000000005))); - map.put( - 388308526L, - Pair.of( - new LatLon(49.375086100000004, 6.5928958), new LatLon(49.374392900000004, 6.5928951))); - map.put( - 388308834L, - Pair.of(new LatLon(49.3753935, 6.5920547), new LatLon(49.3755323, 6.591854400000001))); - map.put( - 388308840L, - Pair.of( - new LatLon(49.376601400000006, 6.592764300000001), new LatLon(49.376633, 6.59246905))); - map.put( - 388308841L, - Pair.of(new LatLon(49.3767275, 6.5928123), new LatLon(49.37665165, 6.592997050000001))); - map.put( - 970729051L, - Pair.of(new LatLon(49.3773897, 6.594706700000001), new LatLon(49.3774248, 6.5946322))); - map.put( - 970729082L, - Pair.of( - new LatLon(49.377327400000006, 6.596546), new LatLon(49.377162850000005, 6.5965472))); - map.put( - 970729044L, - Pair.of( - new LatLon(49.376949, 6.595964800000001), new LatLon(49.376998400000005, 6.59620075))); - map.put( - 970729110L, - Pair.of(new LatLon(49.376073100000006, 6.5939994), new LatLon(49.3759475, 6.59401235))); - map.put( - 2714782558L, - Pair.of( - new LatLon(49.3760156, 6.5935158000000005), - new LatLon(49.37609905000001, 6.593583800000001))); - map.put( - 2092382193L, - Pair.of( - new LatLon(49.3770412, 6.5980252), new LatLon(49.377117850000005, 6.5981701500000005))); - map.put( - 7631346241323879694L, - Pair.of( - new LatLon(49.37746659536283, 6.592353541307965), - new LatLon(49.377378050000004, 6.592142150000001))); - map.put( - 344948223476912078L, - Pair.of( - new LatLon(49.37550168581469, 6.592178909817812), - new LatLon(49.375609100000005, 6.592114800000001))); - map.put( - 333321857425034124L, - Pair.of( - new LatLon(49.37775226777416, 6.596374829733096), - new LatLon(49.377895800000005, 6.596293450000001))); - map.put( - 2011397671468421085L, - Pair.of( - new LatLon(49.375712165656914, 6.592516912759656), new LatLon(49.3759261, 6.59234425))); - map.put( - 567098690544158673L, - Pair.of( - new LatLon(49.377567838021285, 6.594870955727992), - new LatLon(49.37769555, 6.59473245))); - map.put( - 5287362806949367737L, - Pair.of( - new LatLon(49.37711194323732, 6.592556401789057), - new LatLon(49.376946700000005, 6.59232335))); - map.put( - 5149871561494908912L, - Pair.of( - new LatLon(49.375114878302625, 6.59258806464531), - new LatLon(49.374972, 6.592558050000001))); - map.put( - 8679228825976389708L, - Pair.of( - new LatLon(49.376156942283885, 6.595681972120432), - new LatLon(49.375901850000005, 6.59547965))); - map.put( - 5553239865115297219L, - Pair.of( - new LatLon(49.37846485432139, 6.59634847177124), - new LatLon(49.37859850000001, 6.596281750000001))); - map.put( - 1973680976754658160L, - Pair.of( - new LatLon(49.37764488474663, 6.5961854346051805), - new LatLon(49.377802800000005, 6.5960959))); - map.put( - 3600500065724154156L, - Pair.of( - new LatLon(49.37622355695206, 6.592775539511647), new LatLon(49.37622365, 6.5930036))); - map.put( - 3002476766672011622L, - Pair.of( - new LatLon(49.37775690635323, 6.596383010954046), new LatLon(49.377622, 6.5964595))); - map.put( - 5339510679671816785L, - Pair.of( - new LatLon(49.375086349015504, 6.592913416068036), - new LatLon(49.3751936, 6.592911900000001))); - map.put( - 4961249724263057372L, - Pair.of( - new LatLon(49.375028122363034, 6.591486585859443), - new LatLon(49.374779200000006, 6.59163615))); - map.put( - 7054331223659793440L, - Pair.of( - new LatLon(49.37509049620333, 6.5932062195854115), new LatLon(49.37493065, 6.5932085))); - map.put( - 6161861297170304057L, - Pair.of( - new LatLon(49.37732188332642, 6.593193563319845), - new LatLon(49.3775404, 6.593419150000001))); - map.put( - 6167847070128359680L, - Pair.of( - new LatLon(49.37626859907024, 6.592775521134611), - new LatLon(49.37626850000001, 6.5925327000000005))); - map.put( - 8116661199788592091L, - Pair.of( - new LatLon(49.3751511183776, 6.59241428842483), new LatLon(49.3752487, 6.59243335))); - map.put( - 6434898823099664218L, - Pair.of( - new LatLon(49.377049661097324, 6.593992685458392), new LatLon(49.3771914, 6.5940023))); - map.put( - 8140509388135876669L, - Pair.of( - new LatLon(49.37541754600085, 6.594951925216033), - new LatLon(49.375221450000005, 6.59501135))); - map.put( - 6127614691009839111L, - Pair.of( - new LatLon(49.377002527748246, 6.593134448641027), - new LatLon(49.37716505, 6.59304115))); - map.put( - 7630059381296416433L, - Pair.of( - new LatLon(49.37737109827245, 6.597604982005926), - new LatLon(49.377233000000004, 6.59748405))); - map.put( - 589338092379849714L, - Pair.of( - new LatLon(49.37769298269006, 6.597225059736194), new LatLon(49.377521, 6.59710215))); - map.put( - 4904010700539971368L, - Pair.of( - new LatLon(49.37648772505502, 6.595210850717259), - new LatLon(49.37630895000001, 6.5951038))); - map.put( - 5357617564998322606L, - Pair.of( - new LatLon(49.376939389255746, 6.594486736085956), - new LatLon(49.376796500000005, 6.5944196))); - map.put( - 3973018340605968481L, - Pair.of( - new LatLon(49.376819626789654, 6.597204639792543), - new LatLon(49.3769611, 6.597125500000001))); - map.put( - 8878862787543911444L, - Pair.of( - new LatLon(49.37692369308414, 6.597390672536579), - new LatLon(49.37709195000001, 6.59729655))); - map.put( - 6240738577815847697L, - Pair.of( - new LatLon(49.37825952851246, 6.595956388658906), - new LatLon(49.378387000000004, 6.595887150000001))); - map.put( - 5364032021844281281L, - Pair.of( - new LatLon(49.375951205200266, 6.593334048620073), - new LatLon(49.37607045, 6.593291800000001))); - map.put( - 7989908304054603415L, - Pair.of( - new LatLon(49.37653421098079, 6.596748759286008), - new LatLon(49.37640195, 6.5968369000000004))); - map.put( - 6587195426626227159L, - Pair.of( - new LatLon(49.37701519988717, 6.595894816707795), new LatLon(49.37709505, 6.59597035))); - map.put( - 8053994087879557220L, - Pair.of( - new LatLon(49.376489683241985, 6.59276875276758), - new LatLon(49.376476000000004, 6.59242545))); - map.put( - 1289276254510730129L, - Pair.of( - new LatLon(49.37463461770889, 6.590831668791708), new LatLon(49.37446855, 6.59093145))); - map.put( - 3043460009495380945L, - Pair.of( - new LatLon(49.37572937932071, 6.597722466156558), new LatLon(49.3758974, 6.59768965))); - map.put( - 3846658138575752645L, - Pair.of( - new LatLon(49.37671699441945, 6.597023037945378), new LatLon(49.37684595, 6.5969371))); - map.put( - 8953711385724145390L, - Pair.of( - new LatLon(49.37768860850159, 6.594982314566613), - new LatLon(49.377596000000004, 6.59508275))); - map.put( - 3313550393374359750L, - Pair.of( - new LatLon(49.377907088673, 6.595311884709776), - new LatLon(49.378060500000004, 6.595227250000001))); - map.put( - 4058317892605068070L, - Pair.of( - new LatLon(49.378245527800395, 6.592072262521143), new LatLon(49.37813025, 6.5917593))); - map.put( - 5143871937691995681L, - Pair.of( - new LatLon(49.3745321699439, 6.590661163083226), - new LatLon(49.374644450000005, 6.5905937))); - map.put( - 9141592033056804035L, - Pair.of( - new LatLon(49.37754859007608, 6.594853207774867), new LatLon(49.3774545, 6.59495525))); - map.put( - 4271968580922003004L, - Pair.of( - new LatLon(49.37733400975252, 6.59653751737487), new LatLon(49.37746675, 6.59664095))); - map.put( - 1560736786190518586L, - Pair.of( - new LatLon(49.375757230246045, 6.59786506455579), new LatLon(49.3760343, 6.59781095))); - map.put( - 2392936360984987335L, - Pair.of( - new LatLon(49.37711597482429, 6.597895908319558), new LatLon(49.3772625, 6.59798065))); - map.put( - 2138503529693269421L, - Pair.of(new LatLon(49.3772928123307, 6.59769438061656), new LatLon(49.3774261, 6.5978111))); - map.put( - 3175547154312282379L, - Pair.of( - new LatLon(49.37583338023647, 6.598254957049648), new LatLon(49.3761483, 6.59819345))); - map.put( - 1328926728937422959L, - Pair.of( - new LatLon(49.37754666320076, 6.596264608596718), - new LatLon(49.377443150000005, 6.59618395))); - map.put( - 9111622286273957503L, - Pair.of( - new LatLon(49.37533493050727, 6.593049704891098), - new LatLon(49.3753803, 6.593168500000001))); - map.put( - 4188089099766613220L, - Pair.of( - new LatLon(49.37795632115064, 6.596856580734865), - new LatLon(49.378085150000004, 6.596948650000001))); - map.put( - 4785370527103733235L, - Pair.of( - new LatLon(49.37791610628909, 6.596663346715527), - new LatLon(49.377809, 6.596726050000001))); - map.put( - 7017196318441424972L, - Pair.of( - new LatLon(49.3775826234316, 6.592940994948275), - new LatLon(49.377751950000004, 6.5931158))); - map.put( - 1114444174245512148L, - Pair.of( - new LatLon(49.37741584649518, 6.596432492200657), - new LatLon(49.3772992, 6.596341600000001))); - map.put( - 1430863780617670396L, - Pair.of( - new LatLon(49.375123831501696, 6.5925454448551095), - new LatLon(49.37425915, 6.592363800000001))); - map.put( - 7493769494378463739L, - Pair.of( - new LatLon(49.377905112905594, 6.595308303376541), - new LatLon(49.37781340000001, 6.595358900000001))); - map.put( - 6679416765401416961L, - Pair.of( - new LatLon(49.374562676683965, 6.59071193601448), - new LatLon(49.374317000000005, 6.59085955))); - map.put( - 8001444449239715342L, - Pair.of( - new LatLon(49.377828023851656, 6.597036102026581), - new LatLon(49.37767865000001, 6.59692935))); - map.put( - 7197491607117254566L, - Pair.of( - new LatLon(49.37517506444456, 6.591968900628577), - new LatLon(49.37501465, 6.592004500000001))); - map.put( - 5178131990727184131L, - Pair.of( - new LatLon(49.375332448598925, 6.594666926082983), new LatLon(49.3751175, 6.59472765))); - map.put( - 3307426255641919623L, - Pair.of( - new LatLon(49.37781671542671, 6.597051925454432), - new LatLon(49.377948700000005, 6.59714625))); - map.put( - 5534743008150769526L, - Pair.of( - new LatLon(49.37582439170688, 6.598208935241928), - new LatLon(49.37598355, 6.598177850000001))); - map.put( - 9132962692176167059L, - Pair.of( - new LatLon(49.37534841567219, 6.594723445823412), - new LatLon(49.37560645000001, 6.594650550000001))); - map.put( - 4660407718591547215L, - Pair.of( - new LatLon(49.37657887655267, 6.594811143099818), - new LatLon(49.376482100000004, 6.59487285))); - map.put( - 2200519884393957653L, - Pair.of( - new LatLon(49.3757754241357, 6.5979582183562515), - new LatLon(49.375936800000005, 6.5979267))); - map.put( - 8898119821070518780L, - Pair.of( - new LatLon(49.375929218262996, 6.593271991494243), - new LatLon(49.37578285000001, 6.593323850000001))); - map.put( - 8933322122885877444L, - Pair.of( - new LatLon(49.37710016581778, 6.597706141700252), - new LatLon(49.376973050000004, 6.59777725))); - map.put( - 2607099156386826468L, - Pair.of( - new LatLon(49.37645816154314, 6.594621822579044), - new LatLon(49.37635555, 6.594687250000001))); - map.put( - 5628984247574809927L, - Pair.of( - new LatLon(49.37633589477624, 6.596560789305353), - new LatLon(49.3762227, 6.596747200000001))); - map.put( - 40147112826326180L, - Pair.of( - new LatLon(49.376139349267994, 6.596417599226308), - new LatLon(49.37632620000001, 6.5962572))); - map.put( - 4309462566727994407L, - Pair.of( - new LatLon(49.37571377808622, 6.597654808195478), new LatLon(49.3759834, 6.5975922))); - map.put( - 8882163573716502357L, - Pair.of( - new LatLon(49.37653063794924, 6.595139186040732), - new LatLon(49.37665015, 6.595210750000001))); - map.put( - 6735214389577140504L, - Pair.of( - new LatLon(49.37679505194193, 6.594716755189244), new LatLon(49.37666075, 6.59462915))); - map.put( - 1517763587944105946L, - Pair.of( - new LatLon(49.37603526833733, 6.595799363406455), - new LatLon(49.37608895, 6.595925450000001))); - map.put( - 8307424651960863606L, - Pair.of( - new LatLon(49.37631757520105, 6.594401337325372), - new LatLon(49.376222750000004, 6.5944618))); - map.put( - 766964281344216564L, - Pair.of( - new LatLon(49.376370767145595, 6.595406170816254), - new LatLon(49.37617935, 6.595291550000001))); - map.put( - 6226469018692700093L, - Pair.of( - new LatLon(49.37647069579332, 6.596653450539238), new LatLon(49.3766122, 6.59655915))); - map.put( - 6835702154760505127L, - Pair.of( - new LatLon(49.37629694244143, 6.594368978426407), - new LatLon(49.3764132, 6.594294850000001))); - map.put( - 2050786792270876391L, - Pair.of( - new LatLon(49.37659415686953, 6.596838712063554), - new LatLon(49.37672675, 6.596750350000001))); - map.put( - 120265451016374069L, - Pair.of( - new LatLon(49.37795585875382, 6.594722563476851), - new LatLon(49.378064300000005, 6.59481235))); - map.put( - 3997526544572239246L, - Pair.of( - new LatLon(49.37618501565879, 6.5941850509022135), new LatLon(49.3760932, 6.5942404))); - map.put( - 8739546914634091489L, - Pair.of( - new LatLon(49.37550101771098, 6.595563142982927), new LatLon(49.3753207, 6.5955397))); - map.put( - 1849382510445284941L, - Pair.of( - new LatLon(49.37801307698097, 6.592157884336385), - new LatLon(49.37793085, 6.591934650000001))); - map.put( - 3665854743362357064L, - Pair.of( - new LatLon(49.37665861021973, 6.596935428585651), - new LatLon(49.3765179, 6.597029200000001))); - map.put( - 472778290337565728L, - Pair.of( - new LatLon(49.375013563320444, 6.590964829245159), - new LatLon(49.374928000000004, 6.59097545))); - map.put( - 5380668971616325405L, - Pair.of( - new LatLon(49.37707975699323, 6.593581384333767), - new LatLon(49.3769867, 6.593556850000001))); - map.put( - 6741535477342159688L, - Pair.of( - new LatLon(49.375508889698295, 6.59541176083194), new LatLon(49.3756269, 6.5954088))); - map.put( - 5275059393739638624L, - Pair.of( - new LatLon(49.37710041535075, 6.594787831044898), - new LatLon(49.376943600000004, 6.594889950000001))); - map.put( - 8378773655438772722L, - Pair.of( - new LatLon(49.37770137640671, 6.5972133147433745), new LatLon(49.37782575, 6.5973022))); - map.put( - 1112868100730146398L, - Pair.of( - new LatLon(49.378245401057576, 6.59529574306813), - new LatLon(49.3783821, 6.595381850000001))); - map.put( - 3299890516739638536L, - Pair.of( - new LatLon(49.376894029566145, 6.597337644938374), new LatLon(49.37673215, 6.5974282))); - map.put( - 6140390782177002760L, - Pair.of( - new LatLon(49.37500036953936, 6.590858537014914), new LatLon(49.3753491, 6.59081525))); - map.put( - 8396190869128366807L, - Pair.of( - new LatLon(49.37582990200228, 6.592991675886334), new LatLon(49.37595755, 6.59294645))); - map.put( - 7056580209371136601L, - Pair.of( - new LatLon(49.37612852734238, 6.596404992652269), - new LatLon(49.376024900000004, 6.596493950000001))); - map.put( - 8055223059040718701L, - Pair.of( - new LatLon(49.376415780254234, 6.594555354890246), - new LatLon(49.37654690000001, 6.59447175))); - map.put( - 5255703721542503791L, - Pair.of( - new LatLon(49.37703430337391, 6.594219091141832), - new LatLon(49.3769106, 6.5942107000000005))); - map.put( - 2691229492112277775L, - Pair.of( - new LatLon(49.3763707691962, 6.59658196621353), - new LatLon(49.37648755, 6.596389650000001))); - map.put( - 6728396875173808848L, - Pair.of( - new LatLon(49.37482754582376, 6.591152762618539), new LatLon(49.3746623, 6.59125205))); - map.put( - 7415395745233323893L, - Pair.of( - new LatLon(49.37756049047736, 6.59738870562721), new LatLon(49.37767525, 6.5974892))); - map.put( - 507333351811204462L, - Pair.of( - new LatLon(49.377365078196995, 6.595726403261927), new LatLon(49.3775392, 6.5956198))); - map.put( - 3199474451133517429L, - Pair.of( - new LatLon(49.377052302748766, 6.593953741867344), - new LatLon(49.376930800000004, 6.5939455))); - map.put( - 2427867643087373733L, - Pair.of( - new LatLon(49.37678505843465, 6.597142844126901), - new LatLon(49.376624250000006, 6.5972328000000005))); - map.put( - 1315041610333506617L, - Pair.of( - new LatLon(49.37831828829027, 6.596064568054683), new LatLon(49.3786116, 6.59590525))); - map.put( - 4260123898067242386L, - Pair.of( - new LatLon(49.37637322112183, 6.595402072667755), - new LatLon(49.376490000000004, 6.595472000000001))); - map.put( - 7031801934305512980L, - Pair.of( - new LatLon(49.378118688619914, 6.59211898294529), new LatLon(49.3782073, 6.59235955))); - map.put( - 5971136679098207650L, - Pair.of( - new LatLon(49.37787377174547, 6.596589130453762), - new LatLon(49.378037500000005, 6.5964963))); - map.put( - 2825101261551584820L, - Pair.of( - new LatLon(49.3778098188943, 6.594898945675468), new LatLon(49.37794135, 6.59500785))); - map.put( - 6253185864117931469L, - Pair.of( - new LatLon(49.37794232367783, 6.592183945876046), - new LatLon(49.37777390000001, 6.591726700000001))); - map.put( - 1230597754413205622L, - Pair.of(new LatLon(49.37713172038737, 6.595771636917579), new LatLon(49.37696, 6.5956092))); - map.put( - 5476213106879842748L, - Pair.of( - new LatLon(49.37812222707096, 6.595491287762831), - new LatLon(49.37825695000001, 6.59557615))); - map.put( - 7574395280086550649L, - Pair.of( - new LatLon(49.37739751941547, 6.5957793915415595), - new LatLon(49.377271900000004, 6.5958563))); - map.put( - 6435827370559489229L, - Pair.of( - new LatLon(49.377506158720244, 6.595956838941221), - new LatLon(49.37765445000001, 6.595866050000001))); - map.put( - 2622466790800900424L, - Pair.of( - new LatLon(49.376995683375604, 6.597519365035262), new LatLon(49.37686995, 6.5975897))); - map.put( - 3236137755584449681L, - Pair.of( - new LatLon(49.37509211317527, 6.59329758828997), new LatLon(49.37522215, 6.5932899))); - map.put( - 4727673052506636540L, - Pair.of( - new LatLon(49.3776413891608, 6.592730972693941), - new LatLon(49.37796955, 6.592808100000001))); - map.put( - 6535731494310594790L, - Pair.of( - new LatLon(49.375142690008275, 6.591823018074847), - new LatLon(49.37529305, 6.591789650000001))); - map.put( - 3489175019655744565L, - Pair.of( - new LatLon(49.37520741381724, 6.594223039434587), - new LatLon(49.3749559, 6.594292150000001))); - map.put( - 1188142245785387947L, - Pair.of( - new LatLon(49.37780409583378, 6.592234861243663), - new LatLon(49.37772685, 6.5920251500000004))); - map.put( - 8546721877886257645L, - Pair.of( - new LatLon(49.37615070973024, 6.59412814263168), new LatLon(49.37628805, 6.59404535))); - map.put( - 224536378665815520L, - Pair.of( - new LatLon(49.37738703928745, 6.593130449381296), - new LatLon(49.377663350000006, 6.5934157))); - map.put( - 2975718777976997428L, - Pair.of( - new LatLon(49.37709582103796, 6.593520454547959), - new LatLon(49.37729095, 6.593571900000001))); - map.put( - 5497112814334723565L, - Pair.of( - new LatLon(49.375142115739244, 6.59245840665097), new LatLon(49.374409, 6.5923044))); - map.put( - 2767677098516106098L, - Pair.of( - new LatLon(49.37761709276201, 6.592834348878386), new LatLon(49.3774418, 6.59279315))); - map.put( - 3543564196220783677L, - Pair.of( - new LatLon(49.37550148870355, 6.595559520222876), new LatLon(49.37569555, 6.59558475))); - map.put( - 3137488759929585867L, - Pair.of( - new LatLon(49.37477546410462, 6.591066082050928), new LatLon(49.3744335, 6.59127155))); - map.put( - 5504626007861513033L, - Pair.of( - new LatLon(49.375443404605235, 6.592110011764249), - new LatLon(49.37557315, 6.59199295))); - map.put( - 8721061978923748691L, - Pair.of( - new LatLon(49.37508626244449, 6.592907291786938), - new LatLon(49.374282750000006, 6.5929186500000005))); - map.put( - 6867389787020214772L, - Pair.of( - new LatLon(49.37508730539129, 6.592981072823631), - new LatLon(49.3749156, 6.592983500000001))); - map.put( - 351950318751796227L, - Pair.of( - new LatLon(49.37589142476066, 6.59316532106075), - new LatLon(49.376151150000005, 6.5930733))); - map.put( - 1202014498190609592L, - Pair.of( - new LatLon(49.37693897987726, 6.592740779557715), - new LatLon(49.3770364, 6.5928260000000005))); - map.put( - 2345752751261827556L, - Pair.of( - new LatLon(49.37632289056298, 6.59277540073201), - new LatLon(49.3763292, 6.592933700000001))); - map.put( - 1008752758135079010L, - Pair.of( - new LatLon(49.37489946041009, 6.591272451393526), new LatLon(49.37450685, 6.59150835))); - map.put( - 3815516148111985001L, - Pair.of( - new LatLon(49.37702970163783, 6.594286930571849), new LatLon(49.3771951, 6.59429815))); - map.put( - 1681314204934095999L, - Pair.of( - new LatLon(49.377059496429496, 6.593847691630668), - new LatLon(49.37761245, 6.593885200000001))); - map.put( - 4034718267022262322L, - Pair.of( - new LatLon(49.3772448933843, 6.5932681403562166), - new LatLon(49.377441250000004, 6.593470850000001))); - map.put( - 5101479749284940692L, - Pair.of( - new LatLon(49.37727165203832, 6.595459609088583), new LatLon(49.3775658, 6.59542185))); - map.put( - 8774326937300323333L, - Pair.of( - new LatLon(49.37530962323352, 6.592067529093979), - new LatLon(49.3753273, 6.592183100000001))); - map.put( - 781463898184304594L, - Pair.of( - new LatLon(49.37797860971476, 6.5954415258222125), - new LatLon(49.37775525000001, 6.59556475))); - map.put( - 8160042435997286765L, - Pair.of( - new LatLon(49.377637182494816, 6.597301127197998), - new LatLon(49.378142350000005, 6.5977435))); - map.put( - 7918101558928689313L, - Pair.of( - new LatLon(49.377043278083356, 6.594086784733468), new LatLon(49.3772838, 6.5941031))); - map.put( - 6940060437586857053L, - Pair.of( - new LatLon(49.37722616845234, 6.595078422586128), new LatLon(49.377308, 6.5950682))); - map.put( - 3217569014930162316L, - Pair.of( - new LatLon(49.37661351433364, 6.592767371239515), - new LatLon(49.3766562, 6.592599000000001))); - map.put( - 2908947785021080300L, - Pair.of( - new LatLon(49.375117161473945, 6.5937212457270356), - new LatLon(49.37524225, 6.59371385))); - map.put( - 1813458275980231229L, - Pair.of( - new LatLon(49.37874016120153, 6.596899919584166), - new LatLon(49.3786738, 6.5969330500000005))); - map.put( - 5102064421030481154L, - Pair.of( - new LatLon(49.3785989750021, 6.596617119456351), - new LatLon(49.37868895, 6.596572200000001))); - map.put( - 692094074657131876L, - Pair.of( - new LatLon(49.37630449757834, 6.595495931083592), - new LatLon(49.3764127, 6.595581750000001))); - map.put( - 592589964765841419L, - Pair.of( - new LatLon(49.37518277652699, 6.594133377038112), - new LatLon(49.37533245, 6.594092250000001))); - map.put( - 4481932239342878960L, - Pair.of( - new LatLon(49.37804956577073, 6.59557014282503), - new LatLon(49.377922850000004, 6.59564005))); - map.put( - 3680931594325609358L, - Pair.of( - new LatLon(49.375120792650165, 6.59172434631748), - new LatLon(49.375009250000005, 6.5917491))); - map.put( - 9184206835593266573L, - Pair.of( - new LatLon(49.37508168593943, 6.5915136412236635), - new LatLon(49.375229850000004, 6.59149525))); - map.put( - 289383352590159594L, - Pair.of( - new LatLon(49.37563033508089, 6.592533912273709), new LatLon(49.37546535, 6.5925548))); - map.put( - 1849854587008208836L, - Pair.of( - new LatLon(49.37725249624785, 6.5924567439637825), - new LatLon(49.37711835, 6.592267550000001))); - map.put( - 1769261792814844344L, - Pair.of( - new LatLon(49.37529252813771, 6.594525616898269), new LatLon(49.3754294, 6.59448695))); - map.put( - 2987410959058357654L, - Pair.of( - new LatLon(49.375230327783285, 6.594305442052935), - new LatLon(49.37540835, 6.59425515))); - map.put( - 3599243498251701243L, - Pair.of( - new LatLon(49.37637340334166, 6.5927733874112935), new LatLon(49.3763616, 6.59247725))); - map.put( - 8455030416760193143L, - Pair.of( - new LatLon(49.37515703646459, 6.592383992055025), new LatLon(49.37500785, 6.59235485))); - map.put( - 7911710475915904882L, - Pair.of(new LatLon(49.37763518102399, 6.59275738704041), new LatLon(49.3775144, 6.592729))); - map.put( - 7019380523646144150L, - Pair.of( - new LatLon(49.37767087374303, 6.592594532660894), - new LatLon(49.37749875, 6.592572550000001))); - map.put( - 1702680790988770733L, - Pair.of( - new LatLon(49.37558665776273, 6.592321277911891), - new LatLon(49.37544630000001, 6.59240505))); - map.put( - 4813015879782451382L, - Pair.of( - new LatLon(49.375655261144296, 6.592730794812765), - new LatLon(49.375508700000005, 6.59274935))); - map.put( - 1761295086579109610L, - Pair.of( - new LatLon(49.375139172614574, 6.593926794390814), - new LatLon(49.3752774, 6.5939079000000005))); - map.put( - 8873183049756329843L, - Pair.of( - new LatLon(49.37504268438759, 6.591199435470103), new LatLon(49.3751332, 6.5911882))); - map.put( - 7716977113203558005L, - Pair.of( - new LatLon(49.37719050992106, 6.5925006948012745), new LatLon(49.37700985, 6.5922459))); - map.put( - 513018656666305011L, - Pair.of( - new LatLon(49.375098732757635, 6.593409549398932), - new LatLon(49.3749465, 6.593418550000001))); - map.put( - 7266103699742083835L, - Pair.of( - new LatLon(49.375527488428006, 6.592222141366167), - new LatLon(49.3754024, 6.592296800000001))); - map.put( - 106453647462911557L, - Pair.of( - new LatLon(49.3753939902611, 6.593027149155457), - new LatLon(49.375337200000004, 6.592878450000001))); - map.put( - 8071507677105441422L, - Pair.of( - new LatLon(49.3750892752224, 6.592783873410566), - new LatLon(49.374933350000006, 6.59277945))); - map.put( - 8219860850566842170L, - Pair.of( - new LatLon(49.377404800592686, 6.592379425249914), - new LatLon(49.37745185, 6.592491750000001))); - map.put( - 14157153893958044L, - Pair.of( - new LatLon(49.37593095615879, 6.592720185675736), - new LatLon(49.37601445, 6.592502700000001))); - map.put( - 3823022170995769949L, - Pair.of( - new LatLon(49.377510293015334, 6.593011058490814), - new LatLon(49.37734755, 6.592843050000001))); - map.put( - 475636704219251768L, - Pair.of( - new LatLon(49.37510865667336, 6.593577398750997), - new LatLon(49.37495895000001, 6.59358625))); - map.put( - 7689595906653638151L, - Pair.of( - new LatLon(49.37557845261594, 6.5923075304206655), - new LatLon(49.37573005, 6.59221705))); - map.put( - 6319451363763241931L, - Pair.of( - new LatLon(49.37726715974472, 6.595424613566844), - new LatLon(49.377113800000004, 6.5954443000000005))); - map.put( - 7761354599345768117L, - Pair.of( - new LatLon(49.37512334006961, 6.593810966825018), - new LatLon(49.374983, 6.5938301500000005))); - map.put( - 3020848512162746267L, - Pair.of( - new LatLon(49.37742196310485, 6.593096620094912), - new LatLon(49.377270300000006, 6.59294005))); - map.put( - 5426936285372042017L, - Pair.of( - new LatLon(49.37550670265439, 6.595324591510471), - new LatLon(49.3752453, 6.595331150000001))); - map.put( - 4165793331186913278L, - Pair.of( - new LatLon(49.376960397548245, 6.592716295853091), - new LatLon(49.37681425, 6.592588450000001))); - map.put( - 3691478899120686758L, - Pair.of( - new LatLon(49.37515837003022, 6.591893673873268), - new LatLon(49.3747874, 6.591976000000001))); - map.put( - 1564112217868488100L, - Pair.of( - new LatLon(49.3761554325856, 6.592775567306167), - new LatLon(49.3761553, 6.592450600000001))); - map.put( - 2528465424325296814L, - Pair.of( - new LatLon(49.37546710335904, 6.59512194623701), new LatLon(49.3755351, 6.5951038))); - - return map; - } - - @Deprecated - public static OsmGridNode createOsmogridNode( - long id, - Tags tags, - LatLon latLon, - Quantity load, - LatLon houseConnectionPoint, - boolean subStation, - int cluster) { - OsmGridNode osmGridNode = new OsmGridNode(id, tags, latLon); - osmGridNode.setLoad(load); - osmGridNode.setHouseConnectionPoint(houseConnectionPoint); - osmGridNode.setSubStation(subStation); - osmGridNode.setCluster(cluster); - - return osmGridNode; - } -}