Ejemplo n.º 1
0
 private void ConvertMultiGeometry(MultiGeometryType multiGeometry)
 {
     foreach (GeometryType geometry in multiGeometry.Items)
     {
         this.ConvertGeometry(geometry);
     }
 }
Ejemplo n.º 2
0
        static public AbstractGeometryType ToKml(IGeometry geometry)
        {
            if (geometry is IPoint)
            {
                PointType point = new PointType();
                point.coordinates = ((IPoint)geometry).X.ToString(_nhi) + "," + ((IPoint)geometry).Y.ToString(_nhi);
                return(point);
            }
            else if (geometry is IMultiPoint)
            {
            }
            else if (geometry is IPolyline)
            {
                IPolyline pLine = (IPolyline)geometry;
                if (pLine.PathCount == 1)
                {
                    LineStringType line = new LineStringType();
                    line.coordinates = ToKmlCoordinates(pLine[0]);
                    return(line);
                }
                else if (pLine.PathCount > 1)
                {
                    MultiGeometryType mGeom = new MultiGeometryType();
                    mGeom.Items = new AbstractGeometryType[pLine.PathCount];
                    for (int i = 0, to = pLine.PathCount; i < to; i++)
                    {
                        LineStringType line = new LineStringType();
                        line.coordinates = ToKmlCoordinates(pLine[i]);
                        mGeom.Items[i]   = line;
                    }
                }
            }
            else if (geometry is IPolygon)
            {
                //IPolygon poly = (IPolygon)geometry;
                //PolygonType polygon = new PolygonType();

                //polygon.o
            }
            return(null);
        }