コード例 #1
0
 public override void SendTo(GeographyPipeline pipeline)
 {
     base.SendTo(pipeline);
     pipeline.BeginGeography(SpatialType.LineString);
     this.SendFigure(pipeline);
     pipeline.EndGeography();
 }
コード例 #2
0
        public override void SendTo(GeographyPipeline pipeline)
        {
            base.SendTo(pipeline);
            pipeline.BeginGeography(SpatialType.MultiPolygon);
            for (int i = 0; i < this.polygons.Length; ++i)
            {
                this.polygons[i].SendTo(pipeline);
            }

            pipeline.EndGeography();
        }
コード例 #3
0
        public override void SendTo(GeographyPipeline pipeline)
        {
            base.SendTo(pipeline);
            pipeline.BeginGeography(SpatialType.Collection);
            for (int i = 0; i < this.geographyArray.Length; ++i)
            {
                this.geographyArray[i].SendTo(pipeline);
            }

            pipeline.EndGeography();
        }
コード例 #4
0
        /// <summary>
        /// Sends the current spatial object to the given pipeline with a figure that represents this LineString
        /// </summary>
        /// <param name="lineString">GeographyLineString instance to serialize.</param>
        /// <param name="pipeline">The pipeline to populate to</param>
        internal static void SendFigure(this GeographyLineString lineString, GeographyPipeline pipeline)
        {
            ReadOnlyCollection<GeographyPoint> points = lineString.Points;
            for (int i = 0; i < points.Count; ++i)
            {
                if (i == 0)
                {
                    pipeline.BeginFigure(new GeographyPosition(points[i].Latitude, points[i].Longitude, points[i].Z, points[i].M));
                }
                else
                {
                    pipeline.LineTo(new GeographyPosition(points[i].Latitude, points[i].Longitude, points[i].Z, points[i].M));
                }
            }

            if (points.Count > 0)
            {
                pipeline.EndFigure();
            }
        }
コード例 #5
0
ファイル: SpatialPipeline.cs プロジェクト: larsenjo/odata.net
 /// <summary> Initializes a new instance of the <see cref="T:Microsoft.Spatial.SpatialPipeline" /> class. </summary>
 /// <param name="geographyPipeline">The geography chain.</param>
 /// <param name="geometryPipeline">The geometry chain.</param>
 public SpatialPipeline(GeographyPipeline geographyPipeline, GeometryPipeline geometryPipeline)
 {
     this.geographyPipeline = geographyPipeline;
     this.geometryPipeline = geometryPipeline;
     this.startingLink = this;
 }
コード例 #6
0
 public GeometryToGeographyPipeline(GeographyPipeline destination, Func<GeometryPosition, GeographyPosition> convertPosition)
 {
     ExceptionUtilities.CheckArgumentNotNull(destination, "destination");
     ExceptionUtilities.CheckArgumentNotNull(convertPosition, "convertPosition");
     this.Destination = destination;
     this.ConvertPosition = convertPosition;
 }
コード例 #7
0
 /// <summary>
 /// Creates the conversion chain.
 /// </summary>
 /// <param name="destination">The destination.</param>
 /// <param name="convertPosition">The delegate to use for converting positions.</param>
 /// <returns>The conversion chain</returns>
 internal static GeometryPipeline CreateConversionChain(GeographyPipeline destination, Func<GeometryPosition, GeographyPosition> convertPosition)
 {
     return new GeometryToGeographyPipeline(destination, convertPosition);
 }
コード例 #8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="output">The pipeline to redirect the calls to</param>
 public TypeWashedToGeographyLatLongPipeline(SpatialPipeline output)
 {
     this.output = output;
 }
コード例 #9
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))
 {
 }
コード例 #10
0
ファイル: PositionData.cs プロジェクト: rossjempson/odata.net
 public static void DrawPoint(GeographyPipeline pipeline, PositionData point)
 {
     pipeline.BeginFigure(new GeographyPosition(point.X, point.Y, point.Z, point.M));
     pipeline.EndFigure();
 }
