From: <rs...@us...> - 2011-12-29 03:07:47
|
Revision: 1694 http://nhcontrib.svn.sourceforge.net/nhcontrib/?rev=1694&view=rev Author: rstuven Date: 2011-12-29 03:07:41 +0000 (Thu, 29 Dec 2011) Log Message: ----------- Added dimension support provided by Gerrit Hoven (NHSP-15) Modified Paths: -------------- trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Dialect/ISpatialDialect.cs trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Mapping/SpatialAuxiliaryDatabaseObject.cs trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/GeometryType.cs trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/GeometryTypeBase.cs trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/IGeometryUserType.cs Modified: trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Dialect/ISpatialDialect.cs =================================================================== --- trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Dialect/ISpatialDialect.cs 2011-12-29 01:25:04 UTC (rev 1693) +++ trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Dialect/ISpatialDialect.cs 2011-12-29 03:07:41 UTC (rev 1694) @@ -114,16 +114,17 @@ /// <returns></returns> string GetSpatialCreateString(string schema); - /// <summary> - /// Gets the spatial create string. - /// </summary> - /// <param name="schema">The schema.</param> - /// <param name="table">The table.</param> - /// <param name="column">The column.</param> - /// <param name="srid">The srid.</param> - /// <param name="subtype">The subtype.</param> - /// <returns></returns> - string GetSpatialCreateString(string schema, string table, string column, int srid, string subtype); + /// <summary> + /// Gets the spatial create string. + /// </summary> + /// <param name="schema">The schema.</param> + /// <param name="table">The table.</param> + /// <param name="column">The column.</param> + /// <param name="srid">The srid.</param> + /// <param name="subtype">The subtype.</param> + /// <param name="dimension">[3DIS] The dimension</param> + /// <returns></returns> + string GetSpatialCreateString(string schema, string table, string column, int srid, string subtype, int dimension); /// <summary> /// Gets the spatial drop string. Modified: trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Mapping/SpatialAuxiliaryDatabaseObject.cs =================================================================== --- trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Mapping/SpatialAuxiliaryDatabaseObject.cs 2011-12-29 01:25:04 UTC (rev 1693) +++ trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Mapping/SpatialAuxiliaryDatabaseObject.cs 2011-12-29 03:07:41 UTC (rev 1694) @@ -149,8 +149,9 @@ IGeometryUserType geometryType = (IGeometryUserType)((CustomType)column.Value.Type).UserType; int srid = geometryType.SRID; string subtype = geometryType.Subtype; + int dimension = geometryType.Dimension; - builder.Append(spatialDialect.GetSpatialCreateString(defaultSchema, table.Name, column.Name, srid, subtype)); + builder.Append(spatialDialect.GetSpatialCreateString(defaultSchema, table.Name, column.Name, srid, subtype, dimension)); }); return builder.ToString(); Modified: trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/GeometryType.cs =================================================================== --- trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/GeometryType.cs 2011-12-29 01:25:04 UTC (rev 1693) +++ trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/GeometryType.cs 2011-12-29 03:07:41 UTC (rev 1694) @@ -209,6 +209,14 @@ get { return this.geometryUserType.Subtype; } } + /// <summary> + /// [3DIS] Gets the Dimension [2,3] + /// </summary> + public int Dimension + { + get { return this.geometryUserType.Dimension; } + } + /// <summary> /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. /// </summary> Modified: trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/GeometryTypeBase.cs =================================================================== --- trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/GeometryTypeBase.cs 2011-12-29 01:25:04 UTC (rev 1693) +++ trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/GeometryTypeBase.cs 2011-12-29 03:07:41 UTC (rev 1694) @@ -49,6 +49,7 @@ private int srid = -1; private string subtype = "GEOMETRY"; + private int dimension = 2; private readonly NullableType nullableType; private readonly SqlType sqlType; @@ -264,6 +265,13 @@ { this.subtype = parameterSubtype; } + //[3DIS] + string strDimension; + parameters.TryGetValue("dimension", out strDimension); + if (!string.IsNullOrEmpty(strDimension)) + { + Int32.TryParse(strDimension, out this.dimension); + } } } @@ -285,6 +293,14 @@ get { return this.subtype; } } + /// <summary> + /// [3DIS] Gets the Dimension [2,3] + /// </summary> + public int Dimension + { + get { return this.dimension; } + } + /// <summary> /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. /// </summary> Modified: trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/IGeometryUserType.cs =================================================================== --- trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/IGeometryUserType.cs 2011-12-29 01:25:04 UTC (rev 1693) +++ trunk/src/NHibernate.Spatial/src/NHibernate.Spatial/Type/IGeometryUserType.cs 2011-12-29 03:07:41 UTC (rev 1694) @@ -33,5 +33,10 @@ /// Gets the OGC geometry subtype name /// </summary> string Subtype { get; } + + /// <summary> + /// [3DIS] Gets the Dimension [2,3] + /// </summary> + int Dimension { get; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |