Example #1
0
            public override void Reset()
            {
                GeometryPipeline current = this.Current;
                GeometryPipeline next    = this.Next;

                this.DoAction(new Action(current.Reset), new Action(next.Reset));
            }
Example #2
0
            public override void EndGeometry()
            {
                GeometryPipeline current = this.Current;
                GeometryPipeline next    = this.Next;

                this.DoAction(new Action(current.EndGeometry), new Action(next.EndGeometry));
            }
Example #3
0
            private void DoAction <T>(Action <T> handler, Action <T> delegation, T argument)
            {
                GeometryPipeline current = this.Current;
                GeometryPipeline next    = this.Next;

                ForwardingSegment.DoAction <T>(handler, new Action(current.Reset), delegation, new Action(next.Reset), argument);
            }
Example #4
0
            private void DoAction(Action handler, Action delegation)
            {
                GeometryPipeline current = this.Current;
                GeometryPipeline next    = this.Next;

                ForwardingSegment.DoAction(handler, new Action(current.Reset), delegation, new Action(next.Reset));
            }
Example #5
0
 public override void SendTo(GeometryPipeline pipeline)
 {
     base.SendTo(pipeline);
     pipeline.BeginGeometry(SpatialType.LineString);
     this.SendFigure(pipeline);
     pipeline.EndGeometry();
 }
Example #6
0
        public void NullPipelines()
        {
            SpatialPipeline   pipeline          = null;
            GeographyPipeline geographyPipeline = pipeline;
            GeometryPipeline  geometryPipeline  = pipeline;

            Assert.IsNull(geographyPipeline);
            Assert.IsNull(geometryPipeline);
        }
 public override void SendTo(GeometryPipeline pipeline)
 {
     base.SendTo(pipeline);
     pipeline.BeginGeometry(SpatialType.Collection);
     for (int i = 0; i < this.geometryArray.Length; i++)
     {
         this.geometryArray[i].SendTo(pipeline);
     }
     pipeline.EndGeometry();
 }
 public override void SendTo(GeometryPipeline pipeline)
 {
     base.SendTo(pipeline);
     pipeline.BeginGeometry(SpatialType.MultiPoint);
     for (int i = 0; i < this.points.Length; i++)
     {
         this.points[i].SendTo(pipeline);
     }
     pipeline.EndGeometry();
 }
 public override void SendTo(GeometryPipeline pipeline)
 {
     base.SendTo(pipeline);
     pipeline.BeginGeometry(SpatialType.Polygon);
     for (int i = 0; i < this.rings.Length; i++)
     {
         this.rings[i].SendFigure(pipeline);
     }
     pipeline.EndGeometry();
 }
 public override void SendTo(GeometryPipeline pipeline)
 {
     base.SendTo(pipeline);
     pipeline.BeginGeometry(SpatialType.Point);
     if (!this.IsEmpty)
     {
         pipeline.BeginFigure(new GeometryPosition(this.x, this.y, this.z, this.m));
         pipeline.EndFigure();
     }
     pipeline.EndGeometry();
 }
        public override void SendTo(GeometryPipeline pipeline)
        {
            base.SendTo(pipeline);
            pipeline.BeginGeometry(SpatialType.MultiLineString);

            for (int i = 0; i < this.lineStrings.Length; ++i)
            {
                this.lineStrings[i].SendTo(pipeline);
            }

            pipeline.EndGeometry();
        }
Example #12
0
        protected override void ReadGeometryImplementation(TextReader input)
        {
            MatchLine(input, "P");

            GeometryPipeline destination = this.Destination;

            destination.SetCoordinateSystem(CoordinateSystem.DefaultGeometry);
            destination.BeginGeometry(SpatialType.Point);
            destination.BeginFigure(new GeometryPosition(ExpectedGeometryResult.X,
                                                         ExpectedGeometryResult.Y, null, null));

            MatchLine(input, "T");

            destination.EndFigure();
            destination.EndGeometry();
        }
