@@ -85,35 +85,6 @@ public void TestSTConvexHull()
8585 }
8686 }
8787
88- [ Test ]
89- public void TestSTCurveToLine ( )
90- {
91- using ( var db = new PostGisTestDataConnection ( TestDatabaseConnectionString ) )
92- {
93- const string wkt1 = "CIRCULARSTRING(0 0,100 -100,200 0)" ;
94- db . TestGeometries
95- . Value ( g => g . Id , 1 )
96- . Value ( p => p . Geometry , ( ) => GeometryInput . STGeomFromText ( wkt1 ) )
97- . Insert ( ) ;
98-
99- var result1 = db . TestGeometries
100- . Where ( g => g . Id == 1 )
101- . Select ( g => g . Geometry . STCurveToLine ( 20 , 1 , 1 ) )
102- . Single ( ) as NTSGS . LineString ;
103-
104- Assert . AreEqual ( 0 , result1 . Coordinates [ 0 ] . X ) ;
105- Assert . AreEqual ( 0 , result1 . Coordinates [ 0 ] . Y ) ;
106- Assert . AreEqual ( 50 , result1 . Coordinates [ 1 ] . X , 1.0E-9 ) ;
107- Assert . AreEqual ( - 86.6025403784438 , result1 . Coordinates [ 1 ] . Y , 1.0E-9 ) ;
108- Assert . AreEqual ( 150 , result1 . Coordinates [ 2 ] . X , 1.0E-9 ) ;
109- Assert . AreEqual ( - 86.6025403784439 , result1 . Coordinates [ 2 ] . Y , 1.0E-9 ) ;
110- Assert . AreEqual ( 200 , result1 . Coordinates [ 3 ] . X , 1.0E-9 ) ;
111- Assert . AreEqual ( 0 , result1 . Coordinates [ 3 ] . Y , 1.0E-9 ) ;
112-
113- Assert . IsNull ( db . Select ( ( ) => GeometryProcessing . STCurveToLine ( null , 20 , 1 , 1 ) ) ) ;
114- }
115- }
116-
11788 [ Test ]
11889 public void TestSTDelaunayTriangles ( )
11990 {
@@ -146,20 +117,6 @@ public void TestSTDifference()
146117 }
147118 }
148119
149- [ Test ]
150- public void TestSTFlipCoordinates ( )
151- {
152- using ( var db = new PostGisTestDataConnection ( TestDatabaseConnectionString ) )
153- {
154- var geom1 = db . Select ( ( ) => GeometryInput . STGeomFromText ( "POINT(1 2)" ) ) ;
155-
156- var result1 = db . Select ( ( ) => GeometryProcessing . STFlipCoordinates ( geom1 ) . STAsText ( ) ) ;
157- Assert . AreEqual ( "POINT(2 1)" , result1 ) ;
158-
159- Assert . IsNull ( db . Select ( ( ) => GeometryProcessing . STFlipCoordinates ( null ) ) ) ;
160- }
161- }
162-
163120 [ Test ]
164121 public void TestSTGeneratePoints ( )
165122 {
@@ -206,28 +163,6 @@ public void TestSTGeometricMedian()
206163 }
207164 }
208165
209- [ Test ]
210- public void TestSTLineToCurve ( )
211- {
212- using ( var db = new PostGisTestDataConnection ( TestDatabaseConnectionString ) )
213- {
214- const string wkt = "POINT(1 3)" ;
215- db . TestGeometries
216- . Value ( g => g . Id , 1 )
217- . Value ( p => p . Geometry , ( ) =>
218- GeometryInput . STGeomFromText ( wkt ) . STBuffer ( 3.0 ) )
219- . Insert ( ) ;
220-
221- // NTS error: 'Geometry type not recognized. GeometryCode: 10'
222- var curvePolygon = db . TestGeometries
223- . Where ( g => g . Id == 1 )
224- . Select ( g => g . Geometry . STLineToCurve ( ) . STAsText ( ) )
225- . Single ( ) ;
226-
227- Assert . AreEqual ( "CURVEPOLYGON(CIRCULARSTRING(4 3,-2 2.99999999999999,4 3))" , curvePolygon ) ;
228- }
229- }
230-
231166 [ Test ]
232167 public void TestSTMakeValid ( )
233168 {
@@ -358,8 +293,8 @@ public void TestSTOffsetCurve()
358293 {
359294 const string wkt = @"LINESTRING(164 16,144 16,124 16,104 16,84 16,64 16,
360295 44 16,24 16,20 16,18 16,17 17,
361- 16 18,16 20,16 40,16 60,16 80,16 100,
362- 16 120,16 140,16 160,16 180,16 195)";
296+ 16 18,16 20,16 40,16 60,16 80,16 100,
297+ 16 120,16 140,16 160,16 180,16 195)";
363298 db . TestGeometries
364299 . Value ( g => g . Id , 1 )
365300 . Value ( p => p . Geometry , ( ) => GeometryInput . STGeomFromText ( wkt ) )
@@ -411,26 +346,6 @@ public void TestSTPointOnSurface()
411346 }
412347 }
413348
414- [ Test ]
415- public void TestSTRemoveRepeatedPoints ( )
416- {
417- using ( var db = new PostGisTestDataConnection ( TestDatabaseConnectionString ) )
418- {
419- const string wkt = "LINESTRING(0 5, 0 0, 0 0, 0 10)" ;
420- db . TestGeometries
421- . Value ( g => g . Id , 1 )
422- . Value ( p => p . Geometry , ( ) => GeometryInput . STGeomFromText ( wkt ) )
423- . Insert ( ) ;
424-
425- var result = db . TestGeometries
426- . Where ( g => g . Id == 1 )
427- . Select ( g => g . Geometry . STRemoveRepeatedPoints ( 1 ) . AsText ( ) )
428- . Single ( ) ;
429-
430- Assert . AreEqual ( "LINESTRING (0 5, 0 0, 0 10)" , result ) ;
431- }
432- }
433-
434349 [ Test ]
435350 public void TestSTSharedPaths ( )
436351 {
@@ -456,40 +371,6 @@ public void TestSTSharedPaths()
456371 }
457372 }
458373
459- [ Test ]
460- public void TestSTShiftLongitude ( )
461- {
462- using ( var db = new PostGisTestDataConnection ( TestDatabaseConnectionString ) )
463- {
464- const string Ewkt1 = "SRID=4326;POINT(-118.58 38.38 10)" ;
465- const string Ewkt2 = "SRID=4326;POINT(241.42 38.38 10)" ;
466- db . TestGeometries
467- . Value ( g => g . Id , 1 )
468- . Value ( p => p . Geometry , ( ) => GeometryInput . STGeomFromEWKT ( Ewkt1 ) )
469- . Insert ( ) ;
470- db . TestGeometries
471- . Value ( g => g . Id , 2 )
472- . Value ( p => p . Geometry , ( ) => GeometryInput . STGeomFromEWKT ( Ewkt2 ) )
473- . Insert ( ) ;
474-
475- var result1 = db . TestGeometries
476- . Where ( g => g . Id == 1 )
477- . Select ( g => g . Geometry . STShiftLongitude ( ) )
478- . Single ( ) as NTSGS . Point ;
479-
480- var result2 = db . TestGeometries
481- . Where ( g => g . Id == 2 )
482- . Select ( g => g . Geometry . STShiftLongitude ( ) )
483- . Single ( ) as NTSGS . Point ;
484-
485- Assert . AreEqual ( 241.42 , result1 . X , 1.0E-2 ) ;
486- Assert . AreEqual ( 38.38 , result1 . Y , 1.0E-2 ) ;
487-
488- Assert . AreEqual ( - 118.58 , result2 . X , 1.0E-2 ) ;
489- Assert . AreEqual ( 38.38 , result2 . Y , 1.0E-2 ) ;
490- }
491- }
492-
493374 [ Test ]
494375 public void TestSTSimplify ( )
495376 {
0 commit comments