@@ -122,6 +122,36 @@ suite.addBatch({
122122 "inside" : function ( pointInPolygon ) {
123123 assert . ok ( pointInPolygon ( [ 0 , 20 ] ) ) ;
124124 }
125+ } ,
126+ "narrow equatorial hole" : {
127+ topic : function ( pointInPolygon ) {
128+ var circle = _ . geo . circle ( ) . origin ( [ 0 , - 90 ] ) ;
129+ return pointInPolygon ( [
130+ circle . angle ( 90 - .01 ) ( ) . coordinates [ 0 ] ,
131+ circle . angle ( 90 + .01 ) ( ) . coordinates [ 0 ] . reverse ( )
132+ ] ) ;
133+ } ,
134+ "outside" : function ( pointInPolygon ) {
135+ assert . ok ( ! pointInPolygon ( [ 0 , 0 ] ) ) ;
136+ } ,
137+ "inside" : function ( pointInPolygon ) {
138+ assert . ok ( pointInPolygon ( [ 0 , - 90 ] ) ) ;
139+ }
140+ } ,
141+ "narrow equatorial strip" : {
142+ topic : function ( pointInPolygon ) {
143+ var circle = _ . geo . circle ( ) . origin ( [ 0 , - 90 ] ) ;
144+ return pointInPolygon ( [
145+ circle . angle ( 90 + .01 ) ( ) . coordinates [ 0 ] ,
146+ circle . angle ( 90 - .01 ) ( ) . coordinates [ 0 ] . reverse ( )
147+ ] ) ;
148+ } ,
149+ "outside" : function ( pointInPolygon ) {
150+ assert . ok ( ! pointInPolygon ( [ 0 , - 90 ] ) ) ;
151+ } ,
152+ "inside" : function ( pointInPolygon ) {
153+ assert . ok ( pointInPolygon ( [ 0 , 0 ] ) ) ;
154+ }
125155 }
126156 } ,
127157 "ring" : {
@@ -317,15 +347,15 @@ suite.addBatch({
317347 return pointInPolygon ( [ [ [ 180 , - 90 ] , [ - 135 , 0 ] , [ 135 , 0 ] , [ 180 , - 90 ] ] ] ) ;
318348 } ,
319349 "inside" : function ( pointInPolygon ) {
320- assert . ok ( pointInPolygon ( [ 180 , 0 ] ) ) ;
321- assert . ok ( pointInPolygon ( [ 150 , 0 ] ) ) ;
322- assert . ok ( pointInPolygon ( [ 180 , - 30 ] ) ) ;
323- assert . ok ( pointInPolygon ( [ 150 , - 80 ] ) ) ;
350+ assert . ok ( pointInPolygon ( [ 0 , 0 ] ) ) ;
351+ assert . ok ( pointInPolygon ( [ 180 , 1 ] ) ) ;
352+ assert . ok ( pointInPolygon ( [ - 90 , - 80 ] ) ) ;
324353 } ,
325354 "outside" : function ( pointInPolygon ) {
326- assert . ok ( ! pointInPolygon ( [ 0 , 0 ] ) ) ;
327- assert . ok ( ! pointInPolygon ( [ 180 , 1 ] ) ) ;
328- assert . ok ( ! pointInPolygon ( [ - 90 , - 80 ] ) ) ;
355+ assert . ok ( ! pointInPolygon ( [ 180 , 0 ] ) ) ;
356+ assert . ok ( ! pointInPolygon ( [ 150 , 0 ] ) ) ;
357+ assert . ok ( ! pointInPolygon ( [ 180 , - 30 ] ) ) ;
358+ assert . ok ( ! pointInPolygon ( [ 150 , - 80 ] ) ) ;
329359 }
330360 } ,
331361 "triangle touching the North pole" : {
0 commit comments