name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
graphhopper_LMApproximator_forLandmarks_rdh
/** * * @param weighting * the weighting used for the current path calculation, not necessarily the same that we used for the LM preparation. * All edge weights must be larger or equal compared to those used for the preparation. */ public static LMApproximator forLandmarks(Graph g, ...
3.26
graphhopper_LMApproximator_setEpsilon_rdh
/** * Increase approximation with higher epsilon */ public LMApproximator setEpsilon(double epsilon) { this.epsilon = epsilon; return this; }
3.26
graphhopper_HeadingEdgeFilter_getHeadingOfGeometryNearPoint_rdh
/** * Calculates the heading (in degrees) of the given edge in fwd direction near the given point. If the point is * too far away from the edge (according to the maxDistance parameter) it returns Double.NaN. */ static double getHeadingOfGeometryNearPoint(EdgeIteratorState edgeState, GHPoint point, double maxDistan...
3.26
graphhopper_Measurement_start_rdh
// creates properties file in the format key=value // Every value is one y-value in a separate diagram with an identical x-value for every Measurement.start call void start(PMap args) throws IOException { final String graphLocation = args.getString("graph.location", ""); final boolean useJson = args.getBool("m...
3.26
graphhopper_Measurement_writeSummary_rdh
/** * Writes a selection of measurement results to a single line in * a file. Each run of the measurement class will append a new line. */ private void writeSummary(String summaryLocation, String propLocation) { logger.info("writing summary to " + summaryLocation); // choose properties that should be in summary he...
3.26
graphhopper_BikeCommonPriorityParser_collect_rdh
/** * * @param weightToPrioMap * associate a weight with every priority. This sorted map allows * subclasses to 'insert' more important priorities as well as overwrite determined priorities. */ void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Doub...
3.26
graphhopper_BikeCommonPriorityParser_addPushingSection_rdh
// TODO duplicated in average speed void addPushingSection(String highway) {pushingSectionsHighways.add(highway); }
3.26
graphhopper_BikeCommonPriorityParser_handlePriority_rdh
/** * In this method we prefer cycleways or roads with designated bike access and avoid big roads * or roads with trams or pedestrian. * * @return new priority based on priorityFromRelation and on the tags in ReaderWay. */ int handlePriority(ReaderWay way, double wayTypeSpeed, Integer priorityFromRelation) { ...
3.26
graphhopper_BikeCommonPriorityParser_convertClassValueToPriority_rdh
// Conversion of class value to priority. See http://wiki.openstreetmap.org/wiki/Class:bicycle private PriorityCode convertClassValueToPriority(String tagvalue) { int classvalue; try { classvalue = Integer.parseInt(tagvalue); } catch (NumberFormatException e) { return UNCHANGED; } sw...
3.26
graphhopper_AbstractPathDetailsBuilder_startInterval_rdh
/** * It is only possible to open one interval at a time. Calling <code>startInterval</code> when * the interval is already open results in an Exception. * * @param firstIndex * the index the PathDetail starts */ public void startInterval(int firstIndex) { Object value = getCurrentValue(); if (isOpen) ...
3.26
graphhopper_AbstractPathDetailsBuilder_endInterval_rdh
/** * 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 */ public void endInterval(int lastIndex) { if (isOpen) { currentDetai...
3.26
graphhopper_LineIntIndex_findEdgeIdsInNeighborhood_rdh
/** * This method collects edge ids from the neighborhood of a point and puts them into foundEntries. * <p> * If it is called with iteration = 0, it just looks in the tile the query point is in. * If it is called with iteration = 0,1,2,.., it will look in additional tiles further and further * from the start tile....
3.26
graphhopper_GTFSError_compareTo_rdh
/** * must be comparable to put into mapdb */ 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_...
3.26
graphhopper_CHStorage_getNodes_rdh
/** * The number of nodes of this storage. */ public int getNodes() { return nodeCount; }
3.26
graphhopper_CHStorage_getShortcuts_rdh
/** * The number of shortcuts that were added to this storage */ public int getShortcuts() { return shortcutCount; }
3.26
graphhopper_CHStorage_toNodePointer_rdh
/** * To use the node getters/setters you need to convert node IDs to a nodePointer first */ public long toNodePointer(int node) { assert (node >= 0) && (node < nodeCount) : ("node not in bounds: [0, " + nodeCount) + "["; return ((long) (node)) * nodeCHEntryBytes; }
3.26
graphhopper_CHStorage_create_rdh
/** * Creates a new storage. Alternatively we could load an existing one using {@link #loadExisting()}}. * The number of nodes must be given here while the expected number of shortcuts can * be given to prevent some memory allocations, but is not a requirement. When in doubt rather use a small value * so the result...
3.26
graphhopper_CHStorage_setLowShortcutWeightConsumer_rdh
/** * Sets a callback called for shortcuts that are below the minimum weight. e.g. used to find/log mapping errors */ public void setLowShortcutWeightConsumer(Consumer<LowWeightShortcut> lowWeightShortcutConsumer) { this.lowShortcutWeightConsumer = lowWeightShortcutConsumer; }
3.26
graphhopper_CHStorage_toShortcutPointer_rdh
/** * To use the shortcut getters/setters you need to convert shortcut IDs to an shortcutPointer first */ public long toShortcutPointer(int shortcut) { assert shortcut < shortcutCount : ((("shortcut " + shortcut) + " not in bounds [0, ") + shortcutCount) + "["; return ((long) (shortcut)) * shortcutEntr...
3.26
graphhopper_DirectionResolver_resolveDirections_rdh
/** * * @param node * the node for which the incoming/outgoing edges should be determined * @param location * the location next to the road relative to which the 'left' and 'right' side edges should be determined * @see DirectionResolver */ public DirectionResolverResult r...
3.26
graphhopper_GHResponse_getErrors_rdh
/** * This method returns all the explicitly added errors and the errors of all paths. */ public List<Throwable> getErrors() { List<Throwable> list = new ArrayList<>(); list.addAll(errors); for (ResponsePath p : responsePaths) {list.addAll(p.getErrors()); } return list; }
3.26
graphhopper_GHResponse_hasErrors_rdh
/** * This method returns true if one of the paths has an error or if the response itself is * erroneous. */ public boolean hasErrors() { if (!errors.isEmpty()) return true; for (ResponsePath p : responsePaths) { if (p.hasErrors()) return true; } return false; }
3.26
graphhopper_GHResponse_getBest_rdh
/** * Returns the best path. */ public ResponsePath getBest() { if (responsePaths.isEmpty()) throw new RuntimeException("Cannot fetch best response if list is empty"); return responsePaths.get(0); }
3.26
graphhopper_StorableProperties_m0_rdh
/** * Before it saves this value it creates a string out of it. */ public synchronized StorableProperties m0(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, va...
3.26
graphhopper_EdgeBasedWitnessPathSearcher_initSearch_rdh
/** * 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 source edge key. * * @param sourceEdgeKey * the key of the original edge incoming to s from which the search starts * @param sourceNode * the neighbor node from wh...
3.26
graphhopper_EdgeBasedWitnessPathSearcher_runSearch_rdh
/** * Runs a witness path search for a given target edge key. Results of previous searches (the shortest path tree) are * reused and the previous search is extended if necessary. Note that you need to call * {@link #initSearch(int, int, int, Stats)} before calling this method to initialize the search...
3.26
graphhopper_AbstractBidirCHAlgo_fillEdgesToUsingFilter_rdh
/** * * @see #fillEdgesFromUsingFilter(CHEdgeFilter) */ protected void fillEdgesToUsingFilter(CHEdgeFilter edgeFilter) { // we temporarily ignore the additionalEdgeFilter CHEdgeFilter tmpFilter = levelEdgeFilter; levelEdgeFilter = edgeFilter; finishedTo = !fillEdgesTo(); levelEdgeFilter = tmpFilt...
3.26
graphhopper_AbstractBidirCHAlgo_fillEdgesFromUsingFilter_rdh
/** * * @param edgeFilter * edge filter used to fill edges. the {@link #levelEdgeFilter} reference will be set to * edgeFilter by this method, so make sure edgeFilter does not use it directly. */ protected void fillEdgesFromUsingFilter(CHEdgeFilter edgeFilter) { // we temporarily ignore the additionalEdgeF...
3.26
graphhopper_MMapDataAccess_clean_rdh
/** * Cleans up MappedByteBuffers. Be sure you bring the segments list in a consistent state * afterwards. * <p> * * @param from * inclusive * @param to * exclusive */private void clean(int from, int to) { for (int i = from; i < to; i++) { ByteBuffer bb = segments.get(i); cleanMapped...
3.26
graphhopper_MMapDataAccess_load_rdh
/** * Load memory mapped files into physical memory. */ public void load(int percentage) { if ((percentage < 0) || (percentage > 100)) throw new IllegalArgumentException((("Percentage for MMapDataAccess.load for " + getName()) + " must be in [0,100] but was ") + percentage); int max = Math.round((segments.size()...
3.26
graphhopper_RoadDensityCalculator_calcRoadDensity_rdh
/** * * @param radius * in meters * @param calcRoadFactor * weighting function. use this to define how different kinds of roads shall contribute to the calculated road density * @return the road density in the vicinity of the given edge, i.e. the weighted road length divided by the squared radius */ public d...
3.26
graphhopper_RoadDensityCalculator_calcRoadDensities_rdh
/** * Loops over all edges of the graph and calls the given edgeHandler for each edge. This is done in parallel using * the given number of threads. For every call we can calculate the road density using the provided thread local * road density calculator. */ public static void calcRoadDensities(Graph graph, BiCons...
3.26
graphhopper_ReferentialIntegrityError_compareTo_rdh
/** * must be comparable to put into mapdb */ @Override public int compareTo(GTFSError o) { int compare = super.compareTo(o); if (compare != 0) return compare; return this.badReference.compareTo(((ReferentialIntegrityError) (o)).badReference); }
3.26
graphhopper_Path_getWeight_rdh
/** * This weight will be updated during the algorithm. The initial value is maximum double. */ public double getWeight() { return weight; }
3.26
graphhopper_Path_calcEdges_rdh
/** * Returns the list of all edges. */ public List<EdgeIteratorState> calcEdges() { final List<EdgeIteratorState> v5 = new ArrayList<>(edgeIds.size()); if (edgeIds.isEmpty()) return v5; forEveryEdge(new EdgeVisitor() { @Override public void next(EdgeIteratorState eb, in...
3.26
graphhopper_Path_forEveryEdge_rdh
/** * Iterates over all edges in this path sorted from start to end and calls the visitor callback * for every edge. * <p> * * @param visitor * callback to handle every edge. The edge is decoupled from the iterator and can * be stored. */ public void forEveryEdge(EdgeVisitor visitor) { int tmpNode = m0(...
3.26
graphhopper_Path_setFromNode_rdh
/** * We need to remember fromNode explicitly as its not saved in one edgeId of edgeIds. */public Path setFromNode(int from) { fromNode = from; return this; }
3.26
graphhopper_Path_getDistance_rdh
/** * * @return distance in meter */ public double getDistance() { return distance; }
3.26
graphhopper_Path_calcPoints_rdh
/** * This method calculated a list of points for this path * <p> * * @return the geometry of this path */ public PointList calcPoints() { final PointList points = new PointList(edgeIds.size() + 1, nodeAccess.is3D()); if (edgeIds.isEmpty()) { if (isFound()) { points.add(nodeAccess, en...
3.26
graphhopper_Path_getTime_rdh
/** * * @return time in millis */ public long getTime() { return time; }
3.26
graphhopper_Path_getFinalEdge_rdh
/** * Yields the final edge of the path */ public EdgeIteratorState getFinalEdge() { return graph.getEdgeIteratorState(edgeIds.get(edgeIds.size() - 1), endNode); }
3.26
graphhopper_Path_calcNodes_rdh
/** * * @return the uncached node indices of the tower nodes in this path. */ public IntIndexedContainer calcNodes() { final IntArrayList nodes = new IntArrayList(edgeIds.size() + 1); if (edgeIds.isEmpty()) { if (isFound()) { nodes.add(endNode); ...
3.26
graphhopper_Path_m0_rdh
/** * * @return the first node of this Path. */ private int m0() { if (fromNode < 0) throw new IllegalStateException("fromNode < 0 should not happen"); return fromNode; }
3.26
graphhopper_OSMFileHeader_create_rdh
/** * Constructor for XML Parser */ public static OSMFileHeader create(long id, XMLStreamReader parser) throws XMLStreamException { OSMFileHeader header = new OSMFileHeader(); parser.nextTag(); return header; }
3.26
graphhopper_CarAverageSpeedParser_applyBadSurfaceSpeed_rdh
/** * * @param way * needed to retrieve tags * @param speed * speed guessed e.g. from the road type or other tags * @return The assumed speed */ protected double applyBadSurfaceSpeed(ReaderWay way, double speed) { // limit speed if bad surface if (((badSurfaceSpeed > 0) && isValidSpeed(speed)) && (...
3.26
graphhopper_MaxHeight_create_rdh
/** * Currently enables to store 0.1 to max=0.1*2⁷m and infinity. If a value is between the maximum and infinity * it is assumed to use the maximum value. */ public static DecimalEncodedValue create() { return new DecimalEncodedValueImpl(KEY, 7, 0, 0.1, false, false, true); }
3.26
graphhopper_OSMReaderConfig_setMaxWayPointDistance_rdh
/** * This parameter affects the routine used to simplify the edge geometries (Ramer-Douglas-Peucker). Higher values mean * more details are preserved. The default is 1 (meter). Simplification can be disabled by setting it to 0. */ public OSMReaderConfig setMaxWayPointDistance(double maxWayPointDistance) { this.max...
3.26
graphhopper_OSMReaderConfig_setWorkerThreads_rdh
/** * Sets the number of threads used for the OSM import */ public OSMReaderConfig setWorkerThreads(int workerThreads) { this.workerThreads = workerThreads; return this; }
3.26
graphhopper_OSMReaderConfig_setElevationMaxWayPointDistance_rdh
/** * Sets the max elevation discrepancy between way points and the simplified polyline in meters */ public OSMReaderConfig setElevationMaxWayPointDistance(double elevationMaxWayPointDistance) { this.elevationMaxWayPointDistance = elevationMaxWayPointDistance; return this; }
3.26
graphhopper_OSMReaderConfig_setLongEdgeSamplingDistance_rdh
/** * Sets the distance between elevation samples on long edges */ public OSMReaderConfig setLongEdgeSamplingDistance(double longEdgeSamplingDistance) { this.longEdgeSamplingDistance = longEdgeSamplingDistance; return this; }
3.26
graphhopper_TurnCostStorage_set_rdh
/** * Sets the turn cost at the viaNode when going from "fromEdge" to "toEdge" */ public void set(DecimalEncodedValue turnCostEnc, int fromEdge, int viaNode, int toEdge, double cost) { long pointer = findOrCreateTurnCostEntry(fromEdge, viaNode, toEdge); if (pointer < 0) throw new IllegalStateException...
3.26
graphhopper_TurnCostStorage_getAllTurnCosts_rdh
// TODO: Maybe some of the stuff above could now be re-implemented in a simpler way with some of the stuff below. // For now, I just wanted to iterate over all entries. /** * Returns an iterator over all entries. * * @return an iterator over all entries. */ public Iterator getAllTurnCosts() { return new Itr(); ...
3.26
graphhopper_HmmProbabilities_transitionLogProbability_rdh
/** * Returns the logarithmic transition probability density for the given * transition parameters. * * @param routeLength * Length of the shortest route [m] between two * consecutive map matching candidates. * @param linearDistance * Linear distance [m] between two consecutive GPS * measurements. */ ...
3.26
graphhopper_HmmProbabilities_emissionLogProbability_rdh
/** * Returns the logarithmic emission probability density. * * @param distance * Absolute distance [m] between GPS measurement and map * matching candidate. */ public double emissionLogProbability(double distance) { return Distributions.logNormalDistribution(sigma, distance); }
3.26
graphhopper_ShortcutUnpacker_visitOriginalEdgesFwd_rdh
/** * Finds an edge/shortcut with the given id and adjNode and calls the visitor for each original edge that is * packed inside this shortcut (or if an original edge is given simply calls the visitor on it). * * @param reverseOrder * if true the original edges will be traversed in reverse order */ public void v...
3.26
graphhopper_RouterConfig_setCalcPoints_rdh
/** * This methods enables gps point calculation. If disabled only distance will be calculated. */ public void setCalcPoints(boolean calcPoints) { this.calcPoints = calcPoints; }
3.26
graphhopper_RouterConfig_setTimeoutMillis_rdh
/** * Limits the runtime of routing requests to the given amount of milliseconds. This only works up to a certain * precision, but should be sufficient to cancel long-running requests in most cases. The exact implementation of * the timeout depends on the routing algorithm. */public void setTimeoutMillis(long timeo...
3.26
graphhopper_RouterConfig_setSimplifyResponse_rdh
/** * This method specifies if the returned path should be simplified or not, via Ramer-Douglas-Peucker * or similar algorithm. */ public void setSimplifyResponse(boolean simplifyResponse) { this.f0 = simplifyResponse; }
3.26
graphhopper_InstructionsOutgoingEdges_getSpeed_rdh
/** * Will return the tagged maxspeed, if available, if not, we use the average speed * TODO: Should we rely only on the tagged maxspeed? */ private double getSpeed(EdgeIteratorState edge) { double maxSpeed = edge.get(maxSpeedEnc); if (Double.isInfinite(maxSpeed)) return (edge.getDistance() / weight...
3.26
graphhopper_InstructionsOutgoingEdges_getVisibleTurns_rdh
/** * This method calculates the number of all outgoing edges, which could be considered the number of roads you see * at the intersection. This excludes the road you are coming from and also inaccessible roads. */ public int getVisibleTurns() { return 1 + visibleAlternativeTurns.size(); }
3.26
graphhopper_InstructionsOutgoingEdges_outgoingEdgesAreSlowerByFactor_rdh
/** * 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. */ public boolean outgoingEdgesAreSlowerByFactor(double factor) { double tmpSpeed = getSpeed(currentEdge); double pathSpeed = getSpeed...
3.26
graphhopper_InstructionsOutgoingEdges_isLeavingCurrentStreet_rdh
/** * 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. */ public boolea...
3.26
graphhopper_EdgeIterator_isValid_rdh
/** * Checks if a given integer edge ID is valid or not. Edge IDs >= 0 are considered valid, while negative * values are considered as invalid. However, some negative values are used as special values, e.g. {@link #NO_EDGE}. */ public static boolean isValid(int edgeId) {return edgeId >= 0; }
3.26
graphhopper_SRTMProvider_init_rdh
/** * The URLs are a bit ugly and so we need to find out which area name a certain lat,lon * coordinate has. */ private SRTMProvider init() { try { String strs[] = new String[]{ "Africa", "Australia", "Eurasia", "Islands", "North_America", "South_America" }; for (String str : strs...
3.26
graphhopper_MaxLength_create_rdh
/** * Currently enables to store 0.1 to max=0.1*2⁷m and infinity. If a value is * between the maximum and infinity it is assumed to use the maximum value. */ public static DecimalEncodedValue create() { return new DecimalEncodedValueImpl(KEY, 7, 0, 0.1, false, false, true); }
3.26
graphhopper_IntsRef_isValid_rdh
/** * Performs internal consistency checks. * Always returns true (or throws IllegalStateException) */ public boolean isValid() { if (ints == null) { throw new IllegalStateException("ints is null"); } if (length < 0) { throw new IllegalStateException("length is negative: " + length); ...
3.26
graphhopper_IntsRef_deepCopyOf_rdh
/** * Creates a new IntsRef that points to a copy of the ints from * <code>other</code> * <p> * The returned IntsRef will have a length of other.length * and an offset of zero. */ public static IntsRef deepCopyOf(IntsRef other) { return new IntsRef(Arrays.copyOfRange(other.ints, other.f0, other.f0 + other.len...
3.26
graphhopper_IntsRef_compareTo_rdh
/** * Signed int order comparison */ @Override public int compareTo(IntsRef other) { if (this == other) return 0; final int[] v8 = this.ints; int aUpto = this.f0; final int[] bInts = other.ints; int bUpto = other.f0; final int aStop = aUpto + Math.min(this.length, other.le...
3.26
graphhopper_KVStorage_add_rdh
/** * This method writes the specified entryMap (key-value pairs) into the storage. Please note that null keys or null * values are rejected. The Class of a value can be only: byte[], String, int, long, float or double * (or more precisely, their wrapper equivalent). For all other types an exception is thrown. The f...
3.26
graphhopper_KVStorage_getMap_rdh
/** * Please note that this method ignores potentially different tags for forward and backward direction. To avoid this * use {@link #getAll(long)} instead. */ public Map<String, Object> getMap(final long entryPointer) { if (entryPointer < 0) throw new IllegalStateException("Pointer to access KVStorage c...
3.26
graphhopper_KVStorage_isEquals_rdh
// compared to entries.equals(lastEntries) this method avoids a NPE if a value is null and throws an IAE instead private boolean isEquals(List<KeyValue> entries, List<KeyValue> lastEntries) { if ((lastEntries != null) && (entries.size() == lastEntries.size())) { for (int i = 0; i < entries.size(); i++) { ...
3.26
graphhopper_KVStorage_deserializeObj_rdh
/** * This method creates an Object (type Class) which is located at the specified pointer */ private Object deserializeObj(AtomicInteger sizeOfObject, long pointer, Class<?> clazz) { if (hasDynLength(clazz)) {int valueLength = vals.getByte(pointer) & 0xff; pointer++; ...
3.26
graphhopper_KVStorage_cutString_rdh
/** * This method limits the specified String value to the length currently accepted for values in the KVStorage. */ public static String cutString(String value) { byte[] bytes = value.getBytes(Helper.UTF_CS); // See #2609 and test why we use a value < 255 return bytes.length > 250 ? new String(bytes, 0,...
3.26
graphhopper_GpxConversions_calcAzimuth_rdh
/** * Return the azimuth in degree based on the first tracksegment of this instruction. If this * instruction contains less than 2 points then NaN will be returned or the specified * instruction will be used if that is the finish instruction. */ public static double calcAzimuth(Instruction instruction, Instruction ...
3.26
graphhopper_GpxConversions_calcDirection_rdh
/** * Return the direction like 'NE' based on the first tracksegment of the instruction. If * Instruction does not contain enough coordinate points, an empty string will be returned. */ public static String calcDirection(Instruction instruction, Instruction nextI) { double azimuth = calcAzimuth(instruction, nex...
3.26
graphhopper_AbstractAverageSpeedParser_isValidSpeed_rdh
/** * * @return <i>true</i> if the given speed is not {@link Double#NaN} */protected static boolean isValidSpeed(double speed) { return !Double.isNaN(speed); }
3.26
graphhopper_AbstractAverageSpeedParser_m0_rdh
/** * * @return {@link Double#NaN} if no maxspeed found */ public static double m0(ReaderWay way, boolean bwd) { double maxSpeed = OSMValueExtractor.stringToKmh(way.getTag("maxspeed")); double directedMaxSpeed = OSMValueExtractor.stringToKmh(way.getTag(bwd ? "maxspeed:backward" : "maxspeed:forward")); r...
3.26
graphhopper_TurnCost_m0_rdh
/** * This creates an EncodedValue specifically for the turn costs */ public static DecimalEncodedValue m0(String name, int maxTurnCosts) { int turnBits = BitUtil.countBitValue(maxTurnCosts); return new DecimalEncodedValueImpl(key(name), turnBits, 0, 1, false, false, true); }
3.26
graphhopper_AbstractBidirAlgo_finished_rdh
// a node from overlap may not be on the best path! // => when scanning an arc (v, w) in the forward search and w is scanned in the reverseOrder // search, update extractPath = μ if df (v) + (v, w) + dr (w) < μ protected boolean finished() {if (finishedFrom || finishedTo) return true; return (currFrom...
3.26
graphhopper_Instruction_setUseRawName_rdh
/** * This method does not perform translation or combination with the sign - it just uses the * provided name as instruction. */ public void setUseRawName() { rawName = true; }
3.26
graphhopper_Instruction_getSign_rdh
/** * The instruction for the person/driver to execute. */ public int getSign() {return sign; }
3.26
graphhopper_OSMInputFile_setWorkerThreads_rdh
/** * Currently only for pbf format. Default is number of cores. */ public OSMInputFile setWorkerThreads(int threads) { f1 = threads; return this; }
3.26
graphhopper_HeadingResolver_getEdgesWithDifferentHeading_rdh
/** * Returns a list of edge IDs of edges adjacent to the given base node that do *not* have the same or a similar * heading as the given heading. If for example the tolerance is 45 degrees this method returns all edges for which * the absolute difference to the given heading is greater than 45 degrees. The heading ...
3.26
graphhopper_DistanceCalcEarth_calcCircumference_rdh
/** * Circumference of the earth at different latitudes (breitengrad) */ public double calcCircumference(double lat) { return ((2 * PI) * R) * cos(toRadians(lat)); }
3.26
graphhopper_DistanceCalcEarth_calcDist_rdh
/** * Calculates distance of (from, to) in meter. * <p> * http://en.wikipedia.org/wiki/Haversine_formula a = sin²(Δlat/2) + * cos(lat1).cos(lat2).sin²(Δlong/2) c = 2.atan2(√a, √(1−a)) d = R.c */ @Override public double calcDist(double fromLat, double fromLon, double toLat, double toLon) { double normedDist = ...
3.26
graphhopper_DistanceCalcEarth_calcNormalizedDist_rdh
/** * Returns the specified length in normalized meter. */ @Override public double calcNormalizedDist(double dist) { double tmp = sin((dist / 2) / R); return tmp * tmp; }
3.26
graphhopper_InstructionsFromEdges_calcInstructions_rdh
/** * * @return the list of instructions for this path. */ public static InstructionList calcInstructions(Path path, Graph graph, Weighting weighting, EncodedValueLookup evLookup, final Translation tr) { final InstructionList ways = new InstructionList(tr); if (path.isFound()) { if (path.getEdgeCoun...
3.26
graphhopper_GTFSFeed_fastDistance_rdh
/** * * @return Equirectangular approximation to distance. */ public static double fastDistance(double lat0, double lon0, double lat1, double lon1) { double midLat = (lat0 + lat1) / 2; double xscale = Math.cos(Math.toRadians(midLat)); double dx = xscale * (lon1 - lon0); double dy = lat1 - lat0; ...
3.26
graphhopper_GTFSFeed_getOrderedStopTimesForTrip_rdh
/** * For the given trip ID, fetch all the stop times in order of increasing stop_sequence. * This is an efficient iteration over a tree map. */ public Iterable<StopTime> getOrderedStopTimesForTrip(String trip_id) { Map<Fun.Tuple2, StopTime> v3 = stop_times.subMap(Fun.t2(trip_id, null), Fun.t2(trip_id, Fun....
3.26
graphhopper_GTFSFeed_loadFromZipfileOrDirectory_rdh
/** * The order in which we load the tables is important for two reasons. * 1. We must load feed_info first so we know the feed ID before loading any other entities. This could be relaxed * by having entities point to the feed object rather than its ID String. * 2. Referenced entities must be loaded before any enti...
3.26
graphhopper_GTFSFeed_clone_rdh
/** * Cloning can be useful when you want to make only a few modifications to an existing feed. * Keep in mind that this is a shallow copy, so you'll have to create new maps in the clone for tables you want * to modify. */ @Override public GTFSFeed clone() { try { return ((GTFSFeed) (super.clone())...
3.26
graphhopper_GTFSFeed_getShape_rdh
/** * Get the shape for the given shape ID */ public Shape getShape(String shape_id) { Shape shape = new Shape(this, shape_id); return shape.shape_dist_traveled.length > 0 ? shape : null; }
3.26
graphhopper_GTFSFeed_getInterpolatedStopTimesForTrip_rdh
/** * For the given trip ID, fetch all the stop times in order, and interpolate stop-to-stop travel times. */ public Iterable<StopTime> getInterpolatedStopTimesForTrip(String trip_id) throws FirstAndLastStopsDoNotHaveTimes { // clone stop times so as not to modify base GTFS structures StopTime[] stopTimes = ...
3.26
graphhopper_GTFSFeed_getTripGeometry_rdh
/** * Returns a trip geometry object (LineString) for a given trip id. * If the trip has a shape reference, this will be used for the geometry. * Otherwise, the ordered stoptimes will be used. * * @param trip_id * trip id of desired trip geometry * @return the LineString representing the trip geometry. * @see...
3.26
graphhopper_PrepareEncoder_getScDirMask_rdh
/** * A bitmask for two directions */ public static int getScDirMask() {return scDirMask; }
3.26
graphhopper_AngleCalc_m0_rdh
/** * Change the representation of an orientation, so the difference to the given baseOrientation * will be smaller or equal to PI (180 degree). This is achieved by adding or subtracting a * 2*PI, so the direction of the orientation will not be changed */ public double m0(double baseOrientation, double orientation)...
3.26
graphhopper_AngleCalc_convertAzimuth2xaxisAngle_rdh
/** * convert north based clockwise azimuth (0, 360) into x-axis/east based angle (-Pi, Pi) */ public double convertAzimuth2xaxisAngle(double azimuth) { if ((Double.compare(azimuth, 360) > 0) || (Double.compare(azimuth, 0) < 0)) { throw new IllegalArgumentException(("Azimuth " + azimuth) + " mu...
3.26
graphhopper_AngleCalc_calcAzimuth_rdh
/** * Calculate the azimuth in degree for a line given by two coordinates. Direction in 'degree' * where 0 is north, 90 is east, 180 is south and 270 is west. */ public double calcAzimuth(double lat1, double lon1, double lat2, double lon2) { double orientation = (M...
3.26
graphhopper_AngleCalc_calcOrientation_rdh
/** * Return orientation of line relative to east. * <p> * * @param exact * If false the atan gets calculated faster, but it might contain small errors * @return Orientation in interval -pi to +pi where 0 is east */ public double calcOrientation(double lat1, double lon1, double lat2, double lon2, boolean exact...
3.26
graphhopper_PbfRawBlob_getType_rdh
/** * Gets the type of data represented by this blob. This corresponds to the type field in the * blob header. * <p> * * @return The blob type. */ public String getType() { return type; }
3.26