/// <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; }
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))); }
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; }
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; }
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); }
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; }
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; }
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; }
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); }
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; }
protected override CoordinateSystem OnSetCoordinateSystem(CoordinateSystem coordinateSystem) { this.WriteCoordinateSystem(coordinateSystem); return coordinateSystem; }
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; } }
/// <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) { }
protected override CoordinateSystem OnSetCoordinateSystem(CoordinateSystem coordinateSystem) { this.currentCoordinateSystem = coordinateSystem; return coordinateSystem; }
protected GeometryMultiPoint(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator) { }
/// <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; }
private static void AddRef(CoordinateSystem coords) { References.Add(KeyFor(coords.EpsgId.Value, coords.topology), coords); }
protected GeometryCurve(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator) { }
protected GeometryMultiLineString(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator) { }
internal GeometryCollectionImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, params Geometry[] geometry) : base(coordinateSystem, creator) { this.geometryArray = geometry ?? new Geometry[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) { }
/// <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]; }
/// <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; }
protected GeographyCollection(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator) { }
/// <summary> /// Set the coordinate system /// </summary> /// <param name="coordinateSystem">The CoordinateSystem</param> public override void SetCoordinateSystem(CoordinateSystem coordinateSystem) { both.OnSetCoordinateSystem(coordinateSystem); }
/// <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]; }
/// <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) { }
/// <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; } }
internal GeographyFullGlobeImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator) : base(coordinateSystem, creator) { }
public abstract void SetCoordinateSystem(CoordinateSystem coordinateSystem);
/// <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) { }
internal GeometryLineStringImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, params GeometryPoint[] points) : base(coordinateSystem, creator) { this.points = points ?? new GeometryPoint[0]; }
internal GeometryMultiLineStringImplementation(CoordinateSystem coordinateSystem, SpatialImplementation creator, params GeometryLineString[] lineStrings) : base(coordinateSystem, creator) { this.lineStrings = lineStrings ?? new GeometryLineString[0]; }
protected override void OnReset() { this.parentStack = new Stack<SpatialType>(); this.coordinateSystemWritten = false; this.currentCoordinateSystem = null; this.figureWritten = false; this.shouldWriteContainerWrapper = false; }