diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..7bcae2b --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,10 @@ + + + + + $(MSBuildThisFileDirectory) + + $(MSBuildThisFileDirectory)nts.snk + + + diff --git a/NetTopologySuite.Common.props b/NetTopologySuite.Common.props deleted file mode 100644 index c14aafa..0000000 --- a/NetTopologySuite.Common.props +++ /dev/null @@ -1,85 +0,0 @@ - - - - $(SolutionDir)$(Configuration)\$(Platform) - $(OutputPath)\$(TargetFramework)\$(AssemblyName).xml - false - 1.7.5 - - - - - .NETFramework - Client - v3.5 - - - - .NETFramework - Client - v4.0 - - - - .NETFramework - Client - v4.0.3 - - - - true - - - full - - - $(DefineConstants);COMPAT_SHAPEFILE_IMPORT_TO_SQL_SERVER - - $(DefineConstants);FEATURE_FILE_IO - $(DefineConstants);HAS_SYSTEM_APPLICATIONEXCEPTION - $(DefineConstants);HAS_SYSTEM_ICLONEABLE - $(DefineConstants);HAS_SYSTEM_IO_MEMORYSTREAM_CTOR_PUBLICLYVISIBLE - $(DefineConstants);HAS_SYSTEM_RUNTIME_INTEROPSERVICES_COMVISIBLEATTRIBUTE - $(DefineConstants);HAS_SYSTEM_RUNTIME_INTEROPSERVICES_GUIDATTRIBUTE - $(DefineConstants);HAS_SYSTEM_SERIALIZABLEATTRIBUTE - $(DefineConstants);HAS_SYSTEM_TEXT_ENCODING_DEFAULT - $(DefineConstants);HAS_SYSTEM_TEXT_ENCODING_ASCII - $(DefineConstants);HAS_SYSTEM_TYPE_ISASSIGNABLEFROM - $(DefineConstants);HAS_SYSTEM_XML_XMLDOCUMENT - $(DefineConstants);SERIALIZATION_COMPAT_NETTOPOLOGYSUITE_FEATURE_ATTRIBUTESTABLE - - - - $(DefineConstants);HAS_SYSTEM_XML_NAMESPACEHANDLING - $(DefineConstants);HAS_SYSTEM_STRING_ISNULLORWHITESPACE - - - - $(DefineConstants);HAS_SYSTEM_REFLECTION_TYPEINFO - - - - true - - - - $(DefineConstants);HAS_SYSTEM_XML_NAMESPACEHANDLING - $(DefineConstants);HAS_SYSTEM_REFLECTION_TYPEINFO - $(DefineConstants);HAS_SYSTEM_STRING_ISNULLORWHITESPACE - - - - $(DefineConstants);FEATURE_FILE_IO - $(DefineConstants);HAS_SYSTEM_IO_MEMORYSTREAM_CTOR_PUBLICLYVISIBLE - $(DefineConstants);HAS_SYSTEM_TEXT_ENCODING_ASCII - $(DefineConstants);HAS_SYSTEM_XML_XMLDOCUMENT - - - - $(DefineConstants);HAS_SYSTEM_APPLICATIONEXCEPTION - $(DefineConstants);HAS_SYSTEM_ICLONEABLE - $(DefineConstants);HAS_SYSTEM_SERIALIZABLEATTRIBUTE - $(DefineConstants);HAS_SYSTEM_TEXT_ENCODING_DEFAULT - $(DefineConstants);HAS_SYSTEM_TYPE_ISASSIGNABLEFROM - - diff --git a/NetTopologySuite.IO.Oracle.Test/NetTopologySuite.IO.Oracle.Test.csproj b/NetTopologySuite.IO.Oracle.Test/NetTopologySuite.IO.Oracle.Test.csproj deleted file mode 100644 index dc37f75..0000000 --- a/NetTopologySuite.IO.Oracle.Test/NetTopologySuite.IO.Oracle.Test.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - $(ProjectDir)..\ - net45 - x86 - false - true - - - - - - - - - - - - - - - diff --git a/NetTopologySuite.IO.Oracle.Test/Properties/AssemblyInfo.cs b/NetTopologySuite.IO.Oracle.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index fca654e..0000000 --- a/NetTopologySuite.IO.Oracle.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NetTopologySuite.IO.Oracle.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NetTopologySuite.IO.Oracle.Test")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("58cebbbb-3e65-4dec-a344-9d4e32e518dd")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NetTopologySuite.IO.Oracle.nuspec b/NetTopologySuite.IO.Oracle.nuspec deleted file mode 100644 index cb613a2..0000000 --- a/NetTopologySuite.IO.Oracle.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - NetTopologySuite.IO.Oracle - $version$ - NetTopologySuite IO Library for Oracle - NetTopologySuite - Team,Holger Laebe - BSD-3-Clause - https://github.com/NetTopologySuite/NetTopologySuite.IO.Oracle - false - This package contains the Oracle IO library with experimental writer implementation - Oracle IO library for NetTopologySuite - NTS Oracle - en-US - - - - - - - - - - - - - - diff --git a/NetTopologySuite.IO.Oracle.sln b/NetTopologySuite.IO.Oracle.sln index e461aa4..5c9b8a1 100644 --- a/NetTopologySuite.IO.Oracle.sln +++ b/NetTopologySuite.IO.Oracle.sln @@ -1,20 +1,18 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27004.2008 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29215.179 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B0923F22-AF00-46DA-B5CE-73F4D398DE37}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore - NetTopologySuite.Common.props = NetTopologySuite.Common.props NetTopologySuite.IO.Oracle.nuspec = NetTopologySuite.IO.Oracle.nuspec README.md = README.md - SharedAssemblyVersion.cs = SharedAssemblyVersion.cs EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetTopologySuite.IO.Oracle", "NetTopologySuite.IO.Oracle\NetTopologySuite.IO.Oracle.csproj", "{8B9632C4-9854-497E-A077-A1B7F358E284}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetTopologySuite.IO.Oracle", "src\NetTopologySuite.IO.Oracle\NetTopologySuite.IO.Oracle.csproj", "{8B9632C4-9854-497E-A077-A1B7F358E284}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetTopologySuite.IO.Oracle.Test", "NetTopologySuite.IO.Oracle.Test\NetTopologySuite.IO.Oracle.Test.csproj", "{58CEBBBB-3E65-4DEC-A344-9D4E32E518DD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetTopologySuite.IO.Oracle.Test", "test\NetTopologySuite.IO.Oracle.Test\NetTopologySuite.IO.Oracle.Test.csproj", "{58CEBBBB-3E65-4DEC-A344-9D4E32E518DD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/NetTopologySuite.IO.Oracle/NetTopologySuite.IO.Oracle.csproj b/NetTopologySuite.IO.Oracle/NetTopologySuite.IO.Oracle.csproj deleted file mode 100644 index 4e6bd1d..0000000 --- a/NetTopologySuite.IO.Oracle/NetTopologySuite.IO.Oracle.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - $(ProjectDir)..\ - net45 - x86 - true - $(SolutionDir)nts.snk - false - - - - - - - - - - - - - - - - - - - diff --git a/NetTopologySuite.IO.Oracle/Properties/AssemblyInfo.cs b/NetTopologySuite.IO.Oracle/Properties/AssemblyInfo.cs deleted file mode 100644 index 1fb9ff6..0000000 --- a/NetTopologySuite.IO.Oracle/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("NetTopologySuite.IO.Oracle")] -[assembly: AssemblyDescription("")] -#if DEBUG -[assembly: AssemblyConfiguration("Debug")] -#else -[assembly: AssemblyConfiguration("Stable")] -#endif -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NetTopologySuite.IO.Oracle")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar -// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von -// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. -[assembly: ComVisible(false)] -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("c3604703-c0c2-44a9-9df4-19820def19a5")] diff --git a/NetTopologySuite.IO.Oracle/nts.snk b/NetTopologySuite.IO.Oracle/nts.snk deleted file mode 100644 index 0c30611..0000000 Binary files a/NetTopologySuite.IO.Oracle/nts.snk and /dev/null differ diff --git a/SharedAssemblyVersion.cs b/SharedAssemblyVersion.cs deleted file mode 100644 index d30528f..0000000 --- a/SharedAssemblyVersion.cs +++ /dev/null @@ -1,7 +0,0 @@ -// This is now the main source of versioning information. -// -> Change the version # here. - -using System.Reflection; - -[assembly: AssemblyVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..612ef49 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,98 @@ + + + + + + + true + + + + + true + true + ci.travis.$(TRAVIS_BUILD_NUMBER) + + true + + + + + true + true + ci.teamcity.$(BUILD_NUMBER) + + + + + true + true + ci.appveyor.$(APPVEYOR_BUILD_NUMBER) + + + + + local + + + + + 2 + 0 + 0 + + $([System.DateTime]::UtcNow.Ticks) + $([System.DateTime]::op_Subtraction($([System.DateTime]::new($(NtsBuildTimestamp)).Date),$([System.DateTime]::new(621355968000000000))).TotalDays.ToString("00000")) + + + $([System.DateTime]::new($(NtsBuildTimestamp)).TimeOfDay.TotalMinutes.ToString("0000")) + + $(NtsMajorVersion).$(NtsMinorVersion).$(NtsPatchVersion) + pre.$(NtsDaysSinceEpoch)$(NtsMinutesSinceStartOfUtcDay)+$(NtsBuildMetadata) + + + + + + + $(NtsMajorVersion).0.0.0 + $(NtsMajorVersion).$(NtsMinorVersion).$(NtsPatchVersion).$(NtsBuildNumber) + + NetTopologySuite - Team + + $(Company) + Copyright © $([System.DateTime]::UtcNow.Year) $(CopyrightPeople) + + + + true + true + true + snupkg + + + + + + + + diff --git a/src/NetTopologySuite.IO.Oracle/AssemblyInfo.cs b/src/NetTopologySuite.IO.Oracle/AssemblyInfo.cs new file mode 100644 index 0000000..8e9fa90 --- /dev/null +++ b/src/NetTopologySuite.IO.Oracle/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: ComVisible(false)] +[assembly: Guid("c3604703-c0c2-44a9-9df4-19820def19a5")] diff --git a/src/NetTopologySuite.IO.Oracle/NetTopologySuite.IO.Oracle.csproj b/src/NetTopologySuite.IO.Oracle/NetTopologySuite.IO.Oracle.csproj new file mode 100644 index 0000000..4d4145d --- /dev/null +++ b/src/NetTopologySuite.IO.Oracle/NetTopologySuite.IO.Oracle.csproj @@ -0,0 +1,28 @@ + + + + net472 + x86 + true + + + + NetTopologySuite.IO.Oracle + + + + NetTopologySuite.IO.Oracle + NetTopologySuite IO Library for Oracle + NetTopologySuite - Team;Holger Laebe + NetTopologySuite - Team;Holger Laebe + BSD-3-Clause + https://raw.githubusercontent.com/NetTopologySuite/GeoAPI/master/icon.png + This package contains the Oracle IO library with experimental writer implementation + NTS;Oracle + + + + + + + diff --git a/NetTopologySuite.IO.Oracle/OracleGeometryReader.cs b/src/NetTopologySuite.IO.Oracle/OracleGeometryReader.cs similarity index 91% rename from NetTopologySuite.IO.Oracle/OracleGeometryReader.cs rename to src/NetTopologySuite.IO.Oracle/OracleGeometryReader.cs index 230abea..5b80368 100644 --- a/NetTopologySuite.IO.Oracle/OracleGeometryReader.cs +++ b/src/NetTopologySuite.IO.Oracle/OracleGeometryReader.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using GeoAPI.Geometries; using NetTopologySuite.Geometries; using NetTopologySuite.IO.Sdo; @@ -15,17 +14,17 @@ public OracleGeometryReader() : this(GeometryFactory.Default) { } - public OracleGeometryReader(IGeometryFactory factory) + public OracleGeometryReader(GeometryFactory factory) { _factory = factory; } - private readonly IGeometryFactory _factory; + private readonly GeometryFactory _factory; public int Dimension { get; set; } = -1; - public IGeometry Read(SdoGeometry geom) + public Geometry Read(SdoGeometry geom) { //Note: Returning null for null Datum @@ -46,7 +45,7 @@ public IGeometry Read(SdoGeometry geom) return retVal; } - private IGeometry Create(int gType, SdoPoint point, Decimal[] elemInfo, Decimal[] ordinates) + private Geometry Create(int gType, SdoPoint point, Decimal[] elemInfo, Decimal[] ordinates) { int lrs = (gType % 1000) / 100; @@ -141,8 +140,8 @@ private static List Coordinates(int dim, int lrs, int gtemplate, Dec { var pt = new List(1) { - new Coordinate((Double) ordinates[0], (Double) ordinates[1], - (Double) ordinates[2]) + new CoordinateZ((Double) ordinates[0], (Double) ordinates[1], + (Double) ordinates[2]) }; return pt; } @@ -169,11 +168,11 @@ private static List Coordinates(int dim, int lrs, int gtemplate, Dec switch (len) { case 2: - pts.Add(new Coordinate((Double)ordinates[offset], (Double)ordinates[offset + 1], Double.NaN)); + pts.Add(new CoordinateZ((Double)ordinates[offset], (Double)ordinates[offset + 1], Double.NaN)); break; case 3: - pts.Add(new Coordinate((Double)ordinates[offset], (Double)ordinates[offset + 1], - (Double)ordinates[offset + 2])); + pts.Add(new CoordinateZ((Double)ordinates[offset], (Double)ordinates[offset + 1], + (Double)ordinates[offset + 2])); break; } @@ -193,7 +192,7 @@ private static List Coordinates(int dim, int lrs, int gtemplate, Dec return pts; } - private IGeometryCollection CreateCollection(int dim, int lrs, Decimal[] elemInfo, int elemIndex, + private GeometryCollection CreateCollection(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords, int numGeom) { @@ -207,10 +206,10 @@ private IGeometryCollection CreateCollection(int dim, int lrs, Decimal[] elemInf int endTriplet = (numGeom != -1) ? elemIndex + numGeom : elemInfo.Length / 3 + 1; - var list = new List(); + var list = new List(); SdoEType etype; int interpretation; - IGeometry geom = null; + Geometry geom = null; Boolean cont = true; for (int i = elemIndex; cont && i < endTriplet; i++) @@ -273,7 +272,7 @@ private IGeometryCollection CreateCollection(int dim, int lrs, Decimal[] elemInf return geoms; } - private IMultiPolygon CreateMultiPolygon(int dim, int lrs, decimal[] elemInfo, int elemIndex, + private MultiPolygon CreateMultiPolygon(int dim, int lrs, decimal[] elemInfo, int elemIndex, List coords, int numGeom) { @@ -297,7 +296,7 @@ private IMultiPolygon CreateMultiPolygon(int dim, int lrs, decimal[] elemInfo, i int endTriplet = (numGeom != -1) ? elemIndex + numGeom : (elemInfo.Length / 3) + 1; - var list = new List(); + var list = new List(); Boolean cont = true; for (int i = elemIndex; cont && i < endTriplet && (etype = EType(elemInfo, i)) != SdoEType.Unknown; i++) @@ -320,7 +319,7 @@ private IMultiPolygon CreateMultiPolygon(int dim, int lrs, decimal[] elemInfo, i return polys; } - private IMultiLineString CreateMultiLine(int dim, int lrs, Decimal[] elemInfo, int elemIndex, + private MultiLineString CreateMultiLine(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords, int numGeom) { @@ -343,7 +342,7 @@ private IMultiLineString CreateMultiLine(int dim, int lrs, Decimal[] elemInfo, i int endTriplet = (numGeom != -1) ? (elemIndex + numGeom) : (elemInfo.Length / 3); - var list = new List(); + var list = new List(); Boolean cont = true; for (int i = elemIndex; cont && i < endTriplet && (etype = EType(elemInfo, i)) != SdoEType.Unknown; i++) @@ -364,7 +363,7 @@ private IMultiLineString CreateMultiLine(int dim, int lrs, Decimal[] elemInfo, i return lines; } - private IMultiPoint CreateMultiPoint(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) + private MultiPoint CreateMultiPoint(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) { int sOffset = StartingOffset(elemInfo, elemIndex); SdoEType etype = EType(elemInfo, elemIndex); @@ -390,7 +389,7 @@ private IMultiPoint CreateMultiPoint(int dim, int lrs, Decimal[] elemInfo, int e return points; } - private IPolygon CreatePolygon(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) + private Polygon CreatePolygon(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) { int sOffset = StartingOffset(elemInfo, elemIndex); @@ -415,7 +414,7 @@ private IPolygon CreatePolygon(int dim, int lrs, Decimal[] elemInfo, int elemInd var exteriorRing = CreateLinearRing(dim, lrs, elemInfo, elemIndex, coords); - var rings = new List(); + var rings = new List(); Boolean cont = true; for (int i = elemIndex + 1; cont && (etype = EType(elemInfo, i)) != SdoEType.Unknown; i++) @@ -455,7 +454,7 @@ private IPolygon CreatePolygon(int dim, int lrs, Decimal[] elemInfo, int elemInd } - private ILinearRing CreateLinearRing(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) + private LinearRing CreateLinearRing(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) { int @@ -477,7 +476,7 @@ private ILinearRing CreateLinearRing(int dim, int lrs, Decimal[] elemInfo, int e { return null; } - ILinearRing ring; + LinearRing ring; int len = (dim + lrs); int start = (sOffset - 1) / len; @@ -508,7 +507,7 @@ private ILinearRing CreateLinearRing(int dim, int lrs, Decimal[] elemInfo, int e } - private ILineString CreateLine(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) + private LineString CreateLine(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) { int @@ -545,12 +544,12 @@ private static Coordinate[] ToPointArray(ICollection input) { var pts = new List(input.Count); foreach (Coordinate point in input) - pts.Add(new Coordinate(point.X, point.Y, point.Z)); + pts.Add(new CoordinateZ(point.X, point.Y, point.Z)); return pts.ToArray(); } - private IPoint CreatePoint(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) + private Point CreatePoint(int dim, int lrs, Decimal[] elemInfo, int elemIndex, List coords) { int sOffset = StartingOffset(elemInfo, elemIndex); SdoEType etype = EType(elemInfo, elemIndex); diff --git a/NetTopologySuite.IO.Oracle/OracleGeometryWriter.cs b/src/NetTopologySuite.IO.Oracle/OracleGeometryWriter.cs similarity index 75% rename from NetTopologySuite.IO.Oracle/OracleGeometryWriter.cs rename to src/NetTopologySuite.IO.Oracle/OracleGeometryWriter.cs index 1f0a2ca..8e5ace7 100644 --- a/NetTopologySuite.IO.Oracle/OracleGeometryWriter.cs +++ b/src/NetTopologySuite.IO.Oracle/OracleGeometryWriter.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using GeoAPI.Geometries; +using NetTopologySuite.Geometries; using NetTopologySuite.IO.Sdo; namespace NetTopologySuite.IO @@ -17,23 +17,23 @@ public class OracleGeometryWriter /// public int SRID { get; set; } = SridNull; - private int Dimension(IGeometry geom) + private int Dimension(Geometry geom) { return double.IsNaN(geom.Coordinate.Z) ? 2 : 3; } - private int GType(IGeometry geom) + private int GType(Geometry geom) { return Dimension(geom) * 1000 + (int)Template(geom); } /// - /// Converts an IGeometry to the corresponding Oracle UDT of type SdoGeometry + /// Converts an Geometry to the corresponding Oracle UDT of type SdoGeometry /// it returns null, if conversion fails /// /// /// SdoGeometry - public SdoGeometry Write(IGeometry geometry) + public SdoGeometry Write(Geometry geometry) { if (geometry?.IsEmpty != false) { @@ -42,25 +42,25 @@ public SdoGeometry Write(IGeometry geometry) switch (geometry) { - case IPoint point: + case Point point: return Write(point); - case ILineString line: + case LineString line: return Write(line); - case IPolygon polygon: + case Polygon polygon: return Write(polygon); - case IMultiPoint multiPoint: + case MultiPoint multiPoint: return Write(multiPoint); - case IMultiLineString multiLineString: + case MultiLineString multiLineString: return Write(multiLineString); - case IMultiPolygon multiPolygon: + case MultiPolygon multiPolygon: return Write(multiPolygon); - case IGeometryCollection collection: + case GeometryCollection collection: return Write(collection); default: @@ -68,7 +68,7 @@ public SdoGeometry Write(IGeometry geometry) } } - private SdoGeometry Write(IPoint point) + private SdoGeometry Write(Point point) { var elemInfoList = new List(); var ordinateList = new List(); @@ -84,7 +84,7 @@ private SdoGeometry Write(IPoint point) }; } - private SdoGeometry Write(ILineString line) + private SdoGeometry Write(LineString line) { var elemInfoList = new List(); var ordinateList = new List(); @@ -100,7 +100,7 @@ private SdoGeometry Write(ILineString line) }; } - private SdoGeometry Write(IPolygon polygon) + private SdoGeometry Write(Polygon polygon) { var elemInfoList = new List(); var ordinateList = new List(); @@ -116,7 +116,7 @@ private SdoGeometry Write(IPolygon polygon) }; } - private SdoGeometry Write(IMultiPoint multiPoint) + private SdoGeometry Write(MultiPoint multiPoint) { var elemInfoList = new List(); var ordinateList = new List(); @@ -132,7 +132,7 @@ private SdoGeometry Write(IMultiPoint multiPoint) }; } - private SdoGeometry Write(IMultiLineString multiLineString) + private SdoGeometry Write(MultiLineString multiLineString) { var elemInfoList = new List(); var ordinateList = new List(); @@ -148,7 +148,7 @@ private SdoGeometry Write(IMultiLineString multiLineString) }; } - private SdoGeometry Write(IMultiPolygon multiPolygon) + private SdoGeometry Write(MultiPolygon multiPolygon) { var elemInfoList = new List(); var ordinateList = new List(); @@ -164,7 +164,7 @@ private SdoGeometry Write(IMultiPolygon multiPolygon) }; } - private SdoGeometry Write(IGeometryCollection geometryCollection) + private SdoGeometry Write(GeometryCollection geometryCollection) { var elemInfoList = new List(); var ordinateList = new List(); @@ -177,27 +177,27 @@ private SdoGeometry Write(IGeometryCollection geometryCollection) switch (geom.OgcGeometryType) { case OgcGeometryType.Point: - pos = ProcessPoint((IPoint)geom, elemInfoList, ordinateList, pos); + pos = ProcessPoint((Point)geom, elemInfoList, ordinateList, pos); break; case OgcGeometryType.LineString: - pos = ProcessLinear((ILineString)geom, elemInfoList, ordinateList, pos); + pos = ProcessLinear((LineString)geom, elemInfoList, ordinateList, pos); break; case OgcGeometryType.Polygon: - pos = ProcessPolygon((IPolygon)geom, elemInfoList, ordinateList, pos); + pos = ProcessPolygon((Polygon)geom, elemInfoList, ordinateList, pos); break; case OgcGeometryType.MultiPoint: - pos = ProcessMultiPoint((IMultiPoint)geom, elemInfoList, ordinateList, pos); + pos = ProcessMultiPoint((MultiPoint)geom, elemInfoList, ordinateList, pos); break; case OgcGeometryType.MultiLineString: - pos = ProcessMultiLineString((IMultiLineString)geom, elemInfoList, ordinateList, pos); + pos = ProcessMultiLineString((MultiLineString)geom, elemInfoList, ordinateList, pos); break; case OgcGeometryType.MultiPolygon: - pos = ProcessMultiPolygon((IMultiPolygon)geom, elemInfoList, ordinateList, pos); + pos = ProcessMultiPolygon((MultiPolygon)geom, elemInfoList, ordinateList, pos); break; default: @@ -214,7 +214,7 @@ private SdoGeometry Write(IGeometryCollection geometryCollection) }; } - private int ProcessPoint(IPoint point, List elemInfoList, List ordinateList, int pos) + private int ProcessPoint(Point point, List elemInfoList, List ordinateList, int pos) { elemInfoList.Add(pos); elemInfoList.Add((int)SdoEType.Coordinate); @@ -222,7 +222,7 @@ private int ProcessPoint(IPoint point, List elemInfoList, List return pos + AddOrdinates(point.CoordinateSequence, ordinateList); } - private int ProcessLinear(ILineString line, List elemInfoList, List ordinateList, int pos) + private int ProcessLinear(LineString line, List elemInfoList, List ordinateList, int pos) { elemInfoList.Add(pos); elemInfoList.Add((int)SdoEType.Line); @@ -230,7 +230,7 @@ private int ProcessLinear(ILineString line, List elemInfoList, List elemInfoList, List ordinateList, int pos) + private int ProcessPolygon(Polygon polygon, List elemInfoList, List ordinateList, int pos) { elemInfoList.Add(pos); elemInfoList.Add((int)SdoEType.PolygonExterior); @@ -257,11 +257,11 @@ private int ProcessPolygon(IPolygon polygon, List elemInfoList, List elemInfoList, List ordinateList, int pos) + private int ProcessMultiPoint(MultiPoint multiPoint, List elemInfoList, List ordinateList, int pos) { int cnt = multiPoint.NumGeometries; - // (airbreather 2019-01-29) for some reason, IMultiPoint seems to be special: it's not + // (airbreather 2019-01-29) for some reason, MultiPoint seems to be special: it's not // just ProcessPoint for each point, since that would append to elemInfoList multiple // times. instead, elemInfoList gets incremented just once. *shrugs*. elemInfoList.Add(pos); @@ -270,38 +270,38 @@ private int ProcessMultiPoint(IMultiPoint multiPoint, List elemInfoList for (int i = 0; i < cnt; i++) { - var point = (IPoint)multiPoint.GetGeometryN(i); + var point = (Point)multiPoint.GetGeometryN(i); pos += AddOrdinates(point.CoordinateSequence, ordinateList); } return pos; } - private int ProcessMultiLineString(IMultiLineString multiLineString, List elemInfoList, List ordinateList, int pos) + private int ProcessMultiLineString(MultiLineString multiLineString, List elemInfoList, List ordinateList, int pos) { int cnt = multiLineString.NumGeometries; for (int i = 0; i < cnt; i++) { - var line = (ILineString)multiLineString.GetGeometryN(i); + var line = (LineString)multiLineString.GetGeometryN(i); pos += ProcessLinear(line, elemInfoList, ordinateList, pos); } return pos; } - private int ProcessMultiPolygon(IMultiPolygon multiPolygon, List elemInfoList, List ordinateList, int pos) + private int ProcessMultiPolygon(MultiPolygon multiPolygon, List elemInfoList, List ordinateList, int pos) { int cnt = multiPolygon.NumGeometries; for (int i = 0; i < cnt; i++) { - var poly = (IPolygon)multiPolygon.GetGeometryN(i); + var poly = (Polygon)multiPolygon.GetGeometryN(i); pos = ProcessPolygon(poly, elemInfoList, ordinateList, pos); } return pos; } - private int AddOrdinates(ICoordinateSequence sequence, List ords) + private int AddOrdinates(CoordinateSequence sequence, List ords) { int dimension = sequence.Dimension; int numOfPoints = sequence.Count; @@ -311,14 +311,14 @@ private int AddOrdinates(ICoordinateSequence sequence, List ords) ords.Add((decimal)sequence.GetY(i)); if (dimension == 3) { - ords.Add((decimal)sequence.GetOrdinate(i, Ordinate.Z)); + ords.Add((decimal)sequence.GetZ(i)); } } return numOfPoints * dimension; } - private int AddOrdinatesInReverse(ICoordinateSequence sequence, List ords) + private int AddOrdinatesInReverse(CoordinateSequence sequence, List ords) { int dimension = sequence.Dimension; int numOfPoints = sequence.Count; @@ -329,39 +329,39 @@ private int AddOrdinatesInReverse(ICoordinateSequence sequence, List or ords.Add((decimal)sequence.GetY(i)); if (dimension == 3) { - ords.Add((decimal)sequence.GetOrdinate(i, Ordinate.Z)); + ords.Add((decimal)sequence.GetZ(i)); } } return numOfPoints * dimension; } - private SdoGTemplate Template(IGeometry geom) + private SdoGTemplate Template(Geometry geom) { switch (geom) { case null: return SdoGTemplate.Unknown; - case IPoint _: + case Point _: return SdoGTemplate.Coordinate; - case ILineString _: + case LineString _: return SdoGTemplate.Line; - case IPolygon _: + case Polygon _: return SdoGTemplate.Polygon; - case IMultiPoint _: + case MultiPoint _: return SdoGTemplate.MultiPoint; - case IMultiLineString _: + case MultiLineString _: return SdoGTemplate.MultiLine; - case IMultiPolygon _: + case MultiPolygon _: return SdoGTemplate.MultiPolygon; - case IGeometryCollection _: + case GeometryCollection _: return SdoGTemplate.Collection; default: diff --git a/NetTopologySuite.IO.Oracle/README.txt b/src/NetTopologySuite.IO.Oracle/README.txt similarity index 100% rename from NetTopologySuite.IO.Oracle/README.txt rename to src/NetTopologySuite.IO.Oracle/README.txt diff --git a/NetTopologySuite.IO.Oracle/Sdo/SdoEType.cs b/src/NetTopologySuite.IO.Oracle/Sdo/SdoEType.cs similarity index 100% rename from NetTopologySuite.IO.Oracle/Sdo/SdoEType.cs rename to src/NetTopologySuite.IO.Oracle/Sdo/SdoEType.cs diff --git a/NetTopologySuite.IO.Oracle/Sdo/SdoGTemplate.cs b/src/NetTopologySuite.IO.Oracle/Sdo/SdoGTemplate.cs similarity index 100% rename from NetTopologySuite.IO.Oracle/Sdo/SdoGTemplate.cs rename to src/NetTopologySuite.IO.Oracle/Sdo/SdoGTemplate.cs diff --git a/NetTopologySuite.IO.Oracle/Sdo/SdoGeometry.cs b/src/NetTopologySuite.IO.Oracle/Sdo/SdoGeometry.cs similarity index 100% rename from NetTopologySuite.IO.Oracle/Sdo/SdoGeometry.cs rename to src/NetTopologySuite.IO.Oracle/Sdo/SdoGeometry.cs diff --git a/NetTopologySuite.IO.Oracle/Sdo/SdoPoint.cs b/src/NetTopologySuite.IO.Oracle/Sdo/SdoPoint.cs similarity index 100% rename from NetTopologySuite.IO.Oracle/Sdo/SdoPoint.cs rename to src/NetTopologySuite.IO.Oracle/Sdo/SdoPoint.cs diff --git a/NetTopologySuite.IO.Oracle/Spec/b28400.pdf b/src/NetTopologySuite.IO.Oracle/Spec/b28400.pdf similarity index 100% rename from NetTopologySuite.IO.Oracle/Spec/b28400.pdf rename to src/NetTopologySuite.IO.Oracle/Spec/b28400.pdf diff --git a/NetTopologySuite.IO.Oracle/UdtBase/OracleArrayTypeFactoryBase.cs b/src/NetTopologySuite.IO.Oracle/UdtBase/OracleArrayTypeFactoryBase.cs similarity index 100% rename from NetTopologySuite.IO.Oracle/UdtBase/OracleArrayTypeFactoryBase.cs rename to src/NetTopologySuite.IO.Oracle/UdtBase/OracleArrayTypeFactoryBase.cs diff --git a/NetTopologySuite.IO.Oracle/UdtBase/OracleUdtBase.cs b/src/NetTopologySuite.IO.Oracle/UdtBase/OracleUdtBase.cs similarity index 100% rename from NetTopologySuite.IO.Oracle/UdtBase/OracleUdtBase.cs rename to src/NetTopologySuite.IO.Oracle/UdtBase/OracleUdtBase.cs diff --git a/test/Directory.Build.props b/test/Directory.Build.props new file mode 100644 index 0000000..32cb61f --- /dev/null +++ b/test/Directory.Build.props @@ -0,0 +1,16 @@ + + + + + + + false + + + + + + + + + diff --git a/test/NetTopologySuite.IO.Oracle.Test/AssemblyInfo.cs b/test/NetTopologySuite.IO.Oracle.Test/AssemblyInfo.cs new file mode 100644 index 0000000..3b1cc07 --- /dev/null +++ b/test/NetTopologySuite.IO.Oracle.Test/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: ComVisible(false)] +[assembly: Guid("58cebbbb-3e65-4dec-a344-9d4e32e518dd")] diff --git a/test/NetTopologySuite.IO.Oracle.Test/NetTopologySuite.IO.Oracle.Test.csproj b/test/NetTopologySuite.IO.Oracle.Test/NetTopologySuite.IO.Oracle.Test.csproj new file mode 100644 index 0000000..d1a579a --- /dev/null +++ b/test/NetTopologySuite.IO.Oracle.Test/NetTopologySuite.IO.Oracle.Test.csproj @@ -0,0 +1,12 @@ + + + + net472 + x86 + false + + + + + + diff --git a/NetTopologySuite.IO.Oracle.Test/OracleTest.cs b/test/NetTopologySuite.IO.Oracle.Test/OracleTest.cs similarity index 82% rename from NetTopologySuite.IO.Oracle.Test/OracleTest.cs rename to test/NetTopologySuite.IO.Oracle.Test/OracleTest.cs index a98c943..8422ce6 100644 --- a/NetTopologySuite.IO.Oracle.Test/OracleTest.cs +++ b/test/NetTopologySuite.IO.Oracle.Test/OracleTest.cs @@ -1,10 +1,4 @@ -using GeoAPI.IO; -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using NUnit.Framework; namespace NetTopologySuite.IO.Oracle.Test { @@ -16,7 +10,7 @@ public class OracleTest { private static readonly OracleGeometryReader or = new OracleGeometryReader(); - private static readonly WKTReader wr = new WKTReader(); + private static readonly WKTReader wr = new WKTReader { IsOldNtsCoordinateSyntaxAllowed = false }; /// /// @@ -42,26 +36,26 @@ public void CCWTestsOnPolygon() /// [TestCase("POINT(10 10)", -1)] [TestCase("POINT(10 10)", 4326)] - [TestCase("POINT(10 10 0)", -1)] - [TestCase("POINT(10 10 20)", -1)] + [TestCase("POINT Z(10 10 0)", -1)] + [TestCase("POINT Z(10 10 20)", -1)] [TestCase("MULTIPOINT(11 12, 20 20)", -1)] - [TestCase("MULTIPOINT(11 12 12, 20 20 20)", -1)] + [TestCase("MULTIPOINT Z(11 12 12, 20 20 20)", -1)] [TestCase("LINESTRING(10 10,20 20,50 50,34 34)", -1)] - [TestCase("LINESTRING(10 10 20,20 20 20,50 50 50,34 34 34)", -1)] + [TestCase("LINESTRING Z(10 10 20,20 20 20,50 50 50,34 34 34)", -1)] [TestCase("POLYGON((10 10,20 10,20 20,10 20,10 10))", -1)] [TestCase("POLYGON((10 10,20 10,20 20,10 20,10 10),(5 5,5 6,6 6,6 5,5 5))", -1)] - [TestCase("POLYGON((10 10 0,20 10 0,20 20 0,10 20 0,10 10 0),(5 5 0,5 6 0,6 6 0,6 5 0,5 5 0))", -1)] + [TestCase("POLYGON Z((10 10 0,20 10 0,20 20 0,10 20 0,10 10 0),(5 5 0,5 6 0,6 6 0,6 5 0,5 5 0))", -1)] [TestCase("MULTIPOLYGON(((10 10,20 10,20 20,20 10,10 10)),((10 10,20 10,20 20,20 10,10 10)))", -1)] [TestCase("MULTIPOLYGON(((10 10,20 10,20 20,10 20,10 10),(5 5,5 6,6 6,6 5,5 5)),((10 10,20 10,20 20,20 10,10 10)))", -1)] [TestCase("MULTIPOLYGON(((10 10,20 10,20 20,10 20,10 10),(5 5,5 6,6 6,6 5,5 5)),((10 10,20 10,20 20,20 10,10 10),(5 5,5 6,6 6,6 5,5 5)))", -1)] - [TestCase("MULTIPOLYGON(((10 10 0,20 10 0,20 20 0,10 20 0,10 10 0),(5 5 0,5 6 0,6 6 0,6 5 0,5 5 0)),((10 10 0,20 10 0,20 20 0,20 10 0,10 10 0),(5 5 0,5 6 0,6 6 0,6 5 0,5 5 0)))", -1)] + [TestCase("MULTIPOLYGON Z(((10 10 0,20 10 0,20 20 0,10 20 0,10 10 0),(5 5 0,5 6 0,6 6 0,6 5 0,5 5 0)),((10 10 0,20 10 0,20 20 0,20 10 0,10 10 0),(5 5 0,5 6 0,6 6 0,6 5 0,5 5 0)))", -1)] [TestCase("MULTILINESTRING((10 10,20 10,20 20,20 10),(5 5,5 6,6 6,6 5))", -1)] - [TestCase("MULTILINESTRING((10 10 5,20 10 5,20 20 0,20 10 0,10 10 0),(5 5 0,5 6 0,6 6 0,6 5 0,5 5 0))", -1)] + [TestCase("MULTILINESTRING Z((10 10 5,20 10 5,20 20 0,20 10 0,10 10 0),(5 5 0,5 6 0,6 6 0,6 5 0,5 5 0))", -1)] [TestCase("GEOMETRYCOLLECTION(POLYGON((10 10,20 10,20 20,10 20,10 10)),POLYGON((30 10,40 10,40 20,30 20,30 10)))", -1)] [TestCase("GEOMETRYCOLLECTION(POLYGON((10 10,20 10,20 20,10 20,10 10),(5 5,5 6,6 6,6 5,5 5)))", -1)] [TestCase("GEOMETRYCOLLECTION(POLYGON((10 10,20 10,20 20,10 20,10 10),(5 5,5 6,6 6,6 5,5 5)),LINESTRING(10 10,20 20,50 50,34 34))", -1)] [TestCase("GEOMETRYCOLLECTION(POINT(10 10),LINESTRING(10 10,20 20,50 50,34 34))", -1)] - [TestCase("GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(11 12, 20 20))", -1)] + [TestCase("GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(11 12, 20 20))", -1)] public void BasicConversion(string wkt, int srid) { var geom = wr.Read(wkt);