Esempio n. 1
0
        public void Operations()
        {
            //Prepare data
            Geometry gPn = GeometryFromWKT.Parse(Point);

            gPn.SRID = 0;
            Geometry gMp = GeometryFromWKT.Parse(Multipoint);

            gMp.SRID = 0;
            Geometry gLi = GeometryFromWKT.Parse(Linestring);

            gLi.SRID = 0;
            Geometry gML = GeometryFromWKT.Parse(MultiLinestring);

            gML.SRID = 0;
            Geometry gPl = GeometryFromWKT.Parse(Polygon);

            gPl.SRID = 0;

            Geometry gPnBuffer30 = SpatialOperationsEx.Buffer(gPn, 30);

            System.Diagnostics.Trace.WriteLine(gPnBuffer30.ToString());

            Geometry gPnBuffer30IntersectiongPl = SpatialOperationsEx.Intersection(gPnBuffer30, gPl);

            System.Diagnostics.Trace.WriteLine(gPnBuffer30IntersectiongPl.ToString());

            Geometry gUnion = SpatialOperationsEx.Union(gPn, gMp, gML, gLi, gPl);

            System.Diagnostics.Trace.WriteLine(gUnion.ToString());
        }
Esempio n. 2
0
        public void Operations()
        {
            //Prepare data
            Geometry gPn = GeometryFromWKT.Parse(Point);
            Geometry gMp = GeometryFromWKT.Parse(Multipoint);
            Geometry gLi = GeometryFromWKT.Parse(Linestring);
            Geometry gML = GeometryFromWKT.Parse(MultiLinestring);
            Geometry gPl = GeometryFromWKT.Parse(Polygon);

            Geometry gPnBuffer30 = SpatialOperationsEx.Buffer(gPn, 30);

            Console.WriteLine(gPnBuffer30.ToString());

            Geometry gPnBuffer30IntersectiongPl = SpatialOperationsEx.Intersection(gPnBuffer30, gPl);

            Console.WriteLine(gPnBuffer30IntersectiongPl.ToString());

            Geometry gUnion = SpatialOperationsEx.Union(gPn, gMp, gML, gLi, gPl);

            Console.WriteLine(gUnion.ToString());
        }
Esempio n. 3
0
        public void Operations(SqlServerSpatialObjectType spatialType, double bufferDist)
        {
            int srid = (spatialType == SqlServerSpatialObjectType.Geometry ? 0 : 4326);

            //Prepare data
            var gPn = GeometryFromWKT.Parse(Point);

            gPn.SRID = srid;
            var gMp = GeometryFromWKT.Parse(Multipoint);

            gMp.SRID = srid;
            var gLi = GeometryFromWKT.Parse(Linestring);

            gLi.SRID = srid;
            var gML = GeometryFromWKT.Parse(MultiLinestring);

            gML.SRID = srid;
            var gPl = GeometryFromWKT.Parse(Polygon);

            gPl.SRID = srid;

            System.Diagnostics.Trace.WriteLine(spatialType.ToString());
            if (spatialType == SqlServerSpatialObjectType.Geography)
            {
                System.Diagnostics.Trace.WriteLine("SqlServer syntax (STGeomFromText does not require .ReorientObject()):  SELECT geography::STGeomFromText(' insert WKT '), 4326)");
            }

            var gPnBuffer30 = SpatialOperationsEx.Buffer(gPn, bufferDist, spatialType);

            System.Diagnostics.Trace.WriteLine(gPnBuffer30.ToString());

            var gPnBuffer30IntersectiongPl = SpatialOperationsEx.Intersection(gPnBuffer30, gPl, spatialType);

            System.Diagnostics.Trace.WriteLine(gPnBuffer30IntersectiongPl.ToString());

            var gUnion = SpatialOperationsEx.Union(gPn, spatialType, gMp, gML, gLi, gPl);

            System.Diagnostics.Trace.WriteLine(gUnion.ToString());
        }