private GeoPointList decodeWayNodesDoubleDelta(int numberOfWayNodes) { GeoPointList waySegment = new GeoPointList(numberOfWayNodes); // get the first way node latitude offset (VBE-S) double wayNodeLatitude = this.tilePosition.Latitude + CoordinatesUtil.microdegreesToDegrees(this.readBuffer.ReadSignedInt()); // get the first way node longitude offset (VBE-S) double wayNodeLongitude = this.tilePosition.Longitude + CoordinatesUtil.microdegreesToDegrees(this.readBuffer.ReadSignedInt()); if (wayNodeLatitude > 90) { wayNodeLatitude = 90; } if (wayNodeLatitude < -90) { wayNodeLatitude = -90; } // store the first way node waySegment.Add(new GeoPoint(wayNodeLatitude, wayNodeLongitude)); double previousSingleDeltaLatitude = 0; double previousSingleDeltaLongitude = 0; for (int wayNodesIndex = 1; wayNodesIndex < numberOfWayNodes; ++wayNodesIndex) { // get the way node latitude double-delta offset (VBE-S) double doubleDeltaLatitude = CoordinatesUtil.microdegreesToDegrees(this.readBuffer.ReadSignedInt()); // get the way node longitude double-delta offset (VBE-S) double doubleDeltaLongitude = CoordinatesUtil.microdegreesToDegrees(this.readBuffer.ReadSignedInt()); double singleDeltaLatitude = doubleDeltaLatitude + previousSingleDeltaLatitude; double singleDeltaLongitude = doubleDeltaLongitude + previousSingleDeltaLongitude; wayNodeLatitude = wayNodeLatitude + singleDeltaLatitude; wayNodeLongitude = wayNodeLongitude + singleDeltaLongitude; if (wayNodeLatitude > 90) { wayNodeLatitude = 90; } if (wayNodeLatitude < -90) { wayNodeLatitude = -90; } waySegment.Add(new GeoPoint(wayNodeLatitude, wayNodeLongitude)); previousSingleDeltaLatitude = singleDeltaLatitude; previousSingleDeltaLongitude = singleDeltaLongitude; } return(waySegment); }
public new GeoPointList GetPath() { /** now work backwards along source paths */ GeoPointList path = new GeoPointList(); TreePathVertice vertice = m_Destination; TreePathVertice lastInserted; do { if (vertice == null) { throw new Exception("Can't compute path"); } path.Insert(0, _coordinateMap.GetGeoPoint(vertice.Position)); lastInserted = vertice; vertice = vertice.Source; }while(lastInserted != m_Origin); return(path); }
/** * Returns true if this extent intersects the minimum bounding rectangle * that encompasses a set of points. * @param input * Points to test against extent. */ public bool intersectsExtent(GeoPointList input) { GeoExtent input_extent = new GeoExtent(); input_extent.expandToInclude(input); return intersects(input_extent); }
/** * Modifies this extent to include a set of points. * @param points * Points to include. */ public void expandToInclude(GeoPointList input) { foreach (GeoPoint i in input) expandToInclude(i); }
/** * Returns if an entire set of points falls within this extent. * @param input * Set of points to test. */ public bool contains(GeoPointList input) { for (int i = 0; i < input.Count; i++) if (!contains(input[i])) return false; return true; }