コード例 #1
0
ファイル: Geometry.cs プロジェクト: smasonuk/odata-sparql
 /// <summary>
 /// Geometry Constructor
 /// </summary>
 /// <param name="coordinateSystem">The CoordinateSystem</param>
 /// <param name="creator">The implementation that created this instance.</param>
 protected Geometry(CoordinateSystem coordinateSystem, SpatialImplementation creator)
 {
     Util.CheckArgumentNull(coordinateSystem, "coordinateSystem");
     Util.CheckArgumentNull(creator, "creator");
     this.coordinateSystem = coordinateSystem;
     this.creator = creator;
 }
コード例 #2
0
ファイル: CoordinateSystem.cs プロジェクト: nickchal/pash
 public bool Equals(CoordinateSystem other)
 {
     if (object.ReferenceEquals(null, other))
     {
         return false;
     }
     return (object.ReferenceEquals(this, other) || (object.Equals(other.topology, this.topology) && other.EpsgId.Equals(this.EpsgId)));
 }
コード例 #3
0
ファイル: GeographyPoint.cs プロジェクト: nickchal/pash
 public static GeographyPoint Create(CoordinateSystem coordinateSystem, double latitude, double longitude, double? z, double? m)
 {
     SpatialBuilder builder = SpatialBuilder.Create();
     GeographyPipeline geographyPipeline = builder.GeographyPipeline;
     geographyPipeline.SetCoordinateSystem(coordinateSystem);
     geographyPipeline.BeginGeography(SpatialType.Point);
     geographyPipeline.BeginFigure(new GeographyPosition(latitude, longitude, z, m));
     geographyPipeline.EndFigure();
     geographyPipeline.EndGeography();
     return (GeographyPoint) builder.ConstructedGeography;
 }
コード例 #4
0
ファイル: GeometryPoint.cs プロジェクト: nickchal/pash
 public static GeometryPoint Create(CoordinateSystem coordinateSystem, double x, double y, double? z, double? m)
 {
     SpatialBuilder builder = SpatialBuilder.Create();
     GeometryPipeline geometryPipeline = builder.GeometryPipeline;
     geometryPipeline.SetCoordinateSystem(coordinateSystem);
     geometryPipeline.BeginGeometry(SpatialType.Point);
     geometryPipeline.BeginFigure(new GeometryPosition(x, y, z, m));
     geometryPipeline.EndFigure();
     geometryPipeline.EndGeometry();
     return (GeometryPoint) builder.ConstructedGeometry;
 }
コード例 #5
0
 private void InitializeObject()
 {
     this.depth = 0;
     this.initialFirstCoordinate     = 0.0;
     this.initialSecondCoordinate    = 0.0;
     this.mostRecentFirstCoordinate  = 0.0;
     this.mostRecentSecondCoordinate = 0.0;
     this.pointCount = 0;
     this.validationCoordinateSystem = null;
     this.ringCount = 0;
     this.stack.Clear();
     this.stack.Push(CoordinateSystem);
 }
コード例 #6
0
ファイル: CoordinateSystem.cs プロジェクト: nickchal/pash
 private static CoordinateSystem GetOrCreate(int epsgId, Topology topology)
 {
     CoordinateSystem system;
     lock (referencesLock)
     {
         if (References.TryGetValue(KeyFor(epsgId, topology), out system))
         {
             return system;
         }
         system = new CoordinateSystem(epsgId, "ID " + epsgId, topology);
         AddRef(system);
     }
     return system;
 }
コード例 #7
0
 internal GeometryPointImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, double x, double y, double? z, double? m) : base(coordinateSystem, creator)
 {
     if (double.IsNaN(x) || double.IsInfinity(x))
     {
         throw new ArgumentException(Strings.InvalidPointCoordinate(x, "x"));
     }
     if (double.IsNaN(y) || double.IsInfinity(y))
     {
         throw new ArgumentException(Strings.InvalidPointCoordinate(y, "y"));
     }
     this.x = x;
     this.y = y;
     this.z = z;
     this.m = m;
 }
