示例#1
0
 private void AddVectorLines(StreamReader sr, List<GeoDisplayLine> tmpLines, string[] delimiter)
 {
     while (!sr.EndOfStream)
     {
         GeoXYLine line = new GeoXYLine();
         List<GeoXYPoint> geoPointFs = new List<GeoXYPoint>();
         string curLine = sr.ReadLine();
         int tmpPointsCount = this.CalcPoints(curLine);
         this.ReadXYPoints(tmpPointsCount, sr, delimiter, geoPointFs);
         line.Points = geoPointFs;
         if (line.PointsCount > 1)
         {
             GeoDisplayLine item = new GeoDisplayLine(line, this.m_DefaultLineStyle);
             item.AddFeature("PlanetVectorLineType", this.m_VectorType);
             tmpLines.Add(item);
             GeoXYRect miniEnclosingRect = line.GetMiniEnclosingRect();
             this.m_VectorBound.Left = Math.Min(this.m_VectorBound.Left, miniEnclosingRect.Left);
             this.m_VectorBound.Right = Math.Max(this.m_VectorBound.Right, miniEnclosingRect.Right);
             this.m_VectorBound.Top = Math.Max(this.m_VectorBound.Top, miniEnclosingRect.Top);
             this.m_VectorBound.Bottom = Math.Min(this.m_VectorBound.Bottom, miniEnclosingRect.Bottom);
         }
     }
 }
示例#2
0
 private void ReadPolyLine(int numParts, int numPoints)
 {
     int[] numArray = new int[numParts];
     for (int i = 0; i < numParts; i++)
     {
         numArray[i] = this.ReadInteger(ByteOrder.LittleEndian);
     }
     int index = 1;
     GeoXYLine line = new GeoXYLine();
     for (int j = 0; j < numPoints; j++)
     {
         double x = this.ReadDouble(ByteOrder.LittleEndian);
         double y = this.ReadDouble(ByteOrder.LittleEndian);
         GeoXYPoint point = new GeoXYPoint(x, y);
         if (index < numParts)
         {
             if (j < numArray[index])
             {
                 line.Points.Add(point);
             }
             else
             {
                 GeoDisplayLine line2 = new GeoDisplayLine(line, this.m_DefaultLineStyle);
                 index++;
             }
         }
         else
         {
             line.Points.Add(point);
         }
     }
     GeoDisplayLine item = new GeoDisplayLine(line, this.m_DefaultLineStyle);
     item.AddFeature("ID", this.CreateMapUnitId());
     this.m_PolyLineList.Add(item);
 }