id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
21,100 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/GraphHopper.java | GraphHopper.createTurnWeighting | public Weighting createTurnWeighting(Graph graph, Weighting weighting, TraversalMode tMode) {
FlagEncoder encoder = weighting.getFlagEncoder();
if (encoder.supports(TurnWeighting.class) && !tMode.equals(TraversalMode.NODE_BASED))
return new TurnWeighting(weighting, (TurnCostExtension) graph.... | java | public Weighting createTurnWeighting(Graph graph, Weighting weighting, TraversalMode tMode) {
FlagEncoder encoder = weighting.getFlagEncoder();
if (encoder.supports(TurnWeighting.class) && !tMode.equals(TraversalMode.NODE_BASED))
return new TurnWeighting(weighting, (TurnCostExtension) graph.... | [
"public",
"Weighting",
"createTurnWeighting",
"(",
"Graph",
"graph",
",",
"Weighting",
"weighting",
",",
"TraversalMode",
"tMode",
")",
"{",
"FlagEncoder",
"encoder",
"=",
"weighting",
".",
"getFlagEncoder",
"(",
")",
";",
"if",
"(",
"encoder",
".",
"supports",
... | Potentially wraps the specified weighting into a TurnWeighting instance. | [
"Potentially",
"wraps",
"the",
"specified",
"weighting",
"into",
"a",
"TurnWeighting",
"instance",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/GraphHopper.java#L912-L917 |
21,101 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/GraphHopper.java | GraphHopper.cleanUp | protected void cleanUp() {
int prevNodeCount = ghStorage.getNodes();
PrepareRoutingSubnetworks preparation = new PrepareRoutingSubnetworks(ghStorage, encodingManager.fetchEdgeEncoders());
preparation.setMinNetworkSize(minNetworkSize);
preparation.setMinOneWayNetworkSize(minOneWayNetworkS... | java | protected void cleanUp() {
int prevNodeCount = ghStorage.getNodes();
PrepareRoutingSubnetworks preparation = new PrepareRoutingSubnetworks(ghStorage, encodingManager.fetchEdgeEncoders());
preparation.setMinNetworkSize(minNetworkSize);
preparation.setMinOneWayNetworkSize(minOneWayNetworkS... | [
"protected",
"void",
"cleanUp",
"(",
")",
"{",
"int",
"prevNodeCount",
"=",
"ghStorage",
".",
"getNodes",
"(",
")",
";",
"PrepareRoutingSubnetworks",
"preparation",
"=",
"new",
"PrepareRoutingSubnetworks",
"(",
"ghStorage",
",",
"encodingManager",
".",
"fetchEdgeEnc... | Internal method to clean up the graph. | [
"Internal",
"method",
"to",
"clean",
"up",
"the",
"graph",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/GraphHopper.java#L1181-L1192 |
21,102 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/GraphHopper.java | GraphHopper.clean | public void clean() {
if (getGraphHopperLocation().isEmpty())
throw new IllegalStateException("Cannot clean GraphHopper without specified graphHopperLocation");
File folder = new File(getGraphHopperLocation());
removeDir(folder);
} | java | public void clean() {
if (getGraphHopperLocation().isEmpty())
throw new IllegalStateException("Cannot clean GraphHopper without specified graphHopperLocation");
File folder = new File(getGraphHopperLocation());
removeDir(folder);
} | [
"public",
"void",
"clean",
"(",
")",
"{",
"if",
"(",
"getGraphHopperLocation",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot clean GraphHopper without specified graphHopperLocation\"",
")",
";",
"File",
"folder",
"=... | Removes the on-disc routing files. Call only after calling close or before importOrLoad or
load | [
"Removes",
"the",
"on",
"-",
"disc",
"routing",
"files",
".",
"Call",
"only",
"after",
"calling",
"close",
"or",
"before",
"importOrLoad",
"or",
"load"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/GraphHopper.java#L1224-L1230 |
21,103 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java | LandmarkStorage.setLandmarkSuggestions | public LandmarkStorage setLandmarkSuggestions(List<LandmarkSuggestion> landmarkSuggestions) {
if (landmarkSuggestions == null)
throw new IllegalArgumentException("landmark suggestions cannot be null");
this.landmarkSuggestions = landmarkSuggestions;
return this;
} | java | public LandmarkStorage setLandmarkSuggestions(List<LandmarkSuggestion> landmarkSuggestions) {
if (landmarkSuggestions == null)
throw new IllegalArgumentException("landmark suggestions cannot be null");
this.landmarkSuggestions = landmarkSuggestions;
return this;
} | [
"public",
"LandmarkStorage",
"setLandmarkSuggestions",
"(",
"List",
"<",
"LandmarkSuggestion",
">",
"landmarkSuggestions",
")",
"{",
"if",
"(",
"landmarkSuggestions",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"landmark suggestions cannot be null\... | This method forces the landmark preparation to skip the landmark search and uses the specified landmark list instead.
Useful for manual tuning of larger areas to safe import time or improve quality. | [
"This",
"method",
"forces",
"the",
"landmark",
"preparation",
"to",
"skip",
"the",
"landmark",
"search",
"and",
"uses",
"the",
"specified",
"landmark",
"list",
"instead",
".",
"Useful",
"for",
"manual",
"tuning",
"of",
"larger",
"areas",
"to",
"safe",
"import"... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java#L152-L158 |
21,104 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java | LandmarkStorage.findBorderEdgeIds | protected IntHashSet findBorderEdgeIds(SpatialRuleLookup ruleLookup) {
AllEdgesIterator allEdgesIterator = graph.getAllEdges();
NodeAccess nodeAccess = graph.getNodeAccess();
IntHashSet inaccessible = new IntHashSet();
while (allEdgesIterator.next()) {
int adjNode = allEdgesI... | java | protected IntHashSet findBorderEdgeIds(SpatialRuleLookup ruleLookup) {
AllEdgesIterator allEdgesIterator = graph.getAllEdges();
NodeAccess nodeAccess = graph.getNodeAccess();
IntHashSet inaccessible = new IntHashSet();
while (allEdgesIterator.next()) {
int adjNode = allEdgesI... | [
"protected",
"IntHashSet",
"findBorderEdgeIds",
"(",
"SpatialRuleLookup",
"ruleLookup",
")",
"{",
"AllEdgesIterator",
"allEdgesIterator",
"=",
"graph",
".",
"getAllEdges",
"(",
")",
";",
"NodeAccess",
"nodeAccess",
"=",
"graph",
".",
"getNodeAccess",
"(",
")",
";",
... | This method makes edges crossing the specified border inaccessible to split a bigger area into smaller subnetworks.
This is important for the world wide use case to limit the maximum distance and also to detect unreasonable routes faster. | [
"This",
"method",
"makes",
"edges",
"crossing",
"the",
"specified",
"border",
"inaccessible",
"to",
"split",
"a",
"bigger",
"area",
"into",
"smaller",
"subnetworks",
".",
"This",
"is",
"important",
"for",
"the",
"world",
"wide",
"use",
"case",
"to",
"limit",
... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java#L453-L468 |
21,105 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java | LandmarkStorage.initActiveLandmarks | boolean initActiveLandmarks(int fromNode, int toNode, int[] activeLandmarkIndices,
int[] activeFroms, int[] activeTos, boolean reverse) {
if (fromNode < 0 || toNode < 0)
throw new IllegalStateException("from " + fromNode + " and to "
+ toNode + " n... | java | boolean initActiveLandmarks(int fromNode, int toNode, int[] activeLandmarkIndices,
int[] activeFroms, int[] activeTos, boolean reverse) {
if (fromNode < 0 || toNode < 0)
throw new IllegalStateException("from " + fromNode + " and to "
+ toNode + " n... | [
"boolean",
"initActiveLandmarks",
"(",
"int",
"fromNode",
",",
"int",
"toNode",
",",
"int",
"[",
"]",
"activeLandmarkIndices",
",",
"int",
"[",
"]",
"activeFroms",
",",
"int",
"[",
"]",
"activeTos",
",",
"boolean",
"reverse",
")",
"{",
"if",
"(",
"fromNode... | From all available landmarks pick just a few active ones | [
"From",
"all",
"available",
"landmarks",
"pick",
"just",
"a",
"few",
"active",
"ones"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java#L585-L643 |
21,106 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/DistanceCalc2D.java | DistanceCalc2D.calcNormalizedDist | @Override
public double calcNormalizedDist(double fromY, double fromX, double toY, double toX) {
double dX = fromX - toX;
double dY = fromY - toY;
return dX * dX + dY * dY;
} | java | @Override
public double calcNormalizedDist(double fromY, double fromX, double toY, double toX) {
double dX = fromX - toX;
double dY = fromY - toY;
return dX * dX + dY * dY;
} | [
"@",
"Override",
"public",
"double",
"calcNormalizedDist",
"(",
"double",
"fromY",
",",
"double",
"fromX",
",",
"double",
"toY",
",",
"double",
"toX",
")",
"{",
"double",
"dX",
"=",
"fromX",
"-",
"toX",
";",
"double",
"dY",
"=",
"fromY",
"-",
"toY",
";... | Calculates in normalized meter | [
"Calculates",
"in",
"normalized",
"meter"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/DistanceCalc2D.java#L57-L62 |
21,107 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/ch/CHAlgoFactoryDecorator.java | CHAlgoFactoryDecorator.setPreparationThreads | public void setPreparationThreads(int preparationThreads) {
this.preparationThreads = preparationThreads;
this.threadPool = java.util.concurrent.Executors.newFixedThreadPool(preparationThreads);
} | java | public void setPreparationThreads(int preparationThreads) {
this.preparationThreads = preparationThreads;
this.threadPool = java.util.concurrent.Executors.newFixedThreadPool(preparationThreads);
} | [
"public",
"void",
"setPreparationThreads",
"(",
"int",
"preparationThreads",
")",
"{",
"this",
".",
"preparationThreads",
"=",
"preparationThreads",
";",
"this",
".",
"threadPool",
"=",
"java",
".",
"util",
".",
"concurrent",
".",
"Executors",
".",
"newFixedThread... | This method changes the number of threads used for preparation on import. Default is 1. Make
sure that you have enough memory when increasing this number! | [
"This",
"method",
"changes",
"the",
"number",
"of",
"threads",
"used",
"for",
"preparation",
"on",
"import",
".",
"Default",
"is",
"1",
".",
"Make",
"sure",
"that",
"you",
"have",
"enough",
"memory",
"when",
"increasing",
"this",
"number!"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/ch/CHAlgoFactoryDecorator.java#L277-L280 |
21,108 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/AbstractDataAccess.java | AbstractDataAccess.writeHeader | protected void writeHeader(RandomAccessFile file, long length, int segmentSize) throws IOException {
file.seek(0);
file.writeUTF("GH");
file.writeLong(length);
file.writeInt(segmentSize);
for (int i = 0; i < header.length; i++) {
file.writeInt(header[i]);
}
... | java | protected void writeHeader(RandomAccessFile file, long length, int segmentSize) throws IOException {
file.seek(0);
file.writeUTF("GH");
file.writeLong(length);
file.writeInt(segmentSize);
for (int i = 0; i < header.length; i++) {
file.writeInt(header[i]);
}
... | [
"protected",
"void",
"writeHeader",
"(",
"RandomAccessFile",
"file",
",",
"long",
"length",
",",
"int",
"segmentSize",
")",
"throws",
"IOException",
"{",
"file",
".",
"seek",
"(",
"0",
")",
";",
"file",
".",
"writeUTF",
"(",
"\"GH\"",
")",
";",
"file",
"... | Writes some internal data into the beginning of the specified file. | [
"Writes",
"some",
"internal",
"data",
"into",
"the",
"beginning",
"of",
"the",
"specified",
"file",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/AbstractDataAccess.java#L91-L99 |
21,109 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/AlgorithmOptions.java | AlgorithmOptions.start | public static Builder start(AlgorithmOptions opts) {
Builder b = new Builder();
if (opts.algorithm != null)
b.algorithm(opts.getAlgorithm());
if (opts.traversalMode != null)
b.traversalMode(opts.getTraversalMode());
if (opts.weighting != null)
b.weight... | java | public static Builder start(AlgorithmOptions opts) {
Builder b = new Builder();
if (opts.algorithm != null)
b.algorithm(opts.getAlgorithm());
if (opts.traversalMode != null)
b.traversalMode(opts.getTraversalMode());
if (opts.weighting != null)
b.weight... | [
"public",
"static",
"Builder",
"start",
"(",
"AlgorithmOptions",
"opts",
")",
"{",
"Builder",
"b",
"=",
"new",
"Builder",
"(",
")",
";",
"if",
"(",
"opts",
".",
"algorithm",
"!=",
"null",
")",
"b",
".",
"algorithm",
"(",
"opts",
".",
"getAlgorithm",
"(... | This method clones the specified AlgorithmOption object with the possibility for further
changes. | [
"This",
"method",
"clones",
"the",
"specified",
"AlgorithmOption",
"object",
"with",
"the",
"possibility",
"for",
"further",
"changes",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/AlgorithmOptions.java#L72-L86 |
21,110 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/StorableProperties.java | StorableProperties.put | public synchronized StorableProperties put(String key, Object val) {
if (!key.equals(toLowerCase(key)))
throw new IllegalArgumentException("Do not use upper case keys (" + key + ") for StorableProperties since 0.7");
map.put(key, val.toString());
return this;
} | java | public synchronized StorableProperties put(String key, Object val) {
if (!key.equals(toLowerCase(key)))
throw new IllegalArgumentException("Do not use upper case keys (" + key + ") for StorableProperties since 0.7");
map.put(key, val.toString());
return this;
} | [
"public",
"synchronized",
"StorableProperties",
"put",
"(",
"String",
"key",
",",
"Object",
"val",
")",
"{",
"if",
"(",
"!",
"key",
".",
"equals",
"(",
"toLowerCase",
"(",
"key",
")",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Do not use u... | Before it saves this value it creates a string out of it. | [
"Before",
"it",
"saves",
"this",
"value",
"it",
"creates",
"a",
"string",
"out",
"of",
"it",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/StorableProperties.java#L97-L103 |
21,111 | graphhopper/graphhopper | reader-gtfs/src/main/java/com/conveyal/gtfs/model/Service.java | Service.activeOn | public boolean activeOn (LocalDate date) {
// first check for exceptions
CalendarDate exception = calendar_dates.get(date);
if (exception != null)
return exception.exception_type == 1;
else if (calendar == null)
return false;
else {
int gtfs... | java | public boolean activeOn (LocalDate date) {
// first check for exceptions
CalendarDate exception = calendar_dates.get(date);
if (exception != null)
return exception.exception_type == 1;
else if (calendar == null)
return false;
else {
int gtfs... | [
"public",
"boolean",
"activeOn",
"(",
"LocalDate",
"date",
")",
"{",
"// first check for exceptions",
"CalendarDate",
"exception",
"=",
"calendar_dates",
".",
"get",
"(",
"date",
")",
";",
"if",
"(",
"exception",
"!=",
"null",
")",
"return",
"exception",
".",
... | Is this service active on the specified date? | [
"Is",
"this",
"service",
"active",
"on",
"the",
"specified",
"date?"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-gtfs/src/main/java/com/conveyal/gtfs/model/Service.java#L114-L149 |
21,112 | graphhopper/graphhopper | reader-gtfs/src/main/java/com/conveyal/gtfs/model/Service.java | Service.checkOverlap | public static boolean checkOverlap (Service s1, Service s2) {
if (s1.calendar == null || s2.calendar == null) {
return false;
}
// overlap exists if at least one day of week is shared by two calendars
boolean overlappingDays = s1.calendar.monday == 1 && s2.calendar.monday == ... | java | public static boolean checkOverlap (Service s1, Service s2) {
if (s1.calendar == null || s2.calendar == null) {
return false;
}
// overlap exists if at least one day of week is shared by two calendars
boolean overlappingDays = s1.calendar.monday == 1 && s2.calendar.monday == ... | [
"public",
"static",
"boolean",
"checkOverlap",
"(",
"Service",
"s1",
",",
"Service",
"s2",
")",
"{",
"if",
"(",
"s1",
".",
"calendar",
"==",
"null",
"||",
"s2",
".",
"calendar",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"// overlap exists if a... | Checks for overlapping days of week between two service calendars
@param s1
@param s2
@return true if both calendars simultaneously operate on at least one day of the week | [
"Checks",
"for",
"overlapping",
"days",
"of",
"week",
"between",
"two",
"service",
"calendars"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-gtfs/src/main/java/com/conveyal/gtfs/model/Service.java#L157-L170 |
21,113 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/PointList.java | PointList.copy | public PointList copy(int from, int end) {
if (from > end)
throw new IllegalArgumentException("from must be smaller or equal to end");
if (from < 0 || end > getSize())
throw new IllegalArgumentException("Illegal interval: " + from + ", " + end + ", size:" + getSize());
... | java | public PointList copy(int from, int end) {
if (from > end)
throw new IllegalArgumentException("from must be smaller or equal to end");
if (from < 0 || end > getSize())
throw new IllegalArgumentException("Illegal interval: " + from + ", " + end + ", size:" + getSize());
... | [
"public",
"PointList",
"copy",
"(",
"int",
"from",
",",
"int",
"end",
")",
"{",
"if",
"(",
"from",
">",
"end",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"from must be smaller or equal to end\"",
")",
";",
"if",
"(",
"from",
"<",
"0",
"||",
"e... | This method does a deep copy of this object for the specified range.
@param from the copying of the old PointList starts at this index
@param end the copying of the old PointList ends at the index before (i.e. end is exclusive) | [
"This",
"method",
"does",
"a",
"deep",
"copy",
"of",
"this",
"object",
"for",
"the",
"specified",
"range",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/PointList.java#L489-L513 |
21,114 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/PointList.java | PointList.shallowCopy | public PointList shallowCopy(final int from, final int end, boolean makeImmutable) {
if (makeImmutable)
this.makeImmutable();
return new ShallowImmutablePointList(from, end, this);
} | java | public PointList shallowCopy(final int from, final int end, boolean makeImmutable) {
if (makeImmutable)
this.makeImmutable();
return new ShallowImmutablePointList(from, end, this);
} | [
"public",
"PointList",
"shallowCopy",
"(",
"final",
"int",
"from",
",",
"final",
"int",
"end",
",",
"boolean",
"makeImmutable",
")",
"{",
"if",
"(",
"makeImmutable",
")",
"this",
".",
"makeImmutable",
"(",
")",
";",
"return",
"new",
"ShallowImmutablePointList"... | Create a shallow copy of this Pointlist from from to end, excluding end.
@param makeImmutable makes this PointList immutable. If you don't ensure the consistency it might happen that due to changes of this
object, the shallow copy might contain incorrect or corrupt data. | [
"Create",
"a",
"shallow",
"copy",
"of",
"this",
"Pointlist",
"from",
"from",
"to",
"end",
"excluding",
"end",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/PointList.java#L521-L525 |
21,115 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/IntsRef.java | IntsRef.compareTo | @Override
public int compareTo(IntsRef other) {
if (this == other) return 0;
final int[] aInts = this.ints;
int aUpto = this.offset;
final int[] bInts = other.ints;
int bUpto = other.offset;
final int aStop = aUpto + Math.min(this.length, other.length);
while ... | java | @Override
public int compareTo(IntsRef other) {
if (this == other) return 0;
final int[] aInts = this.ints;
int aUpto = this.offset;
final int[] bInts = other.ints;
int bUpto = other.offset;
final int aStop = aUpto + Math.min(this.length, other.length);
while ... | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"IntsRef",
"other",
")",
"{",
"if",
"(",
"this",
"==",
"other",
")",
"return",
"0",
";",
"final",
"int",
"[",
"]",
"aInts",
"=",
"this",
".",
"ints",
";",
"int",
"aUpto",
"=",
"this",
".",
"offset... | Signed int order comparison | [
"Signed",
"int",
"order",
"comparison"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/IntsRef.java#L110-L129 |
21,116 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/weighting/AvoidEdgesWeighting.java | AvoidEdgesWeighting.addEdges | public void addEdges(Collection<EdgeIteratorState> edges) {
for (EdgeIteratorState edge : edges) {
visitedEdges.add(edge.getEdge());
}
} | java | public void addEdges(Collection<EdgeIteratorState> edges) {
for (EdgeIteratorState edge : edges) {
visitedEdges.add(edge.getEdge());
}
} | [
"public",
"void",
"addEdges",
"(",
"Collection",
"<",
"EdgeIteratorState",
">",
"edges",
")",
"{",
"for",
"(",
"EdgeIteratorState",
"edge",
":",
"edges",
")",
"{",
"visitedEdges",
".",
"add",
"(",
"edge",
".",
"getEdge",
"(",
")",
")",
";",
"}",
"}"
] | This method adds the specified path to this weighting which should be penalized in the
calcWeight method. | [
"This",
"method",
"adds",
"the",
"specified",
"path",
"to",
"this",
"weighting",
"which",
"should",
"be",
"penalized",
"in",
"the",
"calcWeight",
"method",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/weighting/AvoidEdgesWeighting.java#L50-L54 |
21,117 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/Path.java | Path.extract | public Path extract() {
if (isFound())
throw new IllegalStateException("Extract can only be called once");
extractSW.start();
SPTEntry currEdge = sptEntry;
setEndNode(currEdge.adjNode);
boolean nextEdgeValid = EdgeIterator.Edge.isValid(currEdge.edge);
int nex... | java | public Path extract() {
if (isFound())
throw new IllegalStateException("Extract can only be called once");
extractSW.start();
SPTEntry currEdge = sptEntry;
setEndNode(currEdge.adjNode);
boolean nextEdgeValid = EdgeIterator.Edge.isValid(currEdge.edge);
int nex... | [
"public",
"Path",
"extract",
"(",
")",
"{",
"if",
"(",
"isFound",
"(",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Extract can only be called once\"",
")",
";",
"extractSW",
".",
"start",
"(",
")",
";",
"SPTEntry",
"currEdge",
"=",
"sptEntry",
... | Extracts the Path from the shortest-path-tree determined by sptEntry. | [
"Extracts",
"the",
"Path",
"from",
"the",
"shortest",
"-",
"path",
"-",
"tree",
"determined",
"by",
"sptEntry",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/Path.java#L193-L214 |
21,118 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/Path.java | Path.processEdge | protected void processEdge(int edgeId, int adjNode, int prevEdgeId) {
EdgeIteratorState iter = graph.getEdgeIteratorState(edgeId, adjNode);
distance += iter.getDistance();
time += weighting.calcMillis(iter, false, prevEdgeId);
addEdge(edgeId);
} | java | protected void processEdge(int edgeId, int adjNode, int prevEdgeId) {
EdgeIteratorState iter = graph.getEdgeIteratorState(edgeId, adjNode);
distance += iter.getDistance();
time += weighting.calcMillis(iter, false, prevEdgeId);
addEdge(edgeId);
} | [
"protected",
"void",
"processEdge",
"(",
"int",
"edgeId",
",",
"int",
"adjNode",
",",
"int",
"prevEdgeId",
")",
"{",
"EdgeIteratorState",
"iter",
"=",
"graph",
".",
"getEdgeIteratorState",
"(",
"edgeId",
",",
"adjNode",
")",
";",
"distance",
"+=",
"iter",
".... | Calculates the distance and time of the specified edgeId. Also it adds the edgeId to the path list.
@param prevEdgeId here the edge that comes before edgeId is necessary. I.e. for the reverse search we need the
next edge. | [
"Calculates",
"the",
"distance",
"and",
"time",
"of",
"the",
"specified",
"edgeId",
".",
"Also",
"it",
"adds",
"the",
"edgeId",
"to",
"the",
"path",
"list",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/Path.java#L240-L245 |
21,119 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/Path.java | Path.calcEdges | public List<EdgeIteratorState> calcEdges() {
final List<EdgeIteratorState> edges = new ArrayList<>(edgeIds.size());
if (edgeIds.isEmpty())
return edges;
forEveryEdge(new EdgeVisitor() {
@Override
public void next(EdgeIteratorState eb, int index, int prevEdgeI... | java | public List<EdgeIteratorState> calcEdges() {
final List<EdgeIteratorState> edges = new ArrayList<>(edgeIds.size());
if (edgeIds.isEmpty())
return edges;
forEveryEdge(new EdgeVisitor() {
@Override
public void next(EdgeIteratorState eb, int index, int prevEdgeI... | [
"public",
"List",
"<",
"EdgeIteratorState",
">",
"calcEdges",
"(",
")",
"{",
"final",
"List",
"<",
"EdgeIteratorState",
">",
"edges",
"=",
"new",
"ArrayList",
"<>",
"(",
"edgeIds",
".",
"size",
"(",
")",
")",
";",
"if",
"(",
"edgeIds",
".",
"isEmpty",
... | Returns the list of all edges. | [
"Returns",
"the",
"list",
"of",
"all",
"edges",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/Path.java#L278-L295 |
21,120 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/Path.java | Path.calcDetails | public Map<String, List<PathDetail>> calcDetails(List<String> requestedPathDetails, PathDetailsBuilderFactory pathBuilderFactory, int previousIndex) {
if (!isFound() || requestedPathDetails.isEmpty())
return Collections.emptyMap();
List<PathDetailsBuilder> pathBuilders = pathBuilderFactory.c... | java | public Map<String, List<PathDetail>> calcDetails(List<String> requestedPathDetails, PathDetailsBuilderFactory pathBuilderFactory, int previousIndex) {
if (!isFound() || requestedPathDetails.isEmpty())
return Collections.emptyMap();
List<PathDetailsBuilder> pathBuilders = pathBuilderFactory.c... | [
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"PathDetail",
">",
">",
"calcDetails",
"(",
"List",
"<",
"String",
">",
"requestedPathDetails",
",",
"PathDetailsBuilderFactory",
"pathBuilderFactory",
",",
"int",
"previousIndex",
")",
"{",
"if",
"(",
"!",
"is... | Calculates the PathDetails for this Path. This method will return fast, if there are no calculators.
@param pathBuilderFactory Generates the relevant PathBuilders
@return List of PathDetails for this Path | [
"Calculates",
"the",
"PathDetails",
"for",
"this",
"Path",
".",
"This",
"method",
"will",
"return",
"fast",
"if",
"there",
"are",
"no",
"calculators",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/Path.java#L380-L398 |
21,121 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/reader/ReaderElement.java | ReaderElement.hasTag | public boolean hasTag(String key, String... values) {
Object value = properties.get(key);
if (value == null)
return false;
// tag present, no values given: success
if (values.length == 0)
return true;
for (String val : values) {
if (val.equal... | java | public boolean hasTag(String key, String... values) {
Object value = properties.get(key);
if (value == null)
return false;
// tag present, no values given: success
if (values.length == 0)
return true;
for (String val : values) {
if (val.equal... | [
"public",
"boolean",
"hasTag",
"(",
"String",
"key",
",",
"String",
"...",
"values",
")",
"{",
"Object",
"value",
"=",
"properties",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"false",
";",
"// tag present, no valu... | Check that a given tag has one of the specified values. If no values are given, just checks
for presence of the tag | [
"Check",
"that",
"a",
"given",
"tag",
"has",
"one",
"of",
"the",
"specified",
"values",
".",
"If",
"no",
"values",
"are",
"given",
"just",
"checks",
"for",
"presence",
"of",
"the",
"tag"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/reader/ReaderElement.java#L113-L127 |
21,122 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/reader/ReaderElement.java | ReaderElement.hasTag | public final boolean hasTag(String key, Set<String> values) {
return values.contains(getTag(key, ""));
} | java | public final boolean hasTag(String key, Set<String> values) {
return values.contains(getTag(key, ""));
} | [
"public",
"final",
"boolean",
"hasTag",
"(",
"String",
"key",
",",
"Set",
"<",
"String",
">",
"values",
")",
"{",
"return",
"values",
".",
"contains",
"(",
"getTag",
"(",
"key",
",",
"\"\"",
")",
")",
";",
"}"
] | Check that a given tag has one of the specified values. | [
"Check",
"that",
"a",
"given",
"tag",
"has",
"one",
"of",
"the",
"specified",
"values",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/reader/ReaderElement.java#L132-L134 |
21,123 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/reader/ReaderElement.java | ReaderElement.hasTag | public boolean hasTag(List<String> keyList, Set<String> values) {
for (String key : keyList) {
if (values.contains(getTag(key, "")))
return true;
}
return false;
} | java | public boolean hasTag(List<String> keyList, Set<String> values) {
for (String key : keyList) {
if (values.contains(getTag(key, "")))
return true;
}
return false;
} | [
"public",
"boolean",
"hasTag",
"(",
"List",
"<",
"String",
">",
"keyList",
",",
"Set",
"<",
"String",
">",
"values",
")",
"{",
"for",
"(",
"String",
"key",
":",
"keyList",
")",
"{",
"if",
"(",
"values",
".",
"contains",
"(",
"getTag",
"(",
"key",
"... | Check a number of tags in the given order for the any of the given values. Used to parse
hierarchical access restrictions | [
"Check",
"a",
"number",
"of",
"tags",
"in",
"the",
"given",
"order",
"for",
"the",
"any",
"of",
"the",
"given",
"values",
".",
"Used",
"to",
"parse",
"hierarchical",
"access",
"restrictions"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/reader/ReaderElement.java#L140-L146 |
21,124 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/reader/ReaderElement.java | ReaderElement.getFirstPriorityTag | public String getFirstPriorityTag(List<String> restrictions) {
for (String str : restrictions) {
if (hasTag(str))
return getTag(str);
}
return "";
} | java | public String getFirstPriorityTag(List<String> restrictions) {
for (String str : restrictions) {
if (hasTag(str))
return getTag(str);
}
return "";
} | [
"public",
"String",
"getFirstPriorityTag",
"(",
"List",
"<",
"String",
">",
"restrictions",
")",
"{",
"for",
"(",
"String",
"str",
":",
"restrictions",
")",
"{",
"if",
"(",
"hasTag",
"(",
"str",
")",
")",
"return",
"getTag",
"(",
"str",
")",
";",
"}",
... | Returns the first existing tag of the specified list where the order is important. | [
"Returns",
"the",
"first",
"existing",
"tag",
"of",
"the",
"specified",
"list",
"where",
"the",
"order",
"is",
"important",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/reader/ReaderElement.java#L151-L157 |
21,125 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java | AbstractFlagEncoder.createEncodedValues | public void createEncodedValues(List<EncodedValue> registerNewEncodedValue, String prefix, int index) {
// define the first 2 speedBits in flags for routing
registerNewEncodedValue.add(accessEnc = new SimpleBooleanEncodedValue(prefix + "access", true));
roundaboutEnc = getBooleanEncodedValue(Enc... | java | public void createEncodedValues(List<EncodedValue> registerNewEncodedValue, String prefix, int index) {
// define the first 2 speedBits in flags for routing
registerNewEncodedValue.add(accessEnc = new SimpleBooleanEncodedValue(prefix + "access", true));
roundaboutEnc = getBooleanEncodedValue(Enc... | [
"public",
"void",
"createEncodedValues",
"(",
"List",
"<",
"EncodedValue",
">",
"registerNewEncodedValue",
",",
"String",
"prefix",
",",
"int",
"index",
")",
"{",
"// define the first 2 speedBits in flags for routing",
"registerNewEncodedValue",
".",
"add",
"(",
"accessEn... | Defines bits used for edge flags used for access, speed etc.
@return incremented shift value pointing behind the last used bit | [
"Defines",
"bits",
"used",
"for",
"edge",
"flags",
"used",
"for",
"access",
"speed",
"etc",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java#L168-L173 |
21,126 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java | AbstractFlagEncoder.flagsDefault | protected void flagsDefault(IntsRef edgeFlags, boolean forward, boolean backward) {
if (forward)
speedEncoder.setDecimal(false, edgeFlags, speedDefault);
if (backward)
speedEncoder.setDecimal(true, edgeFlags, speedDefault);
accessEnc.setBool(false, edgeFlags, forward);
... | java | protected void flagsDefault(IntsRef edgeFlags, boolean forward, boolean backward) {
if (forward)
speedEncoder.setDecimal(false, edgeFlags, speedDefault);
if (backward)
speedEncoder.setDecimal(true, edgeFlags, speedDefault);
accessEnc.setBool(false, edgeFlags, forward);
... | [
"protected",
"void",
"flagsDefault",
"(",
"IntsRef",
"edgeFlags",
",",
"boolean",
"forward",
",",
"boolean",
"backward",
")",
"{",
"if",
"(",
"forward",
")",
"speedEncoder",
".",
"setDecimal",
"(",
"false",
",",
"edgeFlags",
",",
"speedDefault",
")",
";",
"i... | Sets default flags with specified access. | [
"Sets",
"default",
"flags",
"with",
"specified",
"access",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java#L253-L260 |
21,127 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java | AbstractFlagEncoder.getFerrySpeed | protected double getFerrySpeed(ReaderWay way) {
long duration = 0;
try {
// During the reader process we have converted the duration value into a artificial tag called "duration:seconds".
duration = Long.parseLong(way.getTag("duration:seconds"));
} catch (Exception ex) {... | java | protected double getFerrySpeed(ReaderWay way) {
long duration = 0;
try {
// During the reader process we have converted the duration value into a artificial tag called "duration:seconds".
duration = Long.parseLong(way.getTag("duration:seconds"));
} catch (Exception ex) {... | [
"protected",
"double",
"getFerrySpeed",
"(",
"ReaderWay",
"way",
")",
"{",
"long",
"duration",
"=",
"0",
";",
"try",
"{",
"// During the reader process we have converted the duration value into a artificial tag called \"duration:seconds\".",
"duration",
"=",
"Long",
".",
"par... | Special handling for ferry ways. | [
"Special",
"handling",
"for",
"ferry",
"ways",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java#L365-L419 |
21,128 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java | AbstractFlagEncoder.setSpeed | protected void setSpeed(boolean reverse, IntsRef edgeFlags, double speed) {
if (speed < 0 || Double.isNaN(speed))
throw new IllegalArgumentException("Speed cannot be negative or NaN: " + speed + ", flags:" + BitUtil.LITTLE.toBitString(edgeFlags));
if (speed < speedFactor / 2) {
... | java | protected void setSpeed(boolean reverse, IntsRef edgeFlags, double speed) {
if (speed < 0 || Double.isNaN(speed))
throw new IllegalArgumentException("Speed cannot be negative or NaN: " + speed + ", flags:" + BitUtil.LITTLE.toBitString(edgeFlags));
if (speed < speedFactor / 2) {
... | [
"protected",
"void",
"setSpeed",
"(",
"boolean",
"reverse",
",",
"IntsRef",
"edgeFlags",
",",
"double",
"speed",
")",
"{",
"if",
"(",
"speed",
"<",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"speed",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Most use cases do not require this method. Will still keep it accessible so that one can disable it
until the averageSpeedEncodedValue is moved out of the FlagEncoder.
@Deprecated | [
"Most",
"use",
"cases",
"do",
"not",
"require",
"this",
"method",
".",
"Will",
"still",
"keep",
"it",
"accessible",
"so",
"that",
"one",
"can",
"disable",
"it",
"until",
"the",
"averageSpeedEncodedValue",
"is",
"moved",
"out",
"of",
"the",
"FlagEncoder",
"."... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java#L540-L554 |
21,129 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/lm/LMAlgoFactoryDecorator.java | LMAlgoFactoryDecorator.setWeightingsAsStrings | public LMAlgoFactoryDecorator setWeightingsAsStrings(List<String> weightingList) {
if (weightingList.isEmpty())
throw new IllegalArgumentException("It is not allowed to pass an emtpy weightingList");
weightingsAsStrings.clear();
for (String strWeighting : weightingList) {
... | java | public LMAlgoFactoryDecorator setWeightingsAsStrings(List<String> weightingList) {
if (weightingList.isEmpty())
throw new IllegalArgumentException("It is not allowed to pass an emtpy weightingList");
weightingsAsStrings.clear();
for (String strWeighting : weightingList) {
... | [
"public",
"LMAlgoFactoryDecorator",
"setWeightingsAsStrings",
"(",
"List",
"<",
"String",
">",
"weightingList",
")",
"{",
"if",
"(",
"weightingList",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"It is not allowed to pass an emtpy we... | Enables the use of contraction hierarchies to reduce query times. Enabled by default.
@param weightingList A list containing multiple weightings like: "fastest", "shortest" or
your own weight-calculation type. | [
"Enables",
"the",
"use",
"of",
"contraction",
"hierarchies",
"to",
"reduce",
"query",
"times",
".",
"Enabled",
"by",
"default",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/lm/LMAlgoFactoryDecorator.java#L147-L158 |
21,130 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/lm/LMAlgoFactoryDecorator.java | LMAlgoFactoryDecorator.createPreparations | public void createPreparations(GraphHopperStorage ghStorage, LocationIndex locationIndex) {
if (!isEnabled() || !preparations.isEmpty())
return;
if (weightings.isEmpty())
throw new IllegalStateException("No landmark weightings found");
List<LandmarkSuggestion> lmSuggesti... | java | public void createPreparations(GraphHopperStorage ghStorage, LocationIndex locationIndex) {
if (!isEnabled() || !preparations.isEmpty())
return;
if (weightings.isEmpty())
throw new IllegalStateException("No landmark weightings found");
List<LandmarkSuggestion> lmSuggesti... | [
"public",
"void",
"createPreparations",
"(",
"GraphHopperStorage",
"ghStorage",
",",
"LocationIndex",
"locationIndex",
")",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
")",
"||",
"!",
"preparations",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"if",
"(",
"weigh... | This method creates the landmark storages ready for landmark creation. | [
"This",
"method",
"creates",
"the",
"landmark",
"storages",
"ready",
"for",
"landmark",
"creation",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/lm/LMAlgoFactoryDecorator.java#L312-L344 |
21,131 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/GraphBuilder.java | GraphBuilder.chGraphCreate | public CHGraph chGraphCreate(Weighting singleCHWeighting) {
return setCHGraph(singleCHWeighting).create().getGraph(CHGraph.class, singleCHWeighting);
} | java | public CHGraph chGraphCreate(Weighting singleCHWeighting) {
return setCHGraph(singleCHWeighting).create().getGraph(CHGraph.class, singleCHWeighting);
} | [
"public",
"CHGraph",
"chGraphCreate",
"(",
"Weighting",
"singleCHWeighting",
")",
"{",
"return",
"setCHGraph",
"(",
"singleCHWeighting",
")",
".",
"create",
"(",
")",
".",
"getGraph",
"(",
"CHGraph",
".",
"class",
",",
"singleCHWeighting",
")",
";",
"}"
] | Creates a CHGraph | [
"Creates",
"a",
"CHGraph"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphBuilder.java#L91-L93 |
21,132 | graphhopper/graphhopper | isochrone/src/main/java/com/graphhopper/isochrone/algorithm/Isochrone.java | Isochrone.setTimeLimit | public void setTimeLimit(double limit) {
exploreType = TIME;
this.limit = limit * 1000;
// we explore until all spt-entries are '>timeLimitInSeconds'
// and add some more into this bucket for car we need a bit more as
// we otherwise get artifacts for motorway endings
t... | java | public void setTimeLimit(double limit) {
exploreType = TIME;
this.limit = limit * 1000;
// we explore until all spt-entries are '>timeLimitInSeconds'
// and add some more into this bucket for car we need a bit more as
// we otherwise get artifacts for motorway endings
t... | [
"public",
"void",
"setTimeLimit",
"(",
"double",
"limit",
")",
"{",
"exploreType",
"=",
"TIME",
";",
"this",
".",
"limit",
"=",
"limit",
"*",
"1000",
";",
"// we explore until all spt-entries are '>timeLimitInSeconds' ",
"// and add some more into this bucket for car we nee... | Time limit in seconds | [
"Time",
"limit",
"in",
"seconds"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/isochrone/src/main/java/com/graphhopper/isochrone/algorithm/Isochrone.java#L88-L95 |
21,133 | graphhopper/graphhopper | isochrone/src/main/java/com/graphhopper/isochrone/algorithm/Isochrone.java | Isochrone.setDistanceLimit | public void setDistanceLimit(double limit) {
exploreType = DISTANCE;
this.limit = limit;
this.finishLimit = limit + Math.max(limit * 0.14, 2_000);
} | java | public void setDistanceLimit(double limit) {
exploreType = DISTANCE;
this.limit = limit;
this.finishLimit = limit + Math.max(limit * 0.14, 2_000);
} | [
"public",
"void",
"setDistanceLimit",
"(",
"double",
"limit",
")",
"{",
"exploreType",
"=",
"DISTANCE",
";",
"this",
".",
"limit",
"=",
"limit",
";",
"this",
".",
"finishLimit",
"=",
"limit",
"+",
"Math",
".",
"max",
"(",
"limit",
"*",
"0.14",
",",
"2_... | Distance limit in meter | [
"Distance",
"limit",
"in",
"meter"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/isochrone/src/main/java/com/graphhopper/isochrone/algorithm/Isochrone.java#L100-L104 |
21,134 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/index/BresenhamLine.java | BresenhamLine.calcPoints | public static void calcPoints(final double lat1, final double lon1,
final double lat2, final double lon2,
final PointEmitter emitter,
final double offsetLat, final double offsetLon,
fi... | java | public static void calcPoints(final double lat1, final double lon1,
final double lat2, final double lon2,
final PointEmitter emitter,
final double offsetLat, final double offsetLon,
fi... | [
"public",
"static",
"void",
"calcPoints",
"(",
"final",
"double",
"lat1",
",",
"final",
"double",
"lon1",
",",
"final",
"double",
"lat2",
",",
"final",
"double",
"lon2",
",",
"final",
"PointEmitter",
"emitter",
",",
"final",
"double",
"offsetLat",
",",
"fina... | Calls the Bresenham algorithm but make it working for double values | [
"Calls",
"the",
"Bresenham",
"algorithm",
"but",
"make",
"it",
"working",
"for",
"double",
"values"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/index/BresenhamLine.java#L65-L82 |
21,135 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/ch/EdgeBasedNodeContractor.java | EdgeBasedNodeContractor.loopShortcutNecessary | private boolean loopShortcutNecessary(int node, int firstOrigEdge, int lastOrigEdge, double loopWeight) {
EdgeIterator inIter = loopAvoidanceInEdgeExplorer.setBaseNode(node);
while (inIter.next()) {
EdgeIterator outIter = loopAvoidanceOutEdgeExplorer.setBaseNode(node);
double inT... | java | private boolean loopShortcutNecessary(int node, int firstOrigEdge, int lastOrigEdge, double loopWeight) {
EdgeIterator inIter = loopAvoidanceInEdgeExplorer.setBaseNode(node);
while (inIter.next()) {
EdgeIterator outIter = loopAvoidanceOutEdgeExplorer.setBaseNode(node);
double inT... | [
"private",
"boolean",
"loopShortcutNecessary",
"(",
"int",
"node",
",",
"int",
"firstOrigEdge",
",",
"int",
"lastOrigEdge",
",",
"double",
"loopWeight",
")",
"{",
"EdgeIterator",
"inIter",
"=",
"loopAvoidanceInEdgeExplorer",
".",
"setBaseNode",
"(",
"node",
")",
"... | A given potential loop shortcut is only necessary if there is at least one pair of original in- & out-edges for
which taking the loop is cheaper than doing the direct turn. However this is almost always the case, because
doing a u-turn at any of the incoming edges is forbidden, i.e. he costs of the direct turn will be ... | [
"A",
"given",
"potential",
"loop",
"shortcut",
"is",
"only",
"necessary",
"if",
"there",
"is",
"at",
"least",
"one",
"pair",
"of",
"original",
"in",
"-",
"&",
"out",
"-",
"edges",
"for",
"which",
"taking",
"the",
"loop",
"is",
"cheaper",
"than",
"doing",... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/ch/EdgeBasedNodeContractor.java#L244-L260 |
21,136 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/ch/WitnessPathSearcher.java | WitnessPathSearcher.initSearch | public int initSearch(int centerNode, int sourceNode, int sourceEdge) {
reset();
this.sourceEdge = sourceEdge;
this.sourceNode = sourceNode;
this.centerNode = centerNode;
setInitialEntries(sourceNode, sourceEdge, centerNode);
// if there is no entry that reaches the cente... | java | public int initSearch(int centerNode, int sourceNode, int sourceEdge) {
reset();
this.sourceEdge = sourceEdge;
this.sourceNode = sourceNode;
this.centerNode = centerNode;
setInitialEntries(sourceNode, sourceEdge, centerNode);
// if there is no entry that reaches the cente... | [
"public",
"int",
"initSearch",
"(",
"int",
"centerNode",
",",
"int",
"sourceNode",
",",
"int",
"sourceEdge",
")",
"{",
"reset",
"(",
")",
";",
"this",
".",
"sourceEdge",
"=",
"sourceEdge",
";",
"this",
".",
"sourceNode",
"=",
"sourceNode",
";",
"this",
"... | Deletes the shortest path tree that has been found so far and initializes a new witness path search for a given
node to be contracted and search edge.
@param centerNode the node to be contracted (x)
@param sourceNode the neighbor node from which the search starts (s)
@param sourceEdge the original edge incoming to s f... | [
"Deletes",
"the",
"shortest",
"path",
"tree",
"that",
"has",
"been",
"found",
"so",
"far",
"and",
"initializes",
"a",
"new",
"witness",
"path",
"search",
"for",
"a",
"given",
"node",
"to",
"be",
"contracted",
"and",
"search",
"edge",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/ch/WitnessPathSearcher.java#L143-L159 |
21,137 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/GHUtility.java | GHUtility.getProblems | public static List<String> getProblems(Graph g) {
List<String> problems = new ArrayList<>();
int nodes = g.getNodes();
int nodeIndex = 0;
NodeAccess na = g.getNodeAccess();
try {
EdgeExplorer explorer = g.createEdgeExplorer();
for (; nodeIndex < nodes; nod... | java | public static List<String> getProblems(Graph g) {
List<String> problems = new ArrayList<>();
int nodes = g.getNodes();
int nodeIndex = 0;
NodeAccess na = g.getNodeAccess();
try {
EdgeExplorer explorer = g.createEdgeExplorer();
for (; nodeIndex < nodes; nod... | [
"public",
"static",
"List",
"<",
"String",
">",
"getProblems",
"(",
"Graph",
"g",
")",
"{",
"List",
"<",
"String",
">",
"problems",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"nodes",
"=",
"g",
".",
"getNodes",
"(",
")",
";",
"int",
"node... | This method could throw an exception if problems like index out of bounds etc | [
"This",
"method",
"could",
"throw",
"an",
"exception",
"if",
"problems",
"like",
"index",
"out",
"of",
"bounds",
"etc"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/GHUtility.java#L49-L83 |
21,138 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/GHUtility.java | GHUtility.newStorage | public static GraphHopperStorage newStorage(GraphHopperStorage store) {
Directory outdir = guessDirectory(store);
boolean is3D = store.getNodeAccess().is3D();
return new GraphHopperStorage(store.getNodeBasedCHWeightings(), store.getEdgeBasedCHWeightings(), outdir, store.getEncodingManager(),
... | java | public static GraphHopperStorage newStorage(GraphHopperStorage store) {
Directory outdir = guessDirectory(store);
boolean is3D = store.getNodeAccess().is3D();
return new GraphHopperStorage(store.getNodeBasedCHWeightings(), store.getEdgeBasedCHWeightings(), outdir, store.getEncodingManager(),
... | [
"public",
"static",
"GraphHopperStorage",
"newStorage",
"(",
"GraphHopperStorage",
"store",
")",
"{",
"Directory",
"outdir",
"=",
"guessDirectory",
"(",
"store",
")",
";",
"boolean",
"is3D",
"=",
"store",
".",
"getNodeAccess",
"(",
")",
".",
"is3D",
"(",
")",
... | Create a new storage from the specified one without copying the data. | [
"Create",
"a",
"new",
"storage",
"from",
"the",
"specified",
"one",
"without",
"copying",
"the",
"data",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/GHUtility.java#L397-L404 |
21,139 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/GHUtility.java | GHUtility.createEdgeKey | public static int createEdgeKey(int nodeA, int nodeB, int edgeId, boolean reverse) {
edgeId = edgeId << 1;
if (reverse)
return (nodeA > nodeB) ? edgeId : edgeId + 1;
return (nodeA > nodeB) ? edgeId + 1 : edgeId;
} | java | public static int createEdgeKey(int nodeA, int nodeB, int edgeId, boolean reverse) {
edgeId = edgeId << 1;
if (reverse)
return (nodeA > nodeB) ? edgeId : edgeId + 1;
return (nodeA > nodeB) ? edgeId + 1 : edgeId;
} | [
"public",
"static",
"int",
"createEdgeKey",
"(",
"int",
"nodeA",
",",
"int",
"nodeB",
",",
"int",
"edgeId",
",",
"boolean",
"reverse",
")",
"{",
"edgeId",
"=",
"edgeId",
"<<",
"1",
";",
"if",
"(",
"reverse",
")",
"return",
"(",
"nodeA",
">",
"nodeB",
... | Creates unique positive number for specified edgeId taking into account the direction defined
by nodeA, nodeB and reverse. | [
"Creates",
"unique",
"positive",
"number",
"for",
"specified",
"edgeId",
"taking",
"into",
"account",
"the",
"direction",
"defined",
"by",
"nodeA",
"nodeB",
"and",
"reverse",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/GHUtility.java#L465-L470 |
21,140 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/GHUtility.java | GHUtility.getEdgeKey | public static int getEdgeKey(Graph graph, int edgeId, int node, boolean reverse) {
EdgeIteratorState edgeIteratorState = graph.getEdgeIteratorState(edgeId, node);
return GHUtility.createEdgeKey(edgeIteratorState.getBaseNode(), edgeIteratorState.getAdjNode(), edgeId, reverse);
} | java | public static int getEdgeKey(Graph graph, int edgeId, int node, boolean reverse) {
EdgeIteratorState edgeIteratorState = graph.getEdgeIteratorState(edgeId, node);
return GHUtility.createEdgeKey(edgeIteratorState.getBaseNode(), edgeIteratorState.getAdjNode(), edgeId, reverse);
} | [
"public",
"static",
"int",
"getEdgeKey",
"(",
"Graph",
"graph",
",",
"int",
"edgeId",
",",
"int",
"node",
",",
"boolean",
"reverse",
")",
"{",
"EdgeIteratorState",
"edgeIteratorState",
"=",
"graph",
".",
"getEdgeIteratorState",
"(",
"edgeId",
",",
"node",
")",... | Returns the edge key for a given edge id and adjacent node. This is needed in a few places where
the base node is not known. | [
"Returns",
"the",
"edge",
"key",
"for",
"a",
"given",
"edge",
"id",
"and",
"adjacent",
"node",
".",
"This",
"is",
"needed",
"in",
"a",
"few",
"places",
"where",
"the",
"base",
"node",
"is",
"not",
"known",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/GHUtility.java#L498-L501 |
21,141 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/GermanySpatialRule.java | GermanySpatialRule.getMaxSpeed | @Override
public double getMaxSpeed(String highwayTag, double _default) {
// As defined in: https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Maxspeed#Motorcar
switch (highwayTag) {
case "motorway":
return Integer.MAX_VALUE;
case "trunk":
... | java | @Override
public double getMaxSpeed(String highwayTag, double _default) {
// As defined in: https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Maxspeed#Motorcar
switch (highwayTag) {
case "motorway":
return Integer.MAX_VALUE;
case "trunk":
... | [
"@",
"Override",
"public",
"double",
"getMaxSpeed",
"(",
"String",
"highwayTag",
",",
"double",
"_default",
")",
"{",
"// As defined in: https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Maxspeed#Motorcar",
"switch",
"(",
"highwayTag",
")",
"{",
"case",
"\"motorway\"",... | Germany contains roads with no speed limit. For these roads, this method will return Integer.MAX_VALUE.
Your implementation should be able to handle these cases. | [
"Germany",
"contains",
"roads",
"with",
"no",
"speed",
"limit",
".",
"For",
"these",
"roads",
"this",
"method",
"will",
"return",
"Integer",
".",
"MAX_VALUE",
".",
"Your",
"implementation",
"should",
"be",
"able",
"to",
"handle",
"these",
"cases",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/GermanySpatialRule.java#L34-L49 |
21,142 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/PathMerger.java | PathMerger.updateInstructionsWithContext | private InstructionList updateInstructionsWithContext(InstructionList instructions) {
Instruction instruction;
Instruction nextInstruction;
for (int i = 0; i < instructions.size() - 1; i++) {
instruction = instructions.get(i);
if (i == 0 && !Double.isNaN(favoredHeading)... | java | private InstructionList updateInstructionsWithContext(InstructionList instructions) {
Instruction instruction;
Instruction nextInstruction;
for (int i = 0; i < instructions.size() - 1; i++) {
instruction = instructions.get(i);
if (i == 0 && !Double.isNaN(favoredHeading)... | [
"private",
"InstructionList",
"updateInstructionsWithContext",
"(",
"InstructionList",
"instructions",
")",
"{",
"Instruction",
"instruction",
";",
"Instruction",
"nextInstruction",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"instructions",
".",
"size",
... | This method iterates over all instructions and uses the available context to improve the instructions.
If the requests contains a heading, this method can transform the first continue to a u-turn if the heading
points into the opposite direction of the route.
At a waypoint it can transform the continue to a u-turn if t... | [
"This",
"method",
"iterates",
"over",
"all",
"instructions",
"and",
"uses",
"the",
"available",
"context",
"to",
"improve",
"the",
"instructions",
".",
"If",
"the",
"requests",
"contains",
"a",
"heading",
"this",
"method",
"can",
"transform",
"the",
"first",
"... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/PathMerger.java#L168-L205 |
21,143 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/DouglasPeucker.java | DouglasPeucker.subSimplify | int subSimplify(PointList points, int fromIndex, int lastIndex) {
if (lastIndex - fromIndex < 2) {
return 0;
}
int indexWithMaxDist = -1;
double maxDist = -1;
double firstLat = points.getLatitude(fromIndex);
double firstLon = points.getLongitude(fromIndex);
... | java | int subSimplify(PointList points, int fromIndex, int lastIndex) {
if (lastIndex - fromIndex < 2) {
return 0;
}
int indexWithMaxDist = -1;
double maxDist = -1;
double firstLat = points.getLatitude(fromIndex);
double firstLon = points.getLongitude(fromIndex);
... | [
"int",
"subSimplify",
"(",
"PointList",
"points",
",",
"int",
"fromIndex",
",",
"int",
"lastIndex",
")",
"{",
"if",
"(",
"lastIndex",
"-",
"fromIndex",
"<",
"2",
")",
"{",
"return",
"0",
";",
"}",
"int",
"indexWithMaxDist",
"=",
"-",
"1",
";",
"double"... | keep the points of fromIndex and lastIndex | [
"keep",
"the",
"points",
"of",
"fromIndex",
"and",
"lastIndex"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/DouglasPeucker.java#L130-L168 |
21,144 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java | PrepareRoutingSubnetworks.findSubnetworks | List<IntArrayList> findSubnetworks(PrepEdgeFilter filter) {
final BooleanEncodedValue accessEnc = filter.getAccessEnc();
final EdgeExplorer explorer = ghStorage.createEdgeExplorer(filter);
int locs = ghStorage.getNodes();
List<IntArrayList> list = new ArrayList<>(100);
final GHBi... | java | List<IntArrayList> findSubnetworks(PrepEdgeFilter filter) {
final BooleanEncodedValue accessEnc = filter.getAccessEnc();
final EdgeExplorer explorer = ghStorage.createEdgeExplorer(filter);
int locs = ghStorage.getNodes();
List<IntArrayList> list = new ArrayList<>(100);
final GHBi... | [
"List",
"<",
"IntArrayList",
">",
"findSubnetworks",
"(",
"PrepEdgeFilter",
"filter",
")",
"{",
"final",
"BooleanEncodedValue",
"accessEnc",
"=",
"filter",
".",
"getAccessEnc",
"(",
")",
";",
"final",
"EdgeExplorer",
"explorer",
"=",
"ghStorage",
".",
"createEdgeE... | This method finds the double linked components according to the specified filter. | [
"This",
"method",
"finds",
"the",
"double",
"linked",
"components",
"according",
"to",
"the",
"specified",
"filter",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java#L107-L150 |
21,145 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java | PrepareRoutingSubnetworks.keepLargeNetworks | int keepLargeNetworks(PrepEdgeFilter filter, List<IntArrayList> components) {
if (components.size() <= 1)
return 0;
int maxCount = -1;
IntIndexedContainer oldComponent = null;
int allRemoved = 0;
BooleanEncodedValue accessEnc = filter.getAccessEnc();
EdgeExpl... | java | int keepLargeNetworks(PrepEdgeFilter filter, List<IntArrayList> components) {
if (components.size() <= 1)
return 0;
int maxCount = -1;
IntIndexedContainer oldComponent = null;
int allRemoved = 0;
BooleanEncodedValue accessEnc = filter.getAccessEnc();
EdgeExpl... | [
"int",
"keepLargeNetworks",
"(",
"PrepEdgeFilter",
"filter",
",",
"List",
"<",
"IntArrayList",
">",
"components",
")",
"{",
"if",
"(",
"components",
".",
"size",
"(",
")",
"<=",
"1",
")",
"return",
"0",
";",
"int",
"maxCount",
"=",
"-",
"1",
";",
"IntI... | Deletes all but the largest subnetworks. | [
"Deletes",
"all",
"but",
"the",
"largest",
"subnetworks",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java#L155-L188 |
21,146 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java | PrepareRoutingSubnetworks.removeEdges | int removeEdges(final PrepEdgeFilter bothFilter, List<IntArrayList> components, int min) {
// remove edges determined from nodes but only if less than minimum size
EdgeExplorer explorer = ghStorage.createEdgeExplorer(bothFilter);
int removedEdges = 0;
for (IntArrayList component : compon... | java | int removeEdges(final PrepEdgeFilter bothFilter, List<IntArrayList> components, int min) {
// remove edges determined from nodes but only if less than minimum size
EdgeExplorer explorer = ghStorage.createEdgeExplorer(bothFilter);
int removedEdges = 0;
for (IntArrayList component : compon... | [
"int",
"removeEdges",
"(",
"final",
"PrepEdgeFilter",
"bothFilter",
",",
"List",
"<",
"IntArrayList",
">",
"components",
",",
"int",
"min",
")",
"{",
"// remove edges determined from nodes but only if less than minimum size",
"EdgeExplorer",
"explorer",
"=",
"ghStorage",
... | This method removes the access to edges available from the nodes contained in the components.
But only if a components' size is smaller then the specified min value.
@return number of removed edges | [
"This",
"method",
"removes",
"the",
"access",
"to",
"edges",
"available",
"from",
"the",
"nodes",
"contained",
"in",
"the",
"components",
".",
"But",
"only",
"if",
"a",
"components",
"size",
"is",
"smaller",
"then",
"the",
"specified",
"min",
"value",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java#L216-L224 |
21,147 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java | PrepareRoutingSubnetworks.markNodesRemovedIfUnreachable | void markNodesRemovedIfUnreachable() {
EdgeExplorer edgeExplorer = ghStorage.createEdgeExplorer();
for (int nodeIndex = 0; nodeIndex < ghStorage.getNodes(); nodeIndex++) {
if (detectNodeRemovedForAllEncoders(edgeExplorer, nodeIndex))
ghStorage.markNodeRemoved(nodeIndex);
... | java | void markNodesRemovedIfUnreachable() {
EdgeExplorer edgeExplorer = ghStorage.createEdgeExplorer();
for (int nodeIndex = 0; nodeIndex < ghStorage.getNodes(); nodeIndex++) {
if (detectNodeRemovedForAllEncoders(edgeExplorer, nodeIndex))
ghStorage.markNodeRemoved(nodeIndex);
... | [
"void",
"markNodesRemovedIfUnreachable",
"(",
")",
"{",
"EdgeExplorer",
"edgeExplorer",
"=",
"ghStorage",
".",
"createEdgeExplorer",
"(",
")",
";",
"for",
"(",
"int",
"nodeIndex",
"=",
"0",
";",
"nodeIndex",
"<",
"ghStorage",
".",
"getNodes",
"(",
")",
";",
... | Removes nodes if all edges are not accessible. I.e. removes zero degree nodes. | [
"Removes",
"nodes",
"if",
"all",
"edges",
"are",
"not",
"accessible",
".",
"I",
".",
"e",
".",
"removes",
"zero",
"degree",
"nodes",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java#L244-L250 |
21,148 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java | PrepareRoutingSubnetworks.detectNodeRemovedForAllEncoders | boolean detectNodeRemovedForAllEncoders(EdgeExplorer edgeExplorerAllEdges, int nodeIndex) {
// we could implement a 'fast check' for several previously marked removed nodes via GHBitSet
// removedNodesPerVehicle. The problem is that we would need long-indices but BitSet only supports int (due to nodeIn... | java | boolean detectNodeRemovedForAllEncoders(EdgeExplorer edgeExplorerAllEdges, int nodeIndex) {
// we could implement a 'fast check' for several previously marked removed nodes via GHBitSet
// removedNodesPerVehicle. The problem is that we would need long-indices but BitSet only supports int (due to nodeIn... | [
"boolean",
"detectNodeRemovedForAllEncoders",
"(",
"EdgeExplorer",
"edgeExplorerAllEdges",
",",
"int",
"nodeIndex",
")",
"{",
"// we could implement a 'fast check' for several previously marked removed nodes via GHBitSet ",
"// removedNodesPerVehicle. The problem is that we would need long-ind... | This method checks if the node is removed or inaccessible for ALL encoders.
@return true if no edges are reachable from the specified nodeIndex for any flag encoder. | [
"This",
"method",
"checks",
"if",
"the",
"node",
"is",
"removed",
"or",
"inaccessible",
"for",
"ALL",
"encoders",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java#L257-L272 |
21,149 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/coll/CompressedArray.java | CompressedArray.decompress | public static byte[] decompress(byte[] value) throws DataFormatException {
// Create an expandable byte array to hold the decompressed data
ByteArrayOutputStream bos = new ByteArrayOutputStream(value.length);
Inflater decompressor = new Inflater();
try {
decompressor.setInput... | java | public static byte[] decompress(byte[] value) throws DataFormatException {
// Create an expandable byte array to hold the decompressed data
ByteArrayOutputStream bos = new ByteArrayOutputStream(value.length);
Inflater decompressor = new Inflater();
try {
decompressor.setInput... | [
"public",
"static",
"byte",
"[",
"]",
"decompress",
"(",
"byte",
"[",
"]",
"value",
")",
"throws",
"DataFormatException",
"{",
"// Create an expandable byte array to hold the decompressed data",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
"va... | Decompress the byte array previously returned by compress | [
"Decompress",
"the",
"byte",
"array",
"previously",
"returned",
"by",
"compress"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/coll/CompressedArray.java#L96-L112 |
21,150 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/TurnCostExtension.java | TurnCostExtension.addTurnInfo | public void addTurnInfo(int fromEdge, int viaNode, int toEdge, long turnFlags) {
// no need to store turn information
if (turnFlags == EMPTY_FLAGS)
return;
mergeOrOverwriteTurnInfo(fromEdge, viaNode, toEdge, turnFlags, true);
} | java | public void addTurnInfo(int fromEdge, int viaNode, int toEdge, long turnFlags) {
// no need to store turn information
if (turnFlags == EMPTY_FLAGS)
return;
mergeOrOverwriteTurnInfo(fromEdge, viaNode, toEdge, turnFlags, true);
} | [
"public",
"void",
"addTurnInfo",
"(",
"int",
"fromEdge",
",",
"int",
"viaNode",
",",
"int",
"toEdge",
",",
"long",
"turnFlags",
")",
"{",
"// no need to store turn information",
"if",
"(",
"turnFlags",
"==",
"EMPTY_FLAGS",
")",
"return",
";",
"mergeOrOverwriteTurn... | Add an entry which is a turn restriction or cost information via the turnFlags. Overwrite existing information
if it is the same edges and node. | [
"Add",
"an",
"entry",
"which",
"is",
"a",
"turn",
"restriction",
"or",
"cost",
"information",
"via",
"the",
"turnFlags",
".",
"Overwrite",
"existing",
"information",
"if",
"it",
"is",
"the",
"same",
"edges",
"and",
"node",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/TurnCostExtension.java#L113-L119 |
21,151 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/TurnCostExtension.java | TurnCostExtension.mergeOrOverwriteTurnInfo | public void mergeOrOverwriteTurnInfo(int fromEdge, int viaNode, int toEdge, long turnFlags, boolean merge) {
int newEntryIndex = turnCostsCount;
ensureTurnCostIndex(newEntryIndex);
boolean oldEntryFound = false;
long newFlags = turnFlags;
int next = NO_TURN_ENTRY;
// det... | java | public void mergeOrOverwriteTurnInfo(int fromEdge, int viaNode, int toEdge, long turnFlags, boolean merge) {
int newEntryIndex = turnCostsCount;
ensureTurnCostIndex(newEntryIndex);
boolean oldEntryFound = false;
long newFlags = turnFlags;
int next = NO_TURN_ENTRY;
// det... | [
"public",
"void",
"mergeOrOverwriteTurnInfo",
"(",
"int",
"fromEdge",
",",
"int",
"viaNode",
",",
"int",
"toEdge",
",",
"long",
"turnFlags",
",",
"boolean",
"merge",
")",
"{",
"int",
"newEntryIndex",
"=",
"turnCostsCount",
";",
"ensureTurnCostIndex",
"(",
"newEn... | Add a new turn cost entry or clear an existing. See tests for usage examples.
@param fromEdge edge ID
@param viaNode node ID
@param toEdge edge ID
@param turnFlags flags to be written
@param merge If true don't overwrite existing entries with the new flag but do a bitwise OR of the old and
new flags and writ... | [
"Add",
"a",
"new",
"turn",
"cost",
"entry",
"or",
"clear",
"an",
"existing",
".",
"See",
"tests",
"for",
"usage",
"examples",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/TurnCostExtension.java#L131-L186 |
21,152 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/PathWrapper.java | PathWrapper.calcBBox2D | public BBox calcBBox2D() {
check("calcRouteBBox");
BBox bounds = BBox.createInverse(false);
for (int i = 0; i < pointList.getSize(); i++) {
bounds.update(pointList.getLatitude(i), pointList.getLongitude(i));
}
return bounds;
} | java | public BBox calcBBox2D() {
check("calcRouteBBox");
BBox bounds = BBox.createInverse(false);
for (int i = 0; i < pointList.getSize(); i++) {
bounds.update(pointList.getLatitude(i), pointList.getLongitude(i));
}
return bounds;
} | [
"public",
"BBox",
"calcBBox2D",
"(",
")",
"{",
"check",
"(",
"\"calcRouteBBox\"",
")",
";",
"BBox",
"bounds",
"=",
"BBox",
".",
"createInverse",
"(",
"false",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pointList",
".",
"getSize",
"("... | Calculates the 2D bounding box of this route | [
"Calculates",
"the",
"2D",
"bounding",
"box",
"of",
"this",
"route"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/PathWrapper.java#L202-L209 |
21,153 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/details/AbstractPathDetailsBuilder.java | AbstractPathDetailsBuilder.endInterval | public void endInterval(int lastIndex) {
if (isOpen) {
currentDetail.setLast(lastIndex);
pathDetails.add(currentDetail);
}
isOpen = false;
} | java | public void endInterval(int lastIndex) {
if (isOpen) {
currentDetail.setLast(lastIndex);
pathDetails.add(currentDetail);
}
isOpen = false;
} | [
"public",
"void",
"endInterval",
"(",
"int",
"lastIndex",
")",
"{",
"if",
"(",
"isOpen",
")",
"{",
"currentDetail",
".",
"setLast",
"(",
"lastIndex",
")",
";",
"pathDetails",
".",
"add",
"(",
"currentDetail",
")",
";",
"}",
"isOpen",
"=",
"false",
";",
... | Ending intervals multiple times is safe, we only write the interval if it was open and not empty.
Writes the interval to the pathDetails
@param lastIndex the index the PathDetail ends | [
"Ending",
"intervals",
"multiple",
"times",
"is",
"safe",
"we",
"only",
"write",
"the",
"interval",
"if",
"it",
"was",
"open",
"and",
"not",
"empty",
".",
"Writes",
"the",
"interval",
"to",
"the",
"pathDetails"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/details/AbstractPathDetailsBuilder.java#L71-L77 |
21,154 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/DepthFirstSearch.java | DepthFirstSearch.start | @Override
public void start(EdgeExplorer explorer, int startNode) {
IntArrayDeque stack = new IntArrayDeque();
GHBitSet explored = createBitSet();
stack.addLast(startNode);
int current;
while (stack.size() > 0) {
current = stack.removeLast();
if (!exp... | java | @Override
public void start(EdgeExplorer explorer, int startNode) {
IntArrayDeque stack = new IntArrayDeque();
GHBitSet explored = createBitSet();
stack.addLast(startNode);
int current;
while (stack.size() > 0) {
current = stack.removeLast();
if (!exp... | [
"@",
"Override",
"public",
"void",
"start",
"(",
"EdgeExplorer",
"explorer",
",",
"int",
"startNode",
")",
"{",
"IntArrayDeque",
"stack",
"=",
"new",
"IntArrayDeque",
"(",
")",
";",
"GHBitSet",
"explored",
"=",
"createBitSet",
"(",
")",
";",
"stack",
".",
... | beginning with startNode add all following nodes to LIFO queue. If node has been already
explored before, skip reexploration. | [
"beginning",
"with",
"startNode",
"add",
"all",
"following",
"nodes",
"to",
"LIFO",
"queue",
".",
"If",
"node",
"has",
"been",
"already",
"explored",
"before",
"skip",
"reexploration",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/DepthFirstSearch.java#L35-L55 |
21,155 | graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java | OSMReader.preProcess | void preProcess(File osmFile) {
try (OSMInput in = openOsmInputFile(osmFile)) {
long tmpWayCounter = 1;
long tmpRelationCounter = 1;
ReaderElement item;
while ((item = in.getNext()) != null) {
if (item.isType(ReaderElement.WAY)) {
... | java | void preProcess(File osmFile) {
try (OSMInput in = openOsmInputFile(osmFile)) {
long tmpWayCounter = 1;
long tmpRelationCounter = 1;
ReaderElement item;
while ((item = in.getNext()) != null) {
if (item.isType(ReaderElement.WAY)) {
... | [
"void",
"preProcess",
"(",
"File",
"osmFile",
")",
"{",
"try",
"(",
"OSMInput",
"in",
"=",
"openOsmInputFile",
"(",
"osmFile",
")",
")",
"{",
"long",
"tmpWayCounter",
"=",
"1",
";",
"long",
"tmpRelationCounter",
"=",
"1",
";",
"ReaderElement",
"item",
";",... | Preprocessing of OSM file to select nodes which are used for highways. This allows a more
compact graph data structure. | [
"Preprocessing",
"of",
"OSM",
"file",
"to",
"select",
"nodes",
"which",
"are",
"used",
"for",
"highways",
".",
"This",
"allows",
"a",
"more",
"compact",
"graph",
"data",
"structure",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java#L158-L200 |
21,156 | graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java | OSMReader.filterWay | boolean filterWay(ReaderWay item) {
// ignore broken geometry
if (item.getNodes().size() < 2)
return false;
// ignore multipolygon geometry
if (!item.hasTags())
return false;
return encodingManager.acceptWay(item, new EncodingManager.AcceptWay());
} | java | boolean filterWay(ReaderWay item) {
// ignore broken geometry
if (item.getNodes().size() < 2)
return false;
// ignore multipolygon geometry
if (!item.hasTags())
return false;
return encodingManager.acceptWay(item, new EncodingManager.AcceptWay());
} | [
"boolean",
"filterWay",
"(",
"ReaderWay",
"item",
")",
"{",
"// ignore broken geometry",
"if",
"(",
"item",
".",
"getNodes",
"(",
")",
".",
"size",
"(",
")",
"<",
"2",
")",
"return",
"false",
";",
"// ignore multipolygon geometry",
"if",
"(",
"!",
"item",
... | Filter ways but do not analyze properties wayNodes will be filled with participating node ids.
@return true the current xml entry is a way entry and has nodes | [
"Filter",
"ways",
"but",
"do",
"not",
"analyze",
"properties",
"wayNodes",
"will",
"be",
"filled",
"with",
"participating",
"node",
"ids",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java#L229-L239 |
21,157 | graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java | OSMReader.writeOsm2Graph | private void writeOsm2Graph(File osmFile) {
int tmp = (int) Math.max(getNodeMap().getSize() / 50, 100);
LOGGER.info("creating graph. Found nodes (pillar+tower):" + nf(getNodeMap().getSize()) + ", " + Helper.getMemInfo());
if (createStorage)
ghStorage.create(tmp);
long waySta... | java | private void writeOsm2Graph(File osmFile) {
int tmp = (int) Math.max(getNodeMap().getSize() / 50, 100);
LOGGER.info("creating graph. Found nodes (pillar+tower):" + nf(getNodeMap().getSize()) + ", " + Helper.getMemInfo());
if (createStorage)
ghStorage.create(tmp);
long waySta... | [
"private",
"void",
"writeOsm2Graph",
"(",
"File",
"osmFile",
")",
"{",
"int",
"tmp",
"=",
"(",
"int",
")",
"Math",
".",
"max",
"(",
"getNodeMap",
"(",
")",
".",
"getSize",
"(",
")",
"/",
"50",
",",
"100",
")",
";",
"LOGGER",
".",
"info",
"(",
"\"... | Creates the graph with edges and nodes from the specified osm file. | [
"Creates",
"the",
"graph",
"with",
"edges",
"and",
"nodes",
"from",
"the",
"specified",
"osm",
"file",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java#L244-L300 |
21,158 | graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java | OSMReader.isOnePassable | private static boolean isOnePassable(List<BooleanEncodedValue> checkEncoders, IntsRef edgeFlags) {
for (BooleanEncodedValue accessEnc : checkEncoders) {
if (accessEnc.getBool(false, edgeFlags) || accessEnc.getBool(true, edgeFlags))
return true;
}
return false;
} | java | private static boolean isOnePassable(List<BooleanEncodedValue> checkEncoders, IntsRef edgeFlags) {
for (BooleanEncodedValue accessEnc : checkEncoders) {
if (accessEnc.getBool(false, edgeFlags) || accessEnc.getBool(true, edgeFlags))
return true;
}
return false;
} | [
"private",
"static",
"boolean",
"isOnePassable",
"(",
"List",
"<",
"BooleanEncodedValue",
">",
"checkEncoders",
",",
"IntsRef",
"edgeFlags",
")",
"{",
"for",
"(",
"BooleanEncodedValue",
"accessEnc",
":",
"checkEncoders",
")",
"{",
"if",
"(",
"accessEnc",
".",
"g... | The nodeFlags store the encoders to check for accessibility in edgeFlags. E.g. if nodeFlags==3, then the
accessibility of the first two encoders will be check in edgeFlags | [
"The",
"nodeFlags",
"store",
"the",
"encoders",
"to",
"check",
"for",
"accessibility",
"in",
"edgeFlags",
".",
"E",
".",
"g",
".",
"if",
"nodeFlags",
"==",
"3",
"then",
"the",
"accessibility",
"of",
"the",
"first",
"two",
"encoders",
"will",
"be",
"check",... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java#L553-L559 |
21,159 | graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java | OSMReader.storeOsmWayID | protected void storeOsmWayID(int edgeId, long osmWayId) {
if (getOsmWayIdSet().contains(osmWayId)) {
getEdgeIdToOsmWayIdMap().put(edgeId, osmWayId);
}
} | java | protected void storeOsmWayID(int edgeId, long osmWayId) {
if (getOsmWayIdSet().contains(osmWayId)) {
getEdgeIdToOsmWayIdMap().put(edgeId, osmWayId);
}
} | [
"protected",
"void",
"storeOsmWayID",
"(",
"int",
"edgeId",
",",
"long",
"osmWayId",
")",
"{",
"if",
"(",
"getOsmWayIdSet",
"(",
")",
".",
"contains",
"(",
"osmWayId",
")",
")",
"{",
"getEdgeIdToOsmWayIdMap",
"(",
")",
".",
"put",
"(",
"edgeId",
",",
"os... | Stores only osmWayIds which are required for relations | [
"Stores",
"only",
"osmWayIds",
"which",
"are",
"required",
"for",
"relations"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java#L775-L779 |
21,160 | graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java | OSMReader.addBarrierNode | long addBarrierNode(long nodeId) {
ReaderNode newNode;
int graphIndex = getNodeMap().get(nodeId);
if (graphIndex < TOWER_NODE) {
graphIndex = -graphIndex - 3;
newNode = new ReaderNode(createNewNodeId(), nodeAccess, graphIndex);
} else {
graphIndex = gr... | java | long addBarrierNode(long nodeId) {
ReaderNode newNode;
int graphIndex = getNodeMap().get(nodeId);
if (graphIndex < TOWER_NODE) {
graphIndex = -graphIndex - 3;
newNode = new ReaderNode(createNewNodeId(), nodeAccess, graphIndex);
} else {
graphIndex = gr... | [
"long",
"addBarrierNode",
"(",
"long",
"nodeId",
")",
"{",
"ReaderNode",
"newNode",
";",
"int",
"graphIndex",
"=",
"getNodeMap",
"(",
")",
".",
"get",
"(",
"nodeId",
")",
";",
"if",
"(",
"graphIndex",
"<",
"TOWER_NODE",
")",
"{",
"graphIndex",
"=",
"-",
... | Create a copy of the barrier node | [
"Create",
"a",
"copy",
"of",
"the",
"barrier",
"node"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java#L819-L834 |
21,161 | graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java | OSMReader.addBarrierEdge | Collection<EdgeIteratorState> addBarrierEdge(long fromId, long toId, IntsRef inEdgeFlags, long nodeFlags, long wayOsmId) {
IntsRef edgeFlags = IntsRef.deepCopyOf(inEdgeFlags);
// clear blocked directions from flags
for (BooleanEncodedValue accessEnc : encodingManager.getAccessEncFromNodeFlags(no... | java | Collection<EdgeIteratorState> addBarrierEdge(long fromId, long toId, IntsRef inEdgeFlags, long nodeFlags, long wayOsmId) {
IntsRef edgeFlags = IntsRef.deepCopyOf(inEdgeFlags);
// clear blocked directions from flags
for (BooleanEncodedValue accessEnc : encodingManager.getAccessEncFromNodeFlags(no... | [
"Collection",
"<",
"EdgeIteratorState",
">",
"addBarrierEdge",
"(",
"long",
"fromId",
",",
"long",
"toId",
",",
"IntsRef",
"inEdgeFlags",
",",
"long",
"nodeFlags",
",",
"long",
"wayOsmId",
")",
"{",
"IntsRef",
"edgeFlags",
"=",
"IntsRef",
".",
"deepCopyOf",
"(... | Add a zero length edge with reduced routing options to the graph. | [
"Add",
"a",
"zero",
"length",
"edge",
"with",
"reduced",
"routing",
"options",
"to",
"the",
"graph",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java#L843-L855 |
21,162 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/SubnetworkStorage.java | SubnetworkStorage.setSubnetwork | public void setSubnetwork(int nodeId, int subnetwork) {
if (subnetwork > 127)
throw new IllegalArgumentException("Number of subnetworks is currently limited to 127 but requested " + subnetwork);
byte[] bytes = new byte[1];
bytes[0] = (byte) subnetwork;
da.setBytes(nodeId, by... | java | public void setSubnetwork(int nodeId, int subnetwork) {
if (subnetwork > 127)
throw new IllegalArgumentException("Number of subnetworks is currently limited to 127 but requested " + subnetwork);
byte[] bytes = new byte[1];
bytes[0] = (byte) subnetwork;
da.setBytes(nodeId, by... | [
"public",
"void",
"setSubnetwork",
"(",
"int",
"nodeId",
",",
"int",
"subnetwork",
")",
"{",
"if",
"(",
"subnetwork",
">",
"127",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Number of subnetworks is currently limited to 127 but requested \"",
"+",
"subnetwo... | This method sets the subnetwork if of the specified nodeId. Default is 0 and means subnetwork
was too small to be useful to be stored. | [
"This",
"method",
"sets",
"the",
"subnetwork",
"if",
"of",
"the",
"specified",
"nodeId",
".",
"Default",
"is",
"0",
"and",
"means",
"subnetwork",
"was",
"too",
"small",
"to",
"be",
"useful",
"to",
"be",
"stored",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/SubnetworkStorage.java#L54-L61 |
21,163 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/BaseGraph.java | BaseGraph.initNodeRefs | void initNodeRefs(long oldCapacity, long newCapacity) {
for (long pointer = oldCapacity + N_EDGE_REF; pointer < newCapacity; pointer += nodeEntryBytes) {
nodes.setInt(pointer, EdgeIterator.NO_EDGE);
}
if (extStorage.isRequireNodeField()) {
for (long pointer = oldCapacity ... | java | void initNodeRefs(long oldCapacity, long newCapacity) {
for (long pointer = oldCapacity + N_EDGE_REF; pointer < newCapacity; pointer += nodeEntryBytes) {
nodes.setInt(pointer, EdgeIterator.NO_EDGE);
}
if (extStorage.isRequireNodeField()) {
for (long pointer = oldCapacity ... | [
"void",
"initNodeRefs",
"(",
"long",
"oldCapacity",
",",
"long",
"newCapacity",
")",
"{",
"for",
"(",
"long",
"pointer",
"=",
"oldCapacity",
"+",
"N_EDGE_REF",
";",
"pointer",
"<",
"newCapacity",
";",
"pointer",
"+=",
"nodeEntryBytes",
")",
"{",
"nodes",
"."... | Initializes the node area with the empty edge value and default additional value. | [
"Initializes",
"the",
"node",
"area",
"with",
"the",
"empty",
"edge",
"value",
"and",
"default",
"additional",
"value",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/BaseGraph.java#L258-L267 |
21,164 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/BaseGraph.java | BaseGraph.ensureNodeIndex | final void ensureNodeIndex(int nodeIndex) {
if (!initialized)
throw new AssertionError("The graph has not yet been initialized.");
if (nodeIndex < nodeCount)
return;
long oldNodes = nodeCount;
nodeCount = nodeIndex + 1;
boolean capacityIncreased = nodes.... | java | final void ensureNodeIndex(int nodeIndex) {
if (!initialized)
throw new AssertionError("The graph has not yet been initialized.");
if (nodeIndex < nodeCount)
return;
long oldNodes = nodeCount;
nodeCount = nodeIndex + 1;
boolean capacityIncreased = nodes.... | [
"final",
"void",
"ensureNodeIndex",
"(",
"int",
"nodeIndex",
")",
"{",
"if",
"(",
"!",
"initialized",
")",
"throw",
"new",
"AssertionError",
"(",
"\"The graph has not yet been initialized.\"",
")",
";",
"if",
"(",
"nodeIndex",
"<",
"nodeCount",
")",
"return",
";... | Check if byte capacity of DataAcess nodes object is sufficient to include node index, else
extend byte capacity | [
"Check",
"if",
"byte",
"capacity",
"of",
"DataAcess",
"nodes",
"object",
"is",
"sufficient",
"to",
"include",
"node",
"index",
"else",
"extend",
"byte",
"capacity"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/BaseGraph.java#L290-L304 |
21,165 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/BaseGraph.java | BaseGraph.edge | @Override
public EdgeIteratorState edge(int nodeA, int nodeB) {
if (isFrozen())
throw new IllegalStateException("Cannot create edge if graph is already frozen");
ensureNodeIndex(Math.max(nodeA, nodeB));
int edgeId = edgeAccess.internalEdgeAdd(nextEdgeId(), nodeA, nodeB);
... | java | @Override
public EdgeIteratorState edge(int nodeA, int nodeB) {
if (isFrozen())
throw new IllegalStateException("Cannot create edge if graph is already frozen");
ensureNodeIndex(Math.max(nodeA, nodeB));
int edgeId = edgeAccess.internalEdgeAdd(nextEdgeId(), nodeA, nodeB);
... | [
"@",
"Override",
"public",
"EdgeIteratorState",
"edge",
"(",
"int",
"nodeA",
",",
"int",
"nodeB",
")",
"{",
"if",
"(",
"isFrozen",
"(",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot create edge if graph is already frozen\"",
")",
";",
"ensureNo... | Create edge between nodes a and b
@return EdgeIteratorState of newly created edge | [
"Create",
"edge",
"between",
"nodes",
"a",
"and",
"b"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/BaseGraph.java#L503-L517 |
21,166 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/BaseGraph.java | BaseGraph.nextEdgeId | protected int nextEdgeId() {
int nextEdge = edgeCount;
edgeCount++;
if (edgeCount < 0)
throw new IllegalStateException("too many edges. new edge id would be negative. " + toString());
edges.ensureCapacity(((long) edgeCount + 1) * edgeEntryBytes);
return nextEdge;
... | java | protected int nextEdgeId() {
int nextEdge = edgeCount;
edgeCount++;
if (edgeCount < 0)
throw new IllegalStateException("too many edges. new edge id would be negative. " + toString());
edges.ensureCapacity(((long) edgeCount + 1) * edgeEntryBytes);
return nextEdge;
... | [
"protected",
"int",
"nextEdgeId",
"(",
")",
"{",
"int",
"nextEdge",
"=",
"edgeCount",
";",
"edgeCount",
"++",
";",
"if",
"(",
"edgeCount",
"<",
"0",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"too many edges. new edge id would be negative. \"",
"+",
"toS... | Determine next free edgeId and ensure byte capacity to store edge
@return next free edgeId | [
"Determine",
"next",
"free",
"edgeId",
"and",
"ensure",
"byte",
"capacity",
"to",
"store",
"edge"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/BaseGraph.java#L529-L537 |
21,167 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/reader/dem/SRTMProvider.java | SRTMProvider.init | private SRTMProvider init() {
try {
String strs[] = {"Africa", "Australia", "Eurasia", "Islands", "North_America", "South_America"};
for (String str : strs) {
InputStream is = getClass().getResourceAsStream(str + "_names.txt");
for (String line : Helper.re... | java | private SRTMProvider init() {
try {
String strs[] = {"Africa", "Australia", "Eurasia", "Islands", "North_America", "South_America"};
for (String str : strs) {
InputStream is = getClass().getResourceAsStream(str + "_names.txt");
for (String line : Helper.re... | [
"private",
"SRTMProvider",
"init",
"(",
")",
"{",
"try",
"{",
"String",
"strs",
"[",
"]",
"=",
"{",
"\"Africa\"",
",",
"\"Australia\"",
",",
"\"Eurasia\"",
",",
"\"Islands\"",
",",
"\"North_America\"",
",",
"\"South_America\"",
"}",
";",
"for",
"(",
"String"... | The URLs are a bit ugly and so we need to find out which area name a certain lat,lon
coordinate has. | [
"The",
"URLs",
"are",
"a",
"bit",
"ugly",
"and",
"so",
"we",
"need",
"to",
"find",
"out",
"which",
"area",
"name",
"a",
"certain",
"lat",
"lon",
"coordinate",
"has",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/reader/dem/SRTMProvider.java#L86-L110 |
21,168 | graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMFileHeader.java | OSMFileHeader.create | public static OSMFileHeader create(long id, XMLStreamReader parser) throws XMLStreamException {
OSMFileHeader header = new OSMFileHeader();
parser.nextTag();
return header;
} | java | public static OSMFileHeader create(long id, XMLStreamReader parser) throws XMLStreamException {
OSMFileHeader header = new OSMFileHeader();
parser.nextTag();
return header;
} | [
"public",
"static",
"OSMFileHeader",
"create",
"(",
"long",
"id",
",",
"XMLStreamReader",
"parser",
")",
"throws",
"XMLStreamException",
"{",
"OSMFileHeader",
"header",
"=",
"new",
"OSMFileHeader",
"(",
")",
";",
"parser",
".",
"nextTag",
"(",
")",
";",
"retur... | Constructor for XML Parser | [
"Constructor",
"for",
"XML",
"Parser"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMFileHeader.java#L40-L44 |
21,169 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/DataFlagEncoder.java | DataFlagEncoder.getHighwayAsString | public String getHighwayAsString(EdgeIteratorState edge) {
int val = getHighway(edge);
for (Entry<String, Integer> e : highwayMap.entrySet()) {
if (e.getValue() == val)
return e.getKey();
}
return null;
} | java | public String getHighwayAsString(EdgeIteratorState edge) {
int val = getHighway(edge);
for (Entry<String, Integer> e : highwayMap.entrySet()) {
if (e.getValue() == val)
return e.getKey();
}
return null;
} | [
"public",
"String",
"getHighwayAsString",
"(",
"EdgeIteratorState",
"edge",
")",
"{",
"int",
"val",
"=",
"getHighway",
"(",
"edge",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"Integer",
">",
"e",
":",
"highwayMap",
".",
"entrySet",
"(",
")",
")",... | Do not use within weighting as this is suboptimal from performance point of view. | [
"Do",
"not",
"use",
"within",
"weighting",
"as",
"this",
"is",
"suboptimal",
"from",
"performance",
"point",
"of",
"view",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/DataFlagEncoder.java#L534-L541 |
21,170 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/DataFlagEncoder.java | DataFlagEncoder.createWeightingConfig | public WeightingConfig createWeightingConfig(PMap pMap) {
HashMap<String, Double> map = new HashMap<>(DEFAULT_SPEEDS.size());
for (Entry<String, Double> e : DEFAULT_SPEEDS.entrySet()) {
map.put(e.getKey(), pMap.getDouble(e.getKey(), e.getValue()));
}
return new WeightingConf... | java | public WeightingConfig createWeightingConfig(PMap pMap) {
HashMap<String, Double> map = new HashMap<>(DEFAULT_SPEEDS.size());
for (Entry<String, Double> e : DEFAULT_SPEEDS.entrySet()) {
map.put(e.getKey(), pMap.getDouble(e.getKey(), e.getValue()));
}
return new WeightingConf... | [
"public",
"WeightingConfig",
"createWeightingConfig",
"(",
"PMap",
"pMap",
")",
"{",
"HashMap",
"<",
"String",
",",
"Double",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
"DEFAULT_SPEEDS",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Entry",
"<",
"Stri... | This method creates a Config map out of the PMap. Later on this conversion should not be
necessary when we read JSON. | [
"This",
"method",
"creates",
"a",
"Config",
"map",
"out",
"of",
"the",
"PMap",
".",
"Later",
"on",
"this",
"conversion",
"should",
"not",
"be",
"necessary",
"when",
"we",
"read",
"JSON",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/DataFlagEncoder.java#L743-L750 |
21,171 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java | BikeCommonFlagEncoder.handleBikeRelated | void handleBikeRelated(IntsRef edgeFlags, ReaderWay way, boolean partOfCycleRelation) {
String surfaceTag = way.getTag("surface");
String highway = way.getTag("highway");
String trackType = way.getTag("tracktype");
// Populate unpavedBit
if ("track".equals(highway) && (trackType... | java | void handleBikeRelated(IntsRef edgeFlags, ReaderWay way, boolean partOfCycleRelation) {
String surfaceTag = way.getTag("surface");
String highway = way.getTag("highway");
String trackType = way.getTag("tracktype");
// Populate unpavedBit
if ("track".equals(highway) && (trackType... | [
"void",
"handleBikeRelated",
"(",
"IntsRef",
"edgeFlags",
",",
"ReaderWay",
"way",
",",
"boolean",
"partOfCycleRelation",
")",
"{",
"String",
"surfaceTag",
"=",
"way",
".",
"getTag",
"(",
"\"surface\"",
")",
";",
"String",
"highway",
"=",
"way",
".",
"getTag",... | Handle surface and wayType encoding | [
"Handle",
"surface",
"and",
"wayType",
"encoding"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java#L591-L622 |
21,172 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/index/LocationIndexTree.java | LocationIndexTree.createReverseKey | final long createReverseKey(double lat, double lon) {
return BitUtil.BIG.reverse(keyAlgo.encode(lat, lon), keyAlgo.getBits());
} | java | final long createReverseKey(double lat, double lon) {
return BitUtil.BIG.reverse(keyAlgo.encode(lat, lon), keyAlgo.getBits());
} | [
"final",
"long",
"createReverseKey",
"(",
"double",
"lat",
",",
"double",
"lon",
")",
"{",
"return",
"BitUtil",
".",
"BIG",
".",
"reverse",
"(",
"keyAlgo",
".",
"encode",
"(",
"lat",
",",
"lon",
")",
",",
"keyAlgo",
".",
"getBits",
"(",
")",
")",
";"... | this method returns the spatial key in reverse order for easier right-shifting | [
"this",
"method",
"returns",
"the",
"spatial",
"key",
"in",
"reverse",
"order",
"for",
"easier",
"right",
"-",
"shifting"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/index/LocationIndexTree.java#L377-L379 |
21,173 | graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/shapes/Polygon.java | Polygon.create | public static Polygon create(org.locationtech.jts.geom.Polygon polygon) {
double[] lats = new double[polygon.getNumPoints()];
double[] lons = new double[polygon.getNumPoints()];
for (int i = 0; i < polygon.getNumPoints(); i++) {
lats[i] = polygon.getCoordinates()[i].y;
lo... | java | public static Polygon create(org.locationtech.jts.geom.Polygon polygon) {
double[] lats = new double[polygon.getNumPoints()];
double[] lons = new double[polygon.getNumPoints()];
for (int i = 0; i < polygon.getNumPoints(); i++) {
lats[i] = polygon.getCoordinates()[i].y;
lo... | [
"public",
"static",
"Polygon",
"create",
"(",
"org",
".",
"locationtech",
".",
"jts",
".",
"geom",
".",
"Polygon",
"polygon",
")",
"{",
"double",
"[",
"]",
"lats",
"=",
"new",
"double",
"[",
"polygon",
".",
"getNumPoints",
"(",
")",
"]",
";",
"double",... | Lossy conversion to a GraphHopper Polygon. | [
"Lossy",
"conversion",
"to",
"a",
"GraphHopper",
"Polygon",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/shapes/Polygon.java#L85-L93 |
21,174 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/util/Downloader.java | Downloader.fetch | public InputStream fetch(HttpURLConnection connection, boolean readErrorStreamNoException) throws IOException {
// create connection but before reading get the correct inputstream based on the compression and if error
connection.connect();
InputStream is;
if (readErrorStreamNoException ... | java | public InputStream fetch(HttpURLConnection connection, boolean readErrorStreamNoException) throws IOException {
// create connection but before reading get the correct inputstream based on the compression and if error
connection.connect();
InputStream is;
if (readErrorStreamNoException ... | [
"public",
"InputStream",
"fetch",
"(",
"HttpURLConnection",
"connection",
",",
"boolean",
"readErrorStreamNoException",
")",
"throws",
"IOException",
"{",
"// create connection but before reading get the correct inputstream based on the compression and if error",
"connection",
".",
"... | This method initiates a connect call of the provided connection and returns the response
stream. It only returns the error stream if it is available and readErrorStreamNoException is
true otherwise it throws an IOException if an error happens. Furthermore it wraps the stream
to decompress it if the connection content e... | [
"This",
"method",
"initiates",
"a",
"connect",
"call",
"of",
"the",
"provided",
"connection",
"and",
"returns",
"the",
"response",
"stream",
".",
"It",
"only",
"returns",
"the",
"error",
"stream",
"if",
"it",
"is",
"available",
"and",
"readErrorStreamNoException... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/util/Downloader.java#L66-L90 |
21,175 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/GraphHopperStorage.java | GraphHopperStorage.getGraph | public <T extends Graph> T getGraph(Class<T> clazz, Weighting weighting) {
if (clazz.equals(Graph.class))
return (T) baseGraph;
Collection<CHGraphImpl> chGraphs = getAllCHGraphs();
if (chGraphs.isEmpty())
throw new IllegalStateException("Cannot find graph implementation ... | java | public <T extends Graph> T getGraph(Class<T> clazz, Weighting weighting) {
if (clazz.equals(Graph.class))
return (T) baseGraph;
Collection<CHGraphImpl> chGraphs = getAllCHGraphs();
if (chGraphs.isEmpty())
throw new IllegalStateException("Cannot find graph implementation ... | [
"public",
"<",
"T",
"extends",
"Graph",
">",
"T",
"getGraph",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Weighting",
"weighting",
")",
"{",
"if",
"(",
"clazz",
".",
"equals",
"(",
"Graph",
".",
"class",
")",
")",
"return",
"(",
"T",
")",
"baseGrap... | This method returns the routing graph for the specified weighting, could be potentially
filled with shortcuts. | [
"This",
"method",
"returns",
"the",
"routing",
"graph",
"for",
"the",
"specified",
"weighting",
"could",
"be",
"potentially",
"filled",
"with",
"shortcuts",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphHopperStorage.java#L102-L122 |
21,176 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/GraphHopperStorage.java | GraphHopperStorage.create | @Override
public GraphHopperStorage create(long byteCount) {
baseGraph.checkInit();
if (encodingManager == null)
throw new IllegalStateException("EncodingManager can only be null if you call loadExisting");
dir.create();
long initSize = Math.max(byteCount, 100);
... | java | @Override
public GraphHopperStorage create(long byteCount) {
baseGraph.checkInit();
if (encodingManager == null)
throw new IllegalStateException("EncodingManager can only be null if you call loadExisting");
dir.create();
long initSize = Math.max(byteCount, 100);
... | [
"@",
"Override",
"public",
"GraphHopperStorage",
"create",
"(",
"long",
"byteCount",
")",
"{",
"baseGraph",
".",
"checkInit",
"(",
")",
";",
"if",
"(",
"encodingManager",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"EncodingManager can only ... | After configuring this storage you need to create it explicitly. | [
"After",
"configuring",
"this",
"storage",
"you",
"need",
"to",
"create",
"it",
"explicitly",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphHopperStorage.java#L176-L202 |
21,177 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/apache/commons/collections/IntDoubleBinaryHeap.java | IntDoubleBinaryHeap.percolateDownMinHeap | final void percolateDownMinHeap(final int index) {
final int element = elements[index];
final float key = keys[index];
int hole = index;
while (hole * 2 <= size) {
int child = hole * 2;
// if we have a right child and that child can not be percolated
... | java | final void percolateDownMinHeap(final int index) {
final int element = elements[index];
final float key = keys[index];
int hole = index;
while (hole * 2 <= size) {
int child = hole * 2;
// if we have a right child and that child can not be percolated
... | [
"final",
"void",
"percolateDownMinHeap",
"(",
"final",
"int",
"index",
")",
"{",
"final",
"int",
"element",
"=",
"elements",
"[",
"index",
"]",
";",
"final",
"float",
"key",
"=",
"keys",
"[",
"index",
"]",
";",
"int",
"hole",
"=",
"index",
";",
"while"... | Percolates element down heap from the array position given by the index. | [
"Percolates",
"element",
"down",
"heap",
"from",
"the",
"array",
"position",
"given",
"by",
"the",
"index",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/apache/commons/collections/IntDoubleBinaryHeap.java#L139-L165 |
21,178 | graphhopper/graphhopper | reader-gtfs/src/main/java/com/conveyal/gtfs/error/GTFSError.java | GTFSError.compareTo | public int compareTo (GTFSError o) {
if (this.file == null && o.file != null) return -1;
else if (this.file != null && o.file == null) return 1;
int file = this.file == null && o.file == null ? 0 : String.CASE_INSENSITIVE_ORDER.compare(this.file, o.file);
if (file != 0) return file;
... | java | public int compareTo (GTFSError o) {
if (this.file == null && o.file != null) return -1;
else if (this.file != null && o.file == null) return 1;
int file = this.file == null && o.file == null ? 0 : String.CASE_INSENSITIVE_ORDER.compare(this.file, o.file);
if (file != 0) return file;
... | [
"public",
"int",
"compareTo",
"(",
"GTFSError",
"o",
")",
"{",
"if",
"(",
"this",
".",
"file",
"==",
"null",
"&&",
"o",
".",
"file",
"!=",
"null",
")",
"return",
"-",
"1",
";",
"else",
"if",
"(",
"this",
".",
"file",
"!=",
"null",
"&&",
"o",
".... | must be comparable to put into mapdb | [
"must",
"be",
"comparable",
"to",
"put",
"into",
"mapdb"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-gtfs/src/main/java/com/conveyal/gtfs/error/GTFSError.java#L79-L90 |
21,179 | graphhopper/graphhopper | reader-gtfs/src/main/java/com/graphhopper/reader/gtfs/Transfers.java | Transfers.getTransfersToStop | List<Transfer> getTransfersToStop(String toStopId, String toRouteId) {
final List<Transfer> allInboundTransfers = transfersToStop.getOrDefault(toStopId, Collections.emptyList());
final Map<String, List<Transfer>> byFromStop = allInboundTransfers.stream()
.filter(t -> t.transfer_type == 0... | java | List<Transfer> getTransfersToStop(String toStopId, String toRouteId) {
final List<Transfer> allInboundTransfers = transfersToStop.getOrDefault(toStopId, Collections.emptyList());
final Map<String, List<Transfer>> byFromStop = allInboundTransfers.stream()
.filter(t -> t.transfer_type == 0... | [
"List",
"<",
"Transfer",
">",
"getTransfersToStop",
"(",
"String",
"toStopId",
",",
"String",
"toRouteId",
")",
"{",
"final",
"List",
"<",
"Transfer",
">",
"allInboundTransfers",
"=",
"transfersToStop",
".",
"getOrDefault",
"(",
"toStopId",
",",
"Collections",
"... | So far, only the route is supported. | [
"So",
"far",
"only",
"the",
"route",
"is",
"supported",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-gtfs/src/main/java/com/graphhopper/reader/gtfs/Transfers.java#L43-L66 |
21,180 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/reader/dem/AbstractTiffElevationProvider.java | AbstractTiffElevationProvider.downloadFile | private void downloadFile(File downloadFile, String url) throws IOException {
if (!downloadFile.exists()) {
int max = 3;
for (int trial = 0; trial < max; trial++) {
try {
downloader.downloadFile(url, downloadFile.getAbsolutePath());
... | java | private void downloadFile(File downloadFile, String url) throws IOException {
if (!downloadFile.exists()) {
int max = 3;
for (int trial = 0; trial < max; trial++) {
try {
downloader.downloadFile(url, downloadFile.getAbsolutePath());
... | [
"private",
"void",
"downloadFile",
"(",
"File",
"downloadFile",
",",
"String",
"url",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"downloadFile",
".",
"exists",
"(",
")",
")",
"{",
"int",
"max",
"=",
"3",
";",
"for",
"(",
"int",
"trial",
"=",
... | Download a file at the provided url and save it as the given downloadFile if the downloadFile does not exist. | [
"Download",
"a",
"file",
"at",
"the",
"provided",
"url",
"and",
"save",
"it",
"as",
"the",
"given",
"downloadFile",
"if",
"the",
"downloadFile",
"does",
"not",
"exist",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/reader/dem/AbstractTiffElevationProvider.java#L150-L167 |
21,181 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/TarjansSCCAlgorithm.java | TarjansSCCAlgorithm.findComponents | public List<IntArrayList> findComponents() {
int nodes = graph.getNodes();
for (int start = 0; start < nodes; start++) {
if (nodeIndex[start] == 0
&& !ignoreSet.contains(start)
&& !graph.isNodeRemoved(start))
strongConnect(start);
... | java | public List<IntArrayList> findComponents() {
int nodes = graph.getNodes();
for (int start = 0; start < nodes; start++) {
if (nodeIndex[start] == 0
&& !ignoreSet.contains(start)
&& !graph.isNodeRemoved(start))
strongConnect(start);
... | [
"public",
"List",
"<",
"IntArrayList",
">",
"findComponents",
"(",
")",
"{",
"int",
"nodes",
"=",
"graph",
".",
"getNodes",
"(",
")",
";",
"for",
"(",
"int",
"start",
"=",
"0",
";",
"start",
"<",
"nodes",
";",
"start",
"++",
")",
"{",
"if",
"(",
... | Find and return list of all strongly connected components in g. | [
"Find",
"and",
"return",
"list",
"of",
"all",
"strongly",
"connected",
"components",
"in",
"g",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/TarjansSCCAlgorithm.java#L87-L97 |
21,182 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/reader/dem/MultiSourceElevationProvider.java | MultiSourceElevationProvider.setBaseURL | @Override
public ElevationProvider setBaseURL(String baseURL) {
String[] urls = baseURL.split(";");
if (urls.length != 2) {
throw new IllegalArgumentException("The base url must consist of two urls separated by a ';'. The first for cgiar, the second for gmted");
}
srtmPro... | java | @Override
public ElevationProvider setBaseURL(String baseURL) {
String[] urls = baseURL.split(";");
if (urls.length != 2) {
throw new IllegalArgumentException("The base url must consist of two urls separated by a ';'. The first for cgiar, the second for gmted");
}
srtmPro... | [
"@",
"Override",
"public",
"ElevationProvider",
"setBaseURL",
"(",
"String",
"baseURL",
")",
"{",
"String",
"[",
"]",
"urls",
"=",
"baseURL",
".",
"split",
"(",
"\";\"",
")",
";",
"if",
"(",
"urls",
".",
"length",
"!=",
"2",
")",
"{",
"throw",
"new",
... | For the MultiSourceElevationProvider you have to specify the base URL separated by a ';'.
The first for cgiar, the second for gmted. | [
"For",
"the",
"MultiSourceElevationProvider",
"you",
"have",
"to",
"specify",
"the",
"base",
"URL",
"separated",
"by",
"a",
";",
".",
"The",
"first",
"for",
"cgiar",
"the",
"second",
"for",
"gmted",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/reader/dem/MultiSourceElevationProvider.java#L61-L70 |
21,183 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/weighting/TurnWeighting.java | TurnWeighting.calcTurnWeight | public double calcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) {
long turnFlags = turnCostExt.getTurnCostFlags(edgeFrom, nodeVia, edgeTo);
if (turnCostEncoder.isTurnRestricted(turnFlags))
return Double.POSITIVE_INFINITY;
return turnCostEncoder.getTurnCost(turnFlags);
} | java | public double calcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) {
long turnFlags = turnCostExt.getTurnCostFlags(edgeFrom, nodeVia, edgeTo);
if (turnCostEncoder.isTurnRestricted(turnFlags))
return Double.POSITIVE_INFINITY;
return turnCostEncoder.getTurnCost(turnFlags);
} | [
"public",
"double",
"calcTurnWeight",
"(",
"int",
"edgeFrom",
",",
"int",
"nodeVia",
",",
"int",
"edgeTo",
")",
"{",
"long",
"turnFlags",
"=",
"turnCostExt",
".",
"getTurnCostFlags",
"(",
"edgeFrom",
",",
"nodeVia",
",",
"edgeTo",
")",
";",
"if",
"(",
"tur... | This method calculates the turn weight separately. | [
"This",
"method",
"calculates",
"the",
"turn",
"weight",
"separately",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/weighting/TurnWeighting.java#L105-L111 |
21,184 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java | InstructionsOutgoingEdges.outgoingEdgesAreSlowerByFactor | public boolean outgoingEdgesAreSlowerByFactor(double factor) {
double tmpSpeed = getSpeed(currentEdge);
double pathSpeed = getSpeed(prevEdge);
// Speed-Change on the path indicates, that we change road types, show instruction
if (pathSpeed != tmpSpeed || pathSpeed < 1) {
ret... | java | public boolean outgoingEdgesAreSlowerByFactor(double factor) {
double tmpSpeed = getSpeed(currentEdge);
double pathSpeed = getSpeed(prevEdge);
// Speed-Change on the path indicates, that we change road types, show instruction
if (pathSpeed != tmpSpeed || pathSpeed < 1) {
ret... | [
"public",
"boolean",
"outgoingEdgesAreSlowerByFactor",
"(",
"double",
"factor",
")",
"{",
"double",
"tmpSpeed",
"=",
"getSpeed",
"(",
"currentEdge",
")",
";",
"double",
"pathSpeed",
"=",
"getSpeed",
"(",
"prevEdge",
")",
";",
"// Speed-Change on the path indicates, th... | Checks if the outgoing edges are slower by the provided factor. If they are, this indicates, that we are staying
on the prominent street that one would follow anyway. | [
"Checks",
"if",
"the",
"outgoing",
"edges",
"are",
"slower",
"by",
"the",
"provided",
"factor",
".",
"If",
"they",
"are",
"this",
"indicates",
"that",
"we",
"are",
"staying",
"on",
"the",
"prominent",
"street",
"that",
"one",
"would",
"follow",
"anyway",
"... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java#L125-L149 |
21,185 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java | InstructionsOutgoingEdges.getOtherContinue | public EdgeIteratorState getOtherContinue(double prevLat, double prevLon, double prevOrientation) {
int tmpSign;
for (EdgeIteratorState edge : allowedOutgoingEdges) {
GHPoint point = InstructionsHelper.getPointForOrientationCalculation(edge, nodeAccess);
tmpSign = InstructionsHel... | java | public EdgeIteratorState getOtherContinue(double prevLat, double prevLon, double prevOrientation) {
int tmpSign;
for (EdgeIteratorState edge : allowedOutgoingEdges) {
GHPoint point = InstructionsHelper.getPointForOrientationCalculation(edge, nodeAccess);
tmpSign = InstructionsHel... | [
"public",
"EdgeIteratorState",
"getOtherContinue",
"(",
"double",
"prevLat",
",",
"double",
"prevLon",
",",
"double",
"prevOrientation",
")",
"{",
"int",
"tmpSign",
";",
"for",
"(",
"EdgeIteratorState",
"edge",
":",
"allowedOutgoingEdges",
")",
"{",
"GHPoint",
"po... | Returns an edge that has more or less in the same orientation as the prevEdge, but is not the currentEdge.
If there is one, this indicates that we might need an instruction to help finding the correct edge out of the different choices.
If there is none, return null. | [
"Returns",
"an",
"edge",
"that",
"has",
"more",
"or",
"less",
"in",
"the",
"same",
"orientation",
"as",
"the",
"prevEdge",
"but",
"is",
"not",
"the",
"currentEdge",
".",
"If",
"there",
"is",
"one",
"this",
"indicates",
"that",
"we",
"might",
"need",
"an"... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java#L164-L174 |
21,186 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java | InstructionsOutgoingEdges.isLeavingCurrentStreet | public boolean isLeavingCurrentStreet(String prevName, String name) {
if (InstructionsHelper.isNameSimilar(name, prevName)) {
return false;
}
// If flags are changing, there might be a chance we find these flags on a different edge
boolean checkFlag = currentEdge.getFlags() ... | java | public boolean isLeavingCurrentStreet(String prevName, String name) {
if (InstructionsHelper.isNameSimilar(name, prevName)) {
return false;
}
// If flags are changing, there might be a chance we find these flags on a different edge
boolean checkFlag = currentEdge.getFlags() ... | [
"public",
"boolean",
"isLeavingCurrentStreet",
"(",
"String",
"prevName",
",",
"String",
"name",
")",
"{",
"if",
"(",
"InstructionsHelper",
".",
"isNameSimilar",
"(",
"name",
",",
"prevName",
")",
")",
"{",
"return",
"false",
";",
"}",
"// If flags are changing,... | If the name and prevName changes this method checks if either the current street is continued on a
different edge or if the edge we are turning onto is continued on a different edge.
If either of these properties is true, we can be quite certain that a turn instruction should be provided. | [
"If",
"the",
"name",
"and",
"prevName",
"changes",
"this",
"method",
"checks",
"if",
"either",
"the",
"current",
"street",
"is",
"continued",
"on",
"a",
"different",
"edge",
"or",
"if",
"the",
"edge",
"we",
"are",
"turning",
"onto",
"is",
"continued",
"on"... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java#L181-L198 |
21,187 | graphhopper/graphhopper | client-hc/src/main/java/com/graphhopper/api/GHMRequest.java | GHMRequest.addPoint | @Override
public GHMRequest addPoint(GHPoint point) {
fromPoints.add(point);
toPoints.add(point);
return this;
} | java | @Override
public GHMRequest addPoint(GHPoint point) {
fromPoints.add(point);
toPoints.add(point);
return this;
} | [
"@",
"Override",
"public",
"GHMRequest",
"addPoint",
"(",
"GHPoint",
"point",
")",
"{",
"fromPoints",
".",
"add",
"(",
"point",
")",
";",
"toPoints",
".",
"add",
"(",
"point",
")",
";",
"return",
"this",
";",
"}"
] | This methods adds the coordinate as 'from' and 'to' to the request. | [
"This",
"methods",
"adds",
"the",
"coordinate",
"as",
"from",
"and",
"to",
"to",
"the",
"request",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/client-hc/src/main/java/com/graphhopper/api/GHMRequest.java#L72-L77 |
21,188 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/ch/PrepareContractionHierarchies.java | PrepareContractionHierarchies.useFixedNodeOrdering | public PrepareContractionHierarchies useFixedNodeOrdering(NodeOrderingProvider nodeOrderingProvider) {
if (nodeOrderingProvider.getNumNodes() != prepareGraph.getNodes()) {
throw new IllegalArgumentException(
"contraction order size (" + nodeOrderingProvider.getNumNodes() + ")" +
... | java | public PrepareContractionHierarchies useFixedNodeOrdering(NodeOrderingProvider nodeOrderingProvider) {
if (nodeOrderingProvider.getNumNodes() != prepareGraph.getNodes()) {
throw new IllegalArgumentException(
"contraction order size (" + nodeOrderingProvider.getNumNodes() + ")" +
... | [
"public",
"PrepareContractionHierarchies",
"useFixedNodeOrdering",
"(",
"NodeOrderingProvider",
"nodeOrderingProvider",
")",
"{",
"if",
"(",
"nodeOrderingProvider",
".",
"getNumNodes",
"(",
")",
"!=",
"prepareGraph",
".",
"getNodes",
"(",
")",
")",
"{",
"throw",
"new"... | Instead of heuristically determining a node ordering for the graph contraction it is also possible
to use a fixed ordering. For example this allows re-using a previously calculated node ordering.
This will speed up CH preparation, but might lead to slower queries. | [
"Instead",
"of",
"heuristically",
"determining",
"a",
"node",
"ordering",
"for",
"the",
"graph",
"contraction",
"it",
"is",
"also",
"possible",
"to",
"use",
"a",
"fixed",
"ordering",
".",
"For",
"example",
"this",
"allows",
"re",
"-",
"using",
"a",
"previous... | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/ch/PrepareContractionHierarchies.java#L104-L112 |
21,189 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java | GraphEdgeIdFinder.findEdgesInShape | public void findEdgesInShape(final GHIntHashSet edgeIds, final Shape shape, EdgeFilter filter) {
GHPoint center = shape.getCenter();
QueryResult qr = locationIndex.findClosest(center.getLat(), center.getLon(), filter);
// TODO: if there is no street close to the center it'll fail although there ... | java | public void findEdgesInShape(final GHIntHashSet edgeIds, final Shape shape, EdgeFilter filter) {
GHPoint center = shape.getCenter();
QueryResult qr = locationIndex.findClosest(center.getLat(), center.getLon(), filter);
// TODO: if there is no street close to the center it'll fail although there ... | [
"public",
"void",
"findEdgesInShape",
"(",
"final",
"GHIntHashSet",
"edgeIds",
",",
"final",
"Shape",
"shape",
",",
"EdgeFilter",
"filter",
")",
"{",
"GHPoint",
"center",
"=",
"shape",
".",
"getCenter",
"(",
")",
";",
"QueryResult",
"qr",
"=",
"locationIndex",... | This method fills the edgeIds hash with edgeIds found inside the specified shape | [
"This",
"method",
"fills",
"the",
"edgeIds",
"hash",
"with",
"edgeIds",
"found",
"inside",
"the",
"specified",
"shape"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java#L71-L113 |
21,190 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java | GraphEdgeIdFinder.fillEdgeIDs | public void fillEdgeIDs(GHIntHashSet edgeIds, Geometry geometry, EdgeFilter filter) {
if (geometry instanceof Point) {
GHPoint point = GHPoint.create((Point) geometry);
findClosestEdgeToPoint(edgeIds, point, filter);
} else if (geometry instanceof LineString) {
PointL... | java | public void fillEdgeIDs(GHIntHashSet edgeIds, Geometry geometry, EdgeFilter filter) {
if (geometry instanceof Point) {
GHPoint point = GHPoint.create((Point) geometry);
findClosestEdgeToPoint(edgeIds, point, filter);
} else if (geometry instanceof LineString) {
PointL... | [
"public",
"void",
"fillEdgeIDs",
"(",
"GHIntHashSet",
"edgeIds",
",",
"Geometry",
"geometry",
",",
"EdgeFilter",
"filter",
")",
"{",
"if",
"(",
"geometry",
"instanceof",
"Point",
")",
"{",
"GHPoint",
"point",
"=",
"GHPoint",
".",
"create",
"(",
"(",
"Point",... | This method fills the edgeIds hash with edgeIds found inside the specified geometry | [
"This",
"method",
"fills",
"the",
"edgeIds",
"hash",
"with",
"edgeIds",
"found",
"inside",
"the",
"specified",
"geometry"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java#L118-L136 |
21,191 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java | GraphEdgeIdFinder.parseBlockArea | public BlockArea parseBlockArea(String blockAreaString, EdgeFilter filter, double useEdgeIdsUntilAreaSize) {
final String objectSeparator = ";";
final String innerObjSep = ",";
BlockArea blockArea = new BlockArea(graph);
// Add blocked circular areas or points
if (!blockAreaStri... | java | public BlockArea parseBlockArea(String blockAreaString, EdgeFilter filter, double useEdgeIdsUntilAreaSize) {
final String objectSeparator = ";";
final String innerObjSep = ",";
BlockArea blockArea = new BlockArea(graph);
// Add blocked circular areas or points
if (!blockAreaStri... | [
"public",
"BlockArea",
"parseBlockArea",
"(",
"String",
"blockAreaString",
",",
"EdgeFilter",
"filter",
",",
"double",
"useEdgeIdsUntilAreaSize",
")",
"{",
"final",
"String",
"objectSeparator",
"=",
"\";\"",
";",
"final",
"String",
"innerObjSep",
"=",
"\",\"",
";",
... | This method reads the blockAreaString and creates a Collection of Shapes or a set of found edges if area is small enough.
@param useEdgeIdsUntilAreaSize until the specified area (specified in m²) use the findEdgesInShape method | [
"This",
"method",
"reads",
"the",
"blockAreaString",
"and",
"creates",
"a",
"Collection",
"of",
"Shapes",
"or",
"a",
"set",
"of",
"found",
"edges",
"if",
"area",
"is",
"small",
"enough",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java#L142-L183 |
21,192 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupArray.java | SpatialRuleLookupArray.isBorderTile | private boolean isBorderTile(int xIndex, int yIndex, int ruleIndex) {
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
if (i != xIndex && j != yIndex)
if (ruleIndex != getRuleContainerIndex(i, j))
return true;
}
... | java | private boolean isBorderTile(int xIndex, int yIndex, int ruleIndex) {
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
if (i != xIndex && j != yIndex)
if (ruleIndex != getRuleContainerIndex(i, j))
return true;
}
... | [
"private",
"boolean",
"isBorderTile",
"(",
"int",
"xIndex",
",",
"int",
"yIndex",
",",
"int",
"ruleIndex",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"-",
"1",
";",
"i",
"<",
"2",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"-",
"1",
"... | Might fail for small holes that do not occur in the array | [
"Might",
"fail",
"for",
"small",
"holes",
"that",
"do",
"not",
"occur",
"in",
"the",
"array"
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupArray.java#L139-L148 |
21,193 | graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupArray.java | SpatialRuleLookupArray.addRuleContainer | private int addRuleContainer(SpatialRuleContainer container) {
int newIndex = this.ruleContainers.indexOf(container);
if (newIndex >= 0)
return newIndex;
newIndex = ruleContainers.size();
if (newIndex >= 255)
throw new IllegalStateException("No more spatial rule ... | java | private int addRuleContainer(SpatialRuleContainer container) {
int newIndex = this.ruleContainers.indexOf(container);
if (newIndex >= 0)
return newIndex;
newIndex = ruleContainers.size();
if (newIndex >= 255)
throw new IllegalStateException("No more spatial rule ... | [
"private",
"int",
"addRuleContainer",
"(",
"SpatialRuleContainer",
"container",
")",
"{",
"int",
"newIndex",
"=",
"this",
".",
"ruleContainers",
".",
"indexOf",
"(",
"container",
")",
";",
"if",
"(",
"newIndex",
">=",
"0",
")",
"return",
"newIndex",
";",
"ne... | This method adds the container if no such rule container exists in this lookup and returns the index otherwise. | [
"This",
"method",
"adds",
"the",
"container",
"if",
"no",
"such",
"rule",
"container",
"exists",
"in",
"this",
"lookup",
"and",
"returns",
"the",
"index",
"otherwise",
"."
] | c235e306e6e823043cadcc41ead0e685bdebf737 | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupArray.java#L228-L239 |
21,194 | rubenlagus/TelegramBots | telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/db/MapDBContext.java | MapDBContext.onlineInstance | public static DBContext onlineInstance(String name) {
DB db = DBMaker
.fileDB(name)
.fileMmapEnableIfSupported()
.closeOnJvmShutdown()
.transactionEnable()
.make();
return new MapDBContext(db);
} | java | public static DBContext onlineInstance(String name) {
DB db = DBMaker
.fileDB(name)
.fileMmapEnableIfSupported()
.closeOnJvmShutdown()
.transactionEnable()
.make();
return new MapDBContext(db);
} | [
"public",
"static",
"DBContext",
"onlineInstance",
"(",
"String",
"name",
")",
"{",
"DB",
"db",
"=",
"DBMaker",
".",
"fileDB",
"(",
"name",
")",
".",
"fileMmapEnableIfSupported",
"(",
")",
".",
"closeOnJvmShutdown",
"(",
")",
".",
"transactionEnable",
"(",
"... | This DB returned by this method does not trigger deletion on JVM shutdown.
@param name name of the DB file
@return an online instance of {@link MapDBContext} | [
"This",
"DB",
"returned",
"by",
"this",
"method",
"does",
"not",
"trigger",
"deletion",
"on",
"JVM",
"shutdown",
"."
] | d62354915d7664597a40fd9858f16bce67ef1478 | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/db/MapDBContext.java#L52-L61 |
21,195 | rubenlagus/TelegramBots | telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/db/MapDBContext.java | MapDBContext.offlineInstance | public static DBContext offlineInstance(String name) {
DB db = DBMaker
.fileDB(name)
.fileMmapEnableIfSupported()
.closeOnJvmShutdown()
.cleanerHackEnable()
.transactionEnable()
.fileDeleteAfterClose()
.make();
return new MapDBContext(db);
} | java | public static DBContext offlineInstance(String name) {
DB db = DBMaker
.fileDB(name)
.fileMmapEnableIfSupported()
.closeOnJvmShutdown()
.cleanerHackEnable()
.transactionEnable()
.fileDeleteAfterClose()
.make();
return new MapDBContext(db);
} | [
"public",
"static",
"DBContext",
"offlineInstance",
"(",
"String",
"name",
")",
"{",
"DB",
"db",
"=",
"DBMaker",
".",
"fileDB",
"(",
"name",
")",
".",
"fileMmapEnableIfSupported",
"(",
")",
".",
"closeOnJvmShutdown",
"(",
")",
".",
"cleanerHackEnable",
"(",
... | This DB returned by this method gets deleted on JVM shutdown.
@param name name of the DB file
@return an offline instance of {@link MapDBContext} | [
"This",
"DB",
"returned",
"by",
"this",
"method",
"gets",
"deleted",
"on",
"JVM",
"shutdown",
"."
] | d62354915d7664597a40fd9858f16bce67ef1478 | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/db/MapDBContext.java#L69-L80 |
21,196 | rubenlagus/TelegramBots | telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/TelegramBotsApi.java | TelegramBotsApi.registerBot | public BotSession registerBot(LongPollingBot bot) throws TelegramApiRequestException {
bot.clearWebhook();
BotSession session = ApiContext.getInstance(BotSession.class);
session.setToken(bot.getBotToken());
session.setOptions(bot.getOptions());
session.setCallback(bot);
s... | java | public BotSession registerBot(LongPollingBot bot) throws TelegramApiRequestException {
bot.clearWebhook();
BotSession session = ApiContext.getInstance(BotSession.class);
session.setToken(bot.getBotToken());
session.setOptions(bot.getOptions());
session.setCallback(bot);
s... | [
"public",
"BotSession",
"registerBot",
"(",
"LongPollingBot",
"bot",
")",
"throws",
"TelegramApiRequestException",
"{",
"bot",
".",
"clearWebhook",
"(",
")",
";",
"BotSession",
"session",
"=",
"ApiContext",
".",
"getInstance",
"(",
"BotSession",
".",
"class",
")",... | Register a bot. The Bot Session is started immediately, and may be disconnected by calling close.
@param bot the bot to register | [
"Register",
"a",
"bot",
".",
"The",
"Bot",
"Session",
"is",
"started",
"immediately",
"and",
"may",
"be",
"disconnected",
"by",
"calling",
"close",
"."
] | d62354915d7664597a40fd9858f16bce67ef1478 | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/TelegramBotsApi.java#L119-L127 |
21,197 | rubenlagus/TelegramBots | telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/TelegramBotsApi.java | TelegramBotsApi.registerBot | public void registerBot(WebhookBot bot) throws TelegramApiRequestException {
if (useWebhook) {
webhook.registerWebhook(bot);
bot.setWebhook(externalUrl + bot.getBotPath(), pathToCertificate);
}
} | java | public void registerBot(WebhookBot bot) throws TelegramApiRequestException {
if (useWebhook) {
webhook.registerWebhook(bot);
bot.setWebhook(externalUrl + bot.getBotPath(), pathToCertificate);
}
} | [
"public",
"void",
"registerBot",
"(",
"WebhookBot",
"bot",
")",
"throws",
"TelegramApiRequestException",
"{",
"if",
"(",
"useWebhook",
")",
"{",
"webhook",
".",
"registerWebhook",
"(",
"bot",
")",
";",
"bot",
".",
"setWebhook",
"(",
"externalUrl",
"+",
"bot",
... | Register a bot in the api that will receive updates using webhook method
@param bot Bot to register | [
"Register",
"a",
"bot",
"in",
"the",
"api",
"that",
"will",
"receive",
"updates",
"using",
"webhook",
"method"
] | d62354915d7664597a40fd9858f16bce67ef1478 | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/TelegramBotsApi.java#L133-L138 |
21,198 | rubenlagus/TelegramBots | telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistry.java | CommandRegistry.executeCommand | public final boolean executeCommand(AbsSender absSender, Message message) {
if (message.hasText()) {
String text = message.getText();
if (text.startsWith(BotCommand.COMMAND_INIT_CHARACTER)) {
String commandMessage = text.substring(1);
String[] commandSplit... | java | public final boolean executeCommand(AbsSender absSender, Message message) {
if (message.hasText()) {
String text = message.getText();
if (text.startsWith(BotCommand.COMMAND_INIT_CHARACTER)) {
String commandMessage = text.substring(1);
String[] commandSplit... | [
"public",
"final",
"boolean",
"executeCommand",
"(",
"AbsSender",
"absSender",
",",
"Message",
"message",
")",
"{",
"if",
"(",
"message",
".",
"hasText",
"(",
")",
")",
"{",
"String",
"text",
"=",
"message",
".",
"getText",
"(",
")",
";",
"if",
"(",
"t... | Executes a command action if the command is registered.
@note If the command is not registered and there is a default consumer,
that action will be performed
@param absSender absSender
@param message input message
@return True if a command or default action is executed, false otherwise | [
"Executes",
"a",
"command",
"action",
"if",
"the",
"command",
"is",
"registered",
"."
] | d62354915d7664597a40fd9858f16bce67ef1478 | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistry.java#L95-L115 |
21,199 | rubenlagus/TelegramBots | telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/DefaultBotCommand.java | DefaultBotCommand.processMessage | @Override
public void processMessage(AbsSender absSender, Message message, String[] arguments) {
execute(absSender, message.getFrom(), message.getChat(), message.getMessageId(), arguments);
} | java | @Override
public void processMessage(AbsSender absSender, Message message, String[] arguments) {
execute(absSender, message.getFrom(), message.getChat(), message.getMessageId(), arguments);
} | [
"@",
"Override",
"public",
"void",
"processMessage",
"(",
"AbsSender",
"absSender",
",",
"Message",
"message",
",",
"String",
"[",
"]",
"arguments",
")",
"{",
"execute",
"(",
"absSender",
",",
"message",
".",
"getFrom",
"(",
")",
",",
"message",
".",
"getC... | Process the message and execute the command
@param absSender absSender to send messages over
@param message the message to process
@param arguments passed arguments | [
"Process",
"the",
"message",
"and",
"execute",
"the",
"command"
] | d62354915d7664597a40fd9858f16bce67ef1478 | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/DefaultBotCommand.java#L33-L36 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.