Exemplo n.º 1
0
        public static JGeometry.IGeometryObject Geometry2JG(Geometry.Geometry geom)
        {
            JGeometry.IGeometryObject igeometry;
            switch (geom.geometryType)
            {
            case OSGeo.OGR.wkbGeometryType.wkbPoint:
                igeometry = Point2JG((PointD)geom);
                break;

            case OSGeo.OGR.wkbGeometryType.wkbLineString:
                igeometry = Polyline2JG((SimplePolyline)geom);
                break;

            case OSGeo.OGR.wkbGeometryType.wkbPolygon:
                igeometry = Polygon2JG((SimplePolygon)geom);
                break;

            case OSGeo.OGR.wkbGeometryType.wkbMultiLineString:
                igeometry = MultiPolyline2JG((Polyline)geom);
                break;

            case OSGeo.OGR.wkbGeometryType.wkbMultiPolygon:
                igeometry = MultiPolygon2JG((Polygon)geom);
                break;

            default:
                igeometry = MultiPolygon2JG((Polygon)geom);
                break;
            }

            return(igeometry);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="offsetx"></param>
        /// <param name="offsety"></param>
        public void SelectedFeaturesPan(double offsetx, double offsety, FeatureCollection collection)
        {
            if (collection == null || collection.featureList.Count == 0)
            {
                return;
            }
            foreach (Feature feature in collection.featureList)
            {
                Geometry.Geometry geo = feature.geometry;
                switch (geo.geometryType)
                {
                case OSGeo.OGR.wkbGeometryType.wkbPoint:
                    PointD point = (PointD)geo;
                    point.X -= offsetx;
                    point.Y -= offsety;
                    break;

                case OSGeo.OGR.wkbGeometryType.wkbLineString:
                    SimplePolyline line = (SimplePolyline)geo;
                    foreach (PointD ringpoint in line.points)
                    {
                        ringpoint.X -= offsetx;
                        ringpoint.Y -= offsety;
                    }
                    break;

                case OSGeo.OGR.wkbGeometryType.wkbPolygon:
                    SimplePolygon simplegon = (SimplePolygon)geo;
                    foreach (SimplePolyline ring in simplegon.rings)
                    {
                        foreach (PointD ringpoint in ring.points)
                        {
                            ringpoint.X -= offsetx;
                            ringpoint.Y -= offsety;
                        }
                    }
                    break;
                }
            }
        }
Exemplo n.º 3
0
 public void SetGeometry(GisSmartTools.Geometry.Geometry newGeometry)
 {
     this.geometry = newGeometry;
 }