Skip to content

Commit

Permalink
Code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gosimowi committed Aug 27, 2024
1 parent 7448c00 commit 478c8c3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/NetTopologySuite.IO.Oracle/OracleGeometryReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,6 @@ private GeometryCollection CreateCollection(GeometryFactory factory, int dim, in
"ETYPE.POINT requires INTERPRETATION >= 1");
}

break;
case SdoEType.Multipoint:
geom = CreateMultiPoint(factory, dim, lrs, elemInfo, i, coords);
break;
case SdoEType.Line:
geom = CreateLine(factory, dim, lrs, elemInfo, i, coords);
Expand Down Expand Up @@ -410,7 +407,7 @@ private MultiPoint CreateMultiPoint(GeometryFactory factory, int dim, int lrs, d
if (!(sOffset >= 1) || !(sOffset <= coords.Count))
throw new ArgumentException("ELEM_INFO STARTING_OFFSET " + sOffset +
" inconsistent with ORDINATES length " + coords.Count);
if (etype != SdoEType.Coordinate && etype != SdoEType.Multipoint)
if (etype != SdoEType.Coordinate)
throw new ArgumentException("ETYPE " + etype + " inconsistent with expected POINT");
if (interpretation == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/NetTopologySuite.IO.Oracle/OracleGeometryWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private static int ProcessMultiPoint(MultiPoint multiPoint, int dimension, List<
// just ProcessPoint for each point, since that would append to elemInfoList multiple
// times. instead, elemInfoList gets incremented just once. *shrugs*.
elemInfoList.Add(pos);
elemInfoList.Add((int)SdoEType.Multipoint);
elemInfoList.Add((int)SdoEType.Coordinate);
elemInfoList.Add(cnt);

for (int i = 0; i < cnt; i++)
Expand Down
1 change: 0 additions & 1 deletion src/NetTopologySuite.IO.Oracle/Sdo/SdoEType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ internal enum SdoEType
Coordinate = 1,
Line = 2,
Polygon = 3,
Multipoint = 4,

PolygonExterior = 1003,
PolygonInterior = 2003
Expand Down
4 changes: 2 additions & 2 deletions test/NetTopologySuite.IO.Oracle.Test/OracleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ public void CCWTestsOnPolygon()
[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 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)))", -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 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,20 10,20 20,20 10))", -1)]
[TestCase("MULTILINESTRING((1 1, 2 1, 3 1), (1 2, 2 2, 3 2, 4 2), (1 3, 1 3, 3 3, 4 3))", -1)]
[TestCase("MULTILINESTRING((1 1, 2 1, 3 1), (1 2, 2 2, 3 2, 4 2), (1 3, 1 3, 3 3, 4 3),(1 5, 2 5, 3 5),(1 6, 2 6, 3 6, 4 6))", -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)]
Expand Down Expand Up @@ -83,7 +84,6 @@ public void BasicConversion(string wkt, int srid)
/// <param name="wkt"></param>
/// <param name="wktresult"></param>
/// <param name="srid"></param>
[TestCase("GEOMETRYCOLLECTION(MULTIPOINT(11 12))", "GEOMETRYCOLLECTION(MULTIPOINT(11 12))", - 1)]
[TestCase("GEOMETRYCOLLECTION(MULTIPOINT(11 12, 20 20))", "GEOMETRYCOLLECTION(MULTIPOINT(11 12, 20 20))", - 1)]
[TestCase("GEOMETRYCOLLECTION(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))))", "GEOMETRYCOLLECTION(POLYGON((10 10,20 10,20 20,10 20,10 10),(5 5,5 6,6 6,6 5,5 5)),POLYGON((10 10,20 10,20 20,20 10,10 10),(5 5,5 6,6 6,6 5,5 5)))", - 1)]
[TestCase("GEOMETRYCOLLECTION(MULTILINESTRING((10 10,20 10,20 20,10 20,10 10),(5 5,5 6,6 6,6 5,5 5)))", "GEOMETRYCOLLECTION(LINESTRING(10 10,20 10,20 20,10 20,10 10),LINESTRING(5 5,5 6,6 6,6 5,5 5))", -1)]
Expand Down

0 comments on commit 478c8c3

Please sign in to comment.