コード例 #8
0
 internal GeographyPointImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, double latitude, double longitude, double? zvalue, double? mvalue) : base(coordinateSystem, creator)
 {
     if (double.IsNaN(latitude) || double.IsInfinity(latitude))
     {
         throw new ArgumentException(Strings.InvalidPointCoordinate(latitude, "latitude"));
     }
     if (double.IsNaN(longitude) || double.IsInfinity(longitude))
     {
         throw new ArgumentException(Strings.InvalidPointCoordinate(longitude, "longitude"));
     }
     this.latitude = latitude;
     this.longitude = longitude;
     this.z = zvalue;
     this.m = mvalue;
 }
コード例 #9
0
            protected override System.Spatial.CoordinateSystem OnSetCoordinateSystem(System.Spatial.CoordinateSystem coordinateSystem)
            {
                ValidatorState state = this.stack.Peek();

                this.Execute(PipelineCall.SetCoordinateSystem);
                if (state == CoordinateSystem)
                {
                    this.validationCoordinateSystem = coordinateSystem;
                    return(coordinateSystem);
                }
                if (this.validationCoordinateSystem != coordinateSystem)
                {
                    throw new FormatException(Strings.Validator_SridMismatch);
                }
                return(coordinateSystem);
            }
コード例 #10
0
ファイル: GeoJsonWriterBase.cs プロジェクト: nickchal/pash
 private void BeginShape(SpatialType type, CoordinateSystem defaultCoordinateSystem)
 {
     if (this.currentCoordinateSystem == null)
     {
         this.currentCoordinateSystem = defaultCoordinateSystem;
     }
     if (this.ShapeHasObjectScope)
     {
         this.WriteShapeHeader(type);
     }
     if (TypeHasArrayScope(type))
     {
         this.StartArrayScope();
     }
     this.stack.Push(type);
     this.figureDrawn = false;
 }
コード例 #11
0
 protected override CoordinateSystem OnSetCoordinateSystem(CoordinateSystem coordinateSystem)
 {
     this.WriteCoordinateSystem(coordinateSystem);
     return coordinateSystem;
 }
コード例 #12
0
 private void WriteCoordinateSystem(CoordinateSystem coordinateSystem)
 {
     if (!this.coordinateSystemWritten)
     {
         this.writer.Write("SRID");
         this.writer.Write("=");
         this.writer.Write(coordinateSystem.Id);
         this.writer.Write(";");
         this.coordinateSystemWritten = true;
     }
 }
コード例 #13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coordinateSystem">The CoordinateSystem</param>
 /// <param name="creator">The implementation that created this instance.</param>
 protected GeographyMultiCurve(CoordinateSystem coordinateSystem, SpatialImplementation creator)
     : base(coordinateSystem, creator)
 {
 }
コード例 #14
0
ファイル: GmlWriter.cs プロジェクト: nickchal/pash
 protected override CoordinateSystem OnSetCoordinateSystem(CoordinateSystem coordinateSystem)
 {
     this.currentCoordinateSystem = coordinateSystem;
     return coordinateSystem;
 }
コード例 #15
0
ファイル: GeometryMultiPoint.cs プロジェクト: nickchal/pash
 protected GeometryMultiPoint(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator)
 {
 }
コード例 #16
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coordinateSystem">The CoordinateSystem</param>
 /// <param name="creator">The implementation that created this instance.</param>
 /// <param name="polygons">Polygons</param>
 internal GeometryMultiPolygonImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, params GeometryPolygon[] polygons)
     : base(coordinateSystem, creator)
 {
     this.polygons = polygons;
 }
コード例 #17
0
 private static void AddRef(CoordinateSystem coords)
 {
     References.Add(KeyFor(coords.EpsgId.Value, coords.topology), coords);
 }
コード例 #18
0
ファイル: GeometryCurve.cs プロジェクト: nickchal/pash
 protected GeometryCurve(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator)
 {
 }
コード例 #19
0
 protected GeometryMultiLineString(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator)
 {
 }
コード例 #20
0
 internal GeometryCollectionImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, params Geometry[] geometry) : base(coordinateSystem, creator)
 {
     this.geometryArray = geometry ?? new Geometry[0];
 }
コード例 #21
0
 /// <summary>
 /// Create a empty point
 /// </summary>
 /// <param name="coordinateSystem">CoordinateSystem</param>
 /// <param name="creator">The implementation that created this instance.</param>
 protected GeographyPoint(CoordinateSystem coordinateSystem, SpatialImplementation creator)
     : base(coordinateSystem, creator)
 {
 }
