Пример #1
0
        static LineList ConvertedGeoLines(GeoLineList geoLines, CoordinateMap coordinateMap = null)
        {
            LineList lines = new LineList();

            if (coordinateMap == null)
            {
                coordinateMap = MakeCoordinateMap(geoLines);
                DebugLogText(LogLevel.DEBUG, "Created coordinate map: {0}", coordinateMap);
            }

            int lineCount  = 0;
            int pointCount = 0;

            foreach (GeoLine line in geoLines)
            {
                line.SetPrecision(EarthGeo.GeoPrecision);

                /** convert to local coordinate system */
                PointD p1 = coordinateMap.GetPixelPoint(line.P1 as GeoPoint).Round(3) as PointD;
                p1.Name = String.Format("Pt {0}", ++pointCount);

                PointD p2 = coordinateMap.GetPixelPoint(line.P2 as GeoPoint).Round(3) as PointD;
                p2.Name = String.Format("Pt {0}", ++pointCount);

                Line l = new Line(p1, p2);
                l.Name = String.Format("Line {0}", ++lineCount);
                lines.Add(l);

                DebugLogText(LogLevel.DEBUG, "Converted Line {0} {1} to {2}", line, lineCount, l);
            }

            return(lines);
        }
Пример #2
0
 public override PointD ConvertPointToPointD(GeoPoint original)
 {
     return((original is GeoPoint) ? _coordinateMap.GetPixelPoint(original as GeoPoint).Round(3) as PointD : original.Round(3) as PointD);
 }