Example #13
0
        public static void DrawLine(GeometryPipeline pipeline, PositionData[] line)
        {
            for (int i = 0; i < line.Length; ++i)
            {
                PositionData currentLine = line[i];
                if (i == 0)
                {
                    pipeline.BeginFigure(new GeometryPosition(currentLine.X, currentLine.Y, currentLine.Z, currentLine.M));
                }
                else
                {
                    pipeline.LineTo(new GeometryPosition(currentLine.X, currentLine.Y, currentLine.Z, currentLine.M));
                }
            }

            pipeline.EndFigure();
        }
 internal static void SendFigure(this GeometryLineString GeometryLineString, GeometryPipeline pipeline)
 {
     Util.CheckArgumentNull(GeometryLineString, "GeometryLineString");
     for (int i = 0; i < GeometryLineString.Points.Count; i++)
     {
         GeometryPoint    point    = GeometryLineString.Points[i];
         GeometryPosition position = new GeometryPosition(point.X, point.Y, point.Z, point.M);
         if (i == 0)
         {
             pipeline.BeginFigure(position);
         }
         else
         {
             pipeline.LineTo(position);
         }
     }
     if (GeometryLineString.Points.Count > 0)
     {
         pipeline.EndFigure();
     }
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="output">The pipeline to redirect the calls to</param>
 public TypeWashedToGeometryPipeline(SpatialPipeline output)
 {
     this.output = output;
 }
Example #16
0
 public GeometryLoggingPipeline()
 {
     this.pipeline = new CallSequenceLoggingPipeline();
     this.drawGeometry = pipeline;
 }
Example #17
0
 public GeometryLoggingPipeline()
 {
     this.pipeline     = new CallSequenceLoggingPipeline();
     this.drawGeometry = pipeline;
 }
Example #18
0
 /// <summary>Sends the current spatial object to the given pipeline.</summary>
 /// <param name="chain">The spatial pipeline.</param>
 public virtual void SendTo(GeometryPipeline chain)
 {
     Util.CheckArgumentNull(chain, "chain");
     chain.SetCoordinateSystem(this.coordinateSystem);
 }
Example #19
0
 public static void DrawPoint(GeometryPipeline pipeline, PositionData point)
 {
     pipeline.BeginFigure(new GeometryPosition(point.X, point.Y, point.Z, point.M));
     pipeline.EndFigure();
 }
Example #20
0
 public static void DrawPoint(GeometryPipeline pipeline, PositionData point)
 {
     pipeline.BeginFigure(new GeometryPosition(point.X, point.Y, point.Z, point.M));
     pipeline.EndFigure();
 }
Example #21
0
        public static void DrawLine(GeometryPipeline pipeline, PositionData[] line)
        {
            for (int i = 0; i < line.Length; ++i)
            {
                PositionData currentLine = line[i];
                if (i == 0)
                {
                    pipeline.BeginFigure(new GeometryPosition(currentLine.X, currentLine.Y, currentLine.Z, currentLine.M));
                }
                else
                {
                    pipeline.LineTo(new GeometryPosition(currentLine.X, currentLine.Y, currentLine.Z, currentLine.M));
                }
            }

            pipeline.EndFigure();
        }
Example #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ForwardingSegment"/> class.
 /// </summary>
 /// <param name="currentGeography">The current geography.</param>
 /// <param name="currentGeometry">The current geometry.</param>
 public ForwardingSegment(GeographyPipeline currentGeography, GeometryPipeline currentGeometry)
     : this(new SpatialPipeline(currentGeography, currentGeometry))
 {
 }
Example #23
0
 /// <summary>Sends the current spatial object to the given pipeline.</summary>
 /// <param name="chain">The spatial pipeline.</param>
 public virtual void SendTo(GeometryPipeline chain)
 {
     Util.CheckArgumentNull(chain, "chain");
     chain.SetCoordinateSystem(this.coordinateSystem);
 }
Example #24
0
        public PlacesController()
        {
            data = new List <Place>();
            data.Add(new Place()
            {
                Id = 0, Name = "Place1", Description = "Desc", Entrance = GeographyPoint.Create(-1.56, 29.76)
            });
            data.Add(new Place()
            {
                Id = 1, Name = "Place1", Description = "Desc", Entrance = GeographyPoint.Create(-2.56, 19.76)
            });
            data.Add(new Place()
            {
                Id = 2, Name = "Place1", Description = "Desc", Entrance = GeographyPoint.Create(-3.56, 9.76)
            });
            data.Add(new Place()
            {
                Id = 3, Name = "Place1", Description = "Desc", Entrance = GeographyPoint.Create(-4.56, -9.76)
            });
            data.Add(new Place()
            {
                Id = 4, Name = "Place1", Description = "Desc", Entrance = GeographyPoint.Create(-10.56, -19.76)
            });


            for (int i = 0; i < data.Count; i++)
            {
                data[i].Gp = GeometryPoint.Create(-1.56 - i, 29.76 + i);

                SpatialBuilder    spatialBuilder    = SpatialBuilder.Create();
                GeographyPipeline geographyPipeline = spatialBuilder.GeographyPipeline;
                geographyPipeline.SetCoordinateSystem(CoordinateSystem.DefaultGeography);
                geographyPipeline.BeginGeography(SpatialType.LineString);
                geographyPipeline.BeginFigure(new GeographyPosition(-1.56, 29.76));
                geographyPipeline.LineTo(new GeographyPosition(-1.58, 29.78));
                geographyPipeline.LineTo(new GeographyPosition(5, 50));
                geographyPipeline.EndFigure();
                geographyPipeline.EndGeography();
                data[i].Ls = (GeographyLineString)spatialBuilder.ConstructedGeography;

                SpatialBuilder    spatialBuilder1    = SpatialBuilder.Create();
                GeographyPipeline geographyPipeline1 = spatialBuilder1.GeographyPipeline;
                geographyPipeline1.SetCoordinateSystem(CoordinateSystem.DefaultGeography);
                geographyPipeline1.BeginGeography(SpatialType.MultiPoint);
                geographyPipeline1.BeginFigure(new GeographyPosition(-1.56, 29.76));
                geographyPipeline1.EndFigure();
                geographyPipeline1.BeginFigure(new GeographyPosition(-3.56, 50));
                geographyPipeline1.EndFigure();
                geographyPipeline1.EndGeography();
                data[i].Mp = (GeographyMultiPoint)spatialBuilder1.ConstructedGeography;

                SpatialBuilder    spatialBuilder2    = SpatialBuilder.Create();
                GeographyPipeline geographyPipeline2 = spatialBuilder2.GeographyPipeline;
                geographyPipeline2.SetCoordinateSystem(CoordinateSystem.DefaultGeography);
                geographyPipeline2.BeginGeography(SpatialType.Polygon);
                geographyPipeline2.BeginFigure(new GeographyPosition(-2, 2));
                geographyPipeline2.LineTo(new GeographyPosition(2, 2));
                geographyPipeline2.LineTo(new GeographyPosition(2, -2));
                geographyPipeline2.LineTo(new GeographyPosition(-2, -2));
                geographyPipeline2.LineTo(new GeographyPosition(-2, 2));
                geographyPipeline2.EndFigure();
                geographyPipeline2.BeginFigure(new GeographyPosition(-1, 1));
                geographyPipeline2.LineTo(new GeographyPosition(1, 1));
                geographyPipeline2.LineTo(new GeographyPosition(1, -1));
                geographyPipeline2.LineTo(new GeographyPosition(-1, -1));
                geographyPipeline2.LineTo(new GeographyPosition(-1, 1));
                geographyPipeline2.EndFigure();
                geographyPipeline2.EndGeography();
                data[i].Pol = (GeographyPolygon)spatialBuilder2.ConstructedGeography;

                SpatialBuilder    spatialBuilder3    = SpatialBuilder.Create();
                GeographyPipeline geographyPipeline3 = spatialBuilder3.GeographyPipeline;
                geographyPipeline3.SetCoordinateSystem(CoordinateSystem.DefaultGeography);
                geographyPipeline3.BeginGeography(SpatialType.MultiPolygon);
                geographyPipeline3.BeginGeography(SpatialType.Polygon);
                geographyPipeline3.BeginFigure(new GeographyPosition(-2, 2));
                geographyPipeline3.LineTo(new GeographyPosition(2, 2));
                geographyPipeline3.LineTo(new GeographyPosition(2, -2));
                geographyPipeline3.LineTo(new GeographyPosition(-2, -2));
                geographyPipeline3.LineTo(new GeographyPosition(-2, 2));
                geographyPipeline3.EndFigure();
                geographyPipeline3.BeginFigure(new GeographyPosition(-1, 1));
                geographyPipeline3.LineTo(new GeographyPosition(1, 1));
                geographyPipeline3.LineTo(new GeographyPosition(1, -1));
                geographyPipeline3.LineTo(new GeographyPosition(-1, -1));
                geographyPipeline3.LineTo(new GeographyPosition(-1, 1));
                geographyPipeline3.EndFigure();
                geographyPipeline3.EndGeography();
                geographyPipeline3.BeginGeography(SpatialType.Polygon);
                geographyPipeline3.BeginFigure(new GeographyPosition(-4, 4));
                geographyPipeline3.LineTo(new GeographyPosition(4, 4));
                geographyPipeline3.LineTo(new GeographyPosition(4, -4));
                geographyPipeline3.LineTo(new GeographyPosition(-4, -4));
                geographyPipeline3.LineTo(new GeographyPosition(-4, 4));
                geographyPipeline3.EndFigure();
                geographyPipeline3.BeginFigure(new GeographyPosition(-1, 1));
                geographyPipeline3.LineTo(new GeographyPosition(1, 1));
                geographyPipeline3.LineTo(new GeographyPosition(1, -1));
                geographyPipeline3.LineTo(new GeographyPosition(-1, -1));
                geographyPipeline3.LineTo(new GeographyPosition(-1, 1));
                geographyPipeline3.EndFigure();
                geographyPipeline3.EndGeography();
                geographyPipeline3.EndGeography();
                data[i].MPol = (GeographyMultiPolygon)spatialBuilder3.ConstructedGeography;

                SpatialBuilder    spatialBuilder4    = SpatialBuilder.Create();
                GeographyPipeline geographyPipeline4 = spatialBuilder4.GeographyPipeline;
                geographyPipeline4.SetCoordinateSystem(CoordinateSystem.DefaultGeography);
                geographyPipeline4.BeginGeography(SpatialType.MultiLineString);
                geographyPipeline4.BeginGeography(SpatialType.LineString);
                geographyPipeline4.BeginFigure(new GeographyPosition(-1.56, 29.76));
                geographyPipeline4.LineTo(new GeographyPosition(-1.58, 29.78));
                geographyPipeline4.LineTo(new GeographyPosition(5, 50));
                geographyPipeline4.EndFigure();
                geographyPipeline4.EndGeography();
                geographyPipeline4.BeginGeography(SpatialType.LineString);
                geographyPipeline4.BeginFigure(new GeographyPosition(-2.56, 30.76));
                geographyPipeline4.LineTo(new GeographyPosition(-2.58, 30.78));
                geographyPipeline4.LineTo(new GeographyPosition(6, 51));
                geographyPipeline4.EndFigure();
                geographyPipeline4.EndGeography();
                geographyPipeline4.BeginGeography(SpatialType.LineString);
                geographyPipeline4.BeginFigure(new GeographyPosition(-1.56, 29.76));
                geographyPipeline4.LineTo(new GeographyPosition(-1.58, 29.78));
                geographyPipeline4.LineTo(new GeographyPosition(5, 50));
                geographyPipeline4.EndFigure();
                geographyPipeline4.EndGeography();
                geographyPipeline4.BeginGeography(SpatialType.LineString);
                geographyPipeline4.BeginFigure(new GeographyPosition(-2.56, 30.76));
                geographyPipeline4.LineTo(new GeographyPosition(-2.58, 30.78));
                geographyPipeline4.LineTo(new GeographyPosition(8, 52));
                geographyPipeline4.EndFigure();
                geographyPipeline4.EndGeography();
                geographyPipeline4.EndGeography();
                data[i].MLs = (GeographyMultiLineString)spatialBuilder4.ConstructedGeography;



                SpatialBuilder    spatialBuilder5    = SpatialBuilder.Create();
                GeographyPipeline geographyPipeline5 = spatialBuilder5.GeographyPipeline;
                geographyPipeline5.SetCoordinateSystem(CoordinateSystem.DefaultGeography);
                geographyPipeline5.BeginGeography(SpatialType.Collection);
                geographyPipeline5.BeginGeography(SpatialType.LineString);
                geographyPipeline5.BeginFigure(new GeographyPosition(-1.56, 29.76));
                geographyPipeline5.LineTo(new GeographyPosition(-1.58, 29.78));
                geographyPipeline5.LineTo(new GeographyPosition(5, 50));
                geographyPipeline5.EndFigure();
                geographyPipeline5.EndGeography();
                geographyPipeline5.BeginGeography(SpatialType.Point);
                geographyPipeline5.BeginFigure(new GeographyPosition(-1.56, 29.76));
                geographyPipeline5.EndFigure();
                geographyPipeline5.EndGeography();
                geographyPipeline5.BeginGeography(SpatialType.LineString);
                geographyPipeline5.BeginFigure(new GeographyPosition(-1.56, 29.76));
                geographyPipeline5.LineTo(new GeographyPosition(-1.58, 29.78));
                geographyPipeline5.LineTo(new GeographyPosition(5, 50));
                geographyPipeline5.EndFigure();
                geographyPipeline5.EndGeography();
                geographyPipeline5.EndGeography();
                data[i].Coll = (GeographyCollection)spatialBuilder5.ConstructedGeography;

                SpatialBuilder   spatialBuilder6    = SpatialBuilder.Create();
                GeometryPipeline geographyPipeline6 = spatialBuilder6.GeometryPipeline;
                geographyPipeline6.SetCoordinateSystem(CoordinateSystem.DefaultGeometry);
                geographyPipeline6.BeginGeometry(SpatialType.Collection);
                geographyPipeline6.BeginGeometry(SpatialType.LineString);
                geographyPipeline6.BeginFigure(new GeometryPosition(-1.56, 29.76));
                geographyPipeline6.LineTo(new GeometryPosition(-1.58, 29.78));
                geographyPipeline6.LineTo(new GeometryPosition(5, 50));
                geographyPipeline6.EndFigure();
                geographyPipeline6.EndGeometry();
                geographyPipeline6.BeginGeometry(SpatialType.Point);
                geographyPipeline6.BeginFigure(new GeometryPosition(-1.56, 29.76));
                geographyPipeline6.EndFigure();
                geographyPipeline6.EndGeometry();
                geographyPipeline6.BeginGeometry(SpatialType.LineString);
                geographyPipeline6.BeginFigure(new GeometryPosition(-1.56, 29.76));
                geographyPipeline6.LineTo(new GeometryPosition(-1.58, 29.78));
                geographyPipeline6.LineTo(new GeometryPosition(5, 50));
                geographyPipeline6.EndFigure();
                geographyPipeline6.EndGeometry();
                geographyPipeline6.EndGeometry();
                data[i].gColl = (GeometryCollection)spatialBuilder6.ConstructedGeometry;
            }
        }