コード例 #22
0
ファイル: CoordinateSystem.cs プロジェクト: nickchal/pash
 private static void AddRef(CoordinateSystem coords)
 {
     References.Add(KeyFor(coords.EpsgId.Value, coords.topology), coords);
 }
コード例 #23
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coordinateSystem">The CoordinateSystem</param>
 /// <param name="creator">The implementation that created this instance.</param>
 /// <param name="points">Points</param>
 internal GeographyMultiPointImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, params GeographyPoint[] points)
     : base(coordinateSystem, creator)
 {
     this.points = points ?? new GeographyPoint[0];
 }
コード例 #24
0
ファイル: DrawBoth.cs プロジェクト: smasonuk/odata-sparql
 /// <summary>
 /// Set the coordinate system
 /// </summary>
 /// <param name="coordinateSystem">The CoordinateSystem</param>
 /// <returns>the coordinate system to be passed down the pipeline</returns>
 protected virtual CoordinateSystem OnSetCoordinateSystem(CoordinateSystem coordinateSystem)
 {
     return coordinateSystem;
 }
コード例 #25
0
 protected GeographyCollection(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator)
 {
 }
コード例 #26
0
ファイル: DrawBoth.cs プロジェクト: smasonuk/odata-sparql
 /// <summary>
 /// Set the coordinate system
 /// </summary>
 /// <param name="coordinateSystem">The CoordinateSystem</param>
 public override void SetCoordinateSystem(CoordinateSystem coordinateSystem)
 {
     both.OnSetCoordinateSystem(coordinateSystem);
 }
コード例 #27
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coordinateSystem">The CoordinateSystem</param>
 /// <param name="creator">The implementation that created this instance.</param>
 /// <param name="rings">The rings of this polygon</param>
 internal GeographyPolygonImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, params GeographyLineString[] rings)
     : base(coordinateSystem, creator)
 {
     this.rings = rings ?? new GeographyLineString[0];
 }
コード例 #28
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coordinateSystem">CoordinateSystem</param>
 /// <param name="creator">The implementation that created this instance.</param>
 protected GeographyLineString(CoordinateSystem coordinateSystem, SpatialImplementation creator)
     : base(coordinateSystem, creator)
 {
 }
コード例 #29
0
        /// <summary>
        /// Write the coordinate system
        /// </summary>
        /// <param name="coordinateSystem">The CoordinateSystem</param>
        private void WriteCoordinateSystem(CoordinateSystem coordinateSystem)
        {
            if (!this.coordinateSystemWritten)
            {
                // SRID can only be set once in WKT, but can be set once per BeginGeo in collection types
                this.writer.Write(WellKnownTextConstants.WktSrid);
                this.writer.Write(WellKnownTextConstants.WktEquals);
                this.writer.Write(coordinateSystem.Id);
                this.writer.Write(WellKnownTextConstants.WktSemiColon);

                this.coordinateSystemWritten = true;
            }
        }
コード例 #30
0
 internal GeographyFullGlobeImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator)
 {
 }
コード例 #31
0
ファイル: GeometryPipeline.cs プロジェクト: nickchal/pash
 public abstract void SetCoordinateSystem(CoordinateSystem coordinateSystem);
コード例 #32
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coordinateSystem">The CoordinateSystem</param>
 /// <param name="creator">The implementation that created this instance.</param>
 internal GeometrySurface(CoordinateSystem coordinateSystem, SpatialImplementation creator)
     : base(coordinateSystem, creator)
 {
 }
コード例 #33
0
 internal GeometryLineStringImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, params GeometryPoint[] points) : base(coordinateSystem, creator)
 {
     this.points = points ?? new GeometryPoint[0];
 }
コード例 #34
0
 internal GeometryMultiLineStringImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, params GeometryLineString[] lineStrings) : base(coordinateSystem, creator)
 {
     this.lineStrings = lineStrings ?? new GeometryLineString[0];
 }
コード例 #35
0
ファイル: GmlWriter.cs プロジェクト: nickchal/pash
 protected override void OnReset()
 {
     this.parentStack = new Stack<SpatialType>();
     this.coordinateSystemWritten = false;
     this.currentCoordinateSystem = null;
     this.figureWritten = false;
     this.shouldWriteContainerWrapper = false;
 }