// private static final byte ZOOM_NAME = (byte) 16; /// <summary> /// Constructs a new TDNode from a given osmosis node entity. Checks the validity of the entity. /// </summary> /// <param name="node"> /// the osmosis entity </param> /// <param name="preferredLanguages"> /// the preferred language(s) or null if no preference </param> /// <returns> a new TDNode </returns> public static TDNode fromNode(Node node, IList <string> preferredLanguages) { SpecialTagExtractionResult ster = OSMUtils.extractSpecialFields(node, preferredLanguages); short[] knownWayTags = OSMUtils.extractKnownPOITags(node); return(new TDNode(node.Id, LatLongUtils.degreesToMicrodegrees(node.Latitude), LatLongUtils.degreesToMicrodegrees(node.Longitude), ster.Elevation, ster.Layer, ster.Housenumber, ster.Name, knownWayTags)); }
private static IList <int?> toCoordinateList(Geometry jtsGeometry) { Coordinate[] jtsCoords = jtsGeometry.Coordinates; List <int?> result = new List <int?>(); for (int j = 0; j < jtsCoords.Length; j++) { LatLong geoCoord = new LatLong(jtsCoords[j].y, jtsCoords[j].x, true); result.Add(Convert.ToInt32(LatLongUtils.degreesToMicrodegrees(geoCoord.latitude))); result.Add(Convert.ToInt32(LatLongUtils.degreesToMicrodegrees(geoCoord.longitude))); } return(result); }
public MockTDNode(double lat, double lon) : base(0, LatLongUtils.degreesToMicrodegrees(lat), LatLongUtils.degreesToMicrodegrees(lon), (short)0, (sbyte)0, null, null) { }