Пример #1
0
        private void SetStartingPoint()
        {
            // Add 1m/1m (just for visualization) and set first point of it as THE starting point.
            SqlGeometry startingSquareKm = GeometryExtensions.FromWkt("POLYGON((12389976.191540662 -33080.958851181334,12389976.191540662 -33081.958851181334,12389977.191540662 -33081.958851181334,12389977.191540662 -33080.958851181334,12389976.191540662 -33080.958851181334))", 3857);

            mapControl.Add(startingSquareKm);
            assigner.SetStartingPoint(startingSquareKm.STPointN(1));
            {
                var connection = App.GetConnection(connectionString);

                foreach (var geom in connection.Select <Geom>("select top 1 gid, geom from dbo.tembak_hutan"))
                {
                    assigner.SetOuterBoundary(geom.Geometry);
                }
            }
            ShowData();
        }
Пример #2
0
        SqlGeometry generateSquare(double x, double y, double width, double height, int srid)
        {
            // Generate a rectangular polygon of specified coordinates with width/height
            SqlGeometry geo = GeometryExtensions.FromPointList
                              (
                new List <Point>()
            {
                new Point(x, y),
                new Point(x, y + width),
                new Point(x + width, y + height),
                new Point(x + width, y),
                new Point(x, y)
            }
                , srid
                              );

            return(geo);
        }