private void AssertPipelineIsForwardingSegment(SpatialPipeline pipeline)
 {
     Assert.True(pipeline.GeographyPipeline != null, "The GeographyPipeline should not be null");
     Assert.True(pipeline.GeometryPipeline != null, "The GeometryPipeline should not be null");
     Assert.True(typeof(ForwardingSegment.GeographyForwarder) == pipeline.GeographyPipeline.GetType(), "All pipelines that we create must be wrapped in forwarding segments for exception/reset behavior to work");
     Assert.True(typeof(ForwardingSegment.GeometryForwarder) == pipeline.GeometryPipeline.GetType(), "All pipelines that we create must be wrapped in forwarding segments for exception/reset behavior to work");
 }
        /// <summary>
        /// Allows the delegation of the call to the proper type (geography or Geometry)
        /// </summary>
        /// <param name="shape">The instance that will have SendTo called.</param>
        /// <param name="destination">The pipeline that the instance will be sent to.</param>
        public static void SendTo(this ISpatial shape, SpatialPipeline destination)
        {
            if (shape == null)
            {
                return;
            }

            if (shape.GetType().IsSubclassOf(typeof(Geometry)))
            {
                ((Geometry)shape).SendTo(destination);
            }
            else
            {
                ((Geography)shape).SendTo(destination);
            }
        }
Пример #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="output">The pipeline to redirect the calls to</param>
 public TypeWashedToGeographyLongLatPipeline(SpatialPipeline output)
 {
     this.output = output;
 }
Пример #4
0
 public TrivialReader(SpatialPipeline destination) : base(destination)
 {
 }
Пример #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="output">The pipeline to redirect the calls to</param>
 public TypeWashedToGeometryPipeline(SpatialPipeline output)
 {
     this.output = output;
 }
 /// <summary>
 /// Reads the geometry.
 /// </summary>
 /// <param name="readerStream">The reader stream.</param>
 /// <param name="pipeline">The pipeline.</param>
 protected override void ReadGeometry(TextReader readerStream, SpatialPipeline pipeline)
 {
     new WellKnownTextSqlReader(pipeline, allowOnlyTwoDimensions).ReadGeometry(readerStream);
 }
Пример #7
0
 public WellKnownTextSqlReader(SpatialPipeline destination, bool allowOnlyTwoDimensions) : base(destination)
 {
     this.allowOnlyTwoDimensions = allowOnlyTwoDimensions;
 }
Пример #8
0
 public WellKnownTextSqlReader(SpatialPipeline destination) : this(destination, false)
 {
 }
 private static void SendToPipeline(IDictionary<string, object> members, SpatialPipeline pipeline, bool isGeography)
 {
     GeoJsonObjectReader reader = new GeoJsonObjectReader(pipeline);
     if (isGeography)
     {
         reader.ReadGeography(members);
     }
     else
     {
         reader.ReadGeometry(members);
     }
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeoJsonObjectReader"/> class.
 /// </summary>
 /// <param name="destination">The pipeline.</param>
 internal GeoJsonObjectReader(SpatialPipeline destination)
     : base(destination)
 {
 }
 public TypeWashedToGeographyLatLongPipeline(SpatialPipeline output)
 {
     this.output = (GeographyPipeline)output;
 }
Пример #12
0
 /// <summary>
 /// Reads the geometry.
 /// </summary>
 /// <param name="readerStream">The reader stream.</param>
 /// <param name="pipeline">The pipeline.</param>
 protected override void ReadGeometry(XmlReader readerStream, SpatialPipeline pipeline)
 {
     new GmlReader(pipeline).ReadGeometry(readerStream);
 }
Пример #13
0
 /// <summary>
 /// Constructs a new SpatialPipeline segment
 /// </summary>
 /// <param name="current">The DrawSpatial to draw to before calling next.</param>
 public ForwardingSegment(SpatialPipeline current)
 {
     Debug.Assert(current.GeographyPipeline == null || !(current.GeographyPipeline is GeographyForwarder), "the current should not already be wrapped.");
     Debug.Assert(current.GeometryPipeline == null || !(current.GeometryPipeline is GeometryForwarder), "the current should not already be wrapped.");
     this.current = current;
 }
Пример #14
0
 public ForwardingSegment(SpatialPipeline current)
 {
     this.next    = SpatialPipelineNoOp;
     this.current = current;
 }