コード例 #11
0
 /// <summary>Initializes a new instance of the <see cref="Microsoft.Spatial.SpatialBuilder" /> class.</summary>
 /// <param name="geographyInput">The geography input.</param>
 /// <param name="geometryInput">The geometry input.</param>
 /// <param name="geographyOutput">The geography output.</param>
 /// <param name="geometryOutput">The geometry output.</param>
 public SpatialBuilder(GeographyPipeline geographyInput, GeometryPipeline geometryInput, IGeographyProvider geographyOutput, IGeometryProvider geometryOutput)
     : base(geographyInput, geometryInput)
 {
     this.geographyOutput = geographyOutput;
     this.geometryOutput  = geometryOutput;
 }
コード例 #12
0
        public override void SendTo(GeographyPipeline pipeline)
        {
            base.SendTo(pipeline);
            pipeline.BeginGeography(SpatialType.Point);
            if (!this.IsEmpty)
            {
                pipeline.BeginFigure(new GeographyPosition(this.latitude, this.longitude, this.z, this.m));
                pipeline.EndFigure();
            }

            pipeline.EndGeography();
        }
コード例 #13
0
 /// <summary>Sends the current spatial object to the given pipeline.</summary>
 /// <param name="chain">The spatial pipeline.</param>
 public virtual void SendTo(GeographyPipeline chain)
 {
     Util.CheckArgumentNull(chain, "chain");
     chain.SetCoordinateSystem(this.coordinateSystem);
 }
コード例 #14
0
 /// <summary>
 /// Creates a new instance of the GeographyLoggingPipeline.
 /// </summary>
 /// <param name="reverseCoordinates">
 /// True if calls to BeginFigure and AddLine should reverse the first two coordinates before logging the call.
 /// </param>
 public GeographyLoggingPipeline(bool reverseCoordinates)
 {
     this.reverseCoordinates = reverseCoordinates;
     this.pipeline = new CallSequenceLoggingPipeline();
     this.drawGeography = pipeline;
 }
コード例 #15
0
ファイル: SpatialBuilder.cs プロジェクト: AlineGuan/odata.net
 /// <summary>Initializes a new instance of the <see cref="T:Microsoft.Spatial.SpatialBuilder" /> class.</summary>
 /// <param name="geographyInput">The geography input.</param>
 /// <param name="geometryInput">The geometry input.</param>
 /// <param name="geographyOutput">The geography output.</param>
 /// <param name="geometryOutput">The geometry output.</param>
 public SpatialBuilder(GeographyPipeline geographyInput, GeometryPipeline geometryInput, IGeographyProvider geographyOutput, IGeometryProvider geometryOutput)
     : base(geographyInput, geometryInput)
 {
     this.geographyOutput = geographyOutput;
     this.geometryOutput = geometryOutput;
 }
コード例 #16
0
 /// <summary> Initializes a new instance of the <see cref="Microsoft.Spatial.SpatialPipeline" /> class. </summary>
 /// <param name="geographyPipeline">The geography chain.</param>
 /// <param name="geometryPipeline">The geometry chain.</param>
 public SpatialPipeline(GeographyPipeline geographyPipeline, GeometryPipeline geometryPipeline)
 {
     this.geographyPipeline = geographyPipeline;
     this.geometryPipeline  = geometryPipeline;
     this.startingLink      = this;
 }
コード例 #17
0
 public override void SendTo(GeographyPipeline pipeline)
 {
     base.SendTo(pipeline);
     pipeline.BeginGeography(SpatialType.FullGlobe);
     pipeline.EndGeography();
 }
コード例 #18
0
ファイル: PositionData.cs プロジェクト: rossjempson/odata.net
        public static void DrawLine(GeographyPipeline pipeline, PositionData[] line)
        {
            for (int i = 0; i < line.Length; ++i)
            {
                if (i == 0)
                {
                    pipeline.BeginFigure(new GeographyPosition(line[i].X, line[i].Y, line[i].Z, line[i].M));
                }
                else
                {
                    pipeline.LineTo(new GeographyPosition(line[i].X, line[i].Y, line[i].Z, line[i].M));
                }
            }

            pipeline.EndFigure();
        }