@@ -10,6 +10,16 @@ import { classifyOvertureBarrier } from '../../features/barrier/overtureClassify
1010import { classifyOvertureStructure } from '../../features/structure/overtureClassify' ;
1111import { polygon , lineString , point } from '@turf/helpers' ;
1212
13+ const BOUNDS_POLYGON = polygon ( [
14+ [
15+ [ - 1 , - 1 ] ,
16+ [ 2 , - 1 ] ,
17+ [ 2 , 2 ] ,
18+ [ - 1 , 2 ] ,
19+ [ - 1 , - 1 ] ,
20+ ] ,
21+ ] ) ;
22+
1323describe ( 'Overture classify functions' , ( ) => {
1424 it ( 'classifies buildings with visual properties' , ( ) => {
1525 const geom = polygon ( [
@@ -134,12 +144,12 @@ describe('Overture classify functions', () => {
134144 ] ,
135145 ] ) . geometry ;
136146
137- const lake = classifyOvertureWater ( 'w1' , { class : 'lake' } , geom , {
138- minLng : - 1 ,
139- minLat : - 1 ,
140- maxLng : 2 ,
141- maxLat : 2 ,
142- } ) ;
147+ const lake = classifyOvertureWater (
148+ 'w1' ,
149+ { class : 'lake' } ,
150+ geom ,
151+ BOUNDS_POLYGON
152+ ) ;
143153
144154 expect ( lake ! . type ) . toBe ( 'lake' ) ;
145155 expect ( lake ! . isArea ) . toBe ( true ) ;
@@ -152,12 +162,12 @@ describe('Overture classify functions', () => {
152162 [ 1 , 1 ] ,
153163 ] ) . geometry ;
154164
155- const river = classifyOvertureWater ( 'w2' , { class : 'river' } , geom , {
156- minLng : - 1 ,
157- minLat : - 1 ,
158- maxLng : 2 ,
159- maxLat : 2 ,
160- } ) ;
165+ const river = classifyOvertureWater (
166+ 'w2' ,
167+ { class : 'river' } ,
168+ geom ,
169+ BOUNDS_POLYGON
170+ ) ;
161171
162172 expect ( river ! . type ) . toBe ( 'river' ) ;
163173 expect ( river ! . isArea ) . toBe ( false ) ;
@@ -188,7 +198,7 @@ describe('Overture classify functions', () => {
188198 'v1' ,
189199 { class : 'forest' , height : 25 } ,
190200 geom ,
191- { minLng : - 1 , minLat : - 1 , maxLng : 2 , maxLat : 2 }
201+ BOUNDS_POLYGON
192202 ) ;
193203
194204 expect ( forest ! . type ) . toBe ( 'forest' ) ;
@@ -207,12 +217,11 @@ describe('Overture classify functions', () => {
207217 ] ,
208218 ] ) . geometry ;
209219
210- const bounds = { minLng : - 1 , minLat : - 1 , maxLng : 2 , maxLat : 2 } ;
211220 const landuse = classifyOvertureLanduse (
212221 'l1' ,
213222 { class : 'residential' } ,
214223 geom ,
215- bounds
224+ BOUNDS_POLYGON
216225 ) ;
217226
218227 expect ( landuse ) . not . toBeNull ( ) ;
@@ -436,7 +445,7 @@ describe('Overture classify functions', () => {
436445 'w3' ,
437446 { class : 'stream' , is_intermittent : true } ,
438447 geom ,
439- { minLng : - 1 , minLat : - 1 , maxLng : 2 , maxLat : 2 }
448+ BOUNDS_POLYGON
440449 ) ;
441450
442451 expect ( water ! . intermittent ) . toBe ( true ) ;
@@ -529,7 +538,7 @@ describe('Overture classify functions', () => {
529538 } ) ,
530539 } ,
531540 geom ,
532- { minLng : - 1 , minLat : - 1 , maxLng : 2 , maxLat : 2 }
541+ BOUNDS_POLYGON
533542 ) ;
534543
535544 expect ( veg ! . leafType ) . toBe ( 'broadleaved' ) ;
@@ -556,7 +565,7 @@ describe('Overture classify functions', () => {
556565 source_tags : { leaf_type : 'needleleaved' , circumference : '2.1' } ,
557566 } ,
558567 geom ,
559- { minLng : - 1 , minLat : - 1 , maxLng : 2 , maxLat : 2 }
568+ BOUNDS_POLYGON
560569 ) ;
561570
562571 expect ( veg ! . leafType ) . toBe ( 'needleleaved' ) ;
@@ -576,12 +585,12 @@ describe('Overture classify functions', () => {
576585 ] ,
577586 ] ) . geometry ;
578587
579- const veg = classifyOvertureVegetation ( 'v-st3' , { class : 'grass' } , geom , {
580- minLng : - 1 ,
581- minLat : - 1 ,
582- maxLng : 2 ,
583- maxLat : 2 ,
584- } ) ;
588+ const veg = classifyOvertureVegetation (
589+ 'v-st3' ,
590+ { class : 'grass' } ,
591+ geom ,
592+ BOUNDS_POLYGON
593+ ) ;
585594
586595 expect ( veg ! . leafType ) . toBeUndefined ( ) ;
587596 expect ( veg ! . leafCycle ) . toBeUndefined ( ) ;
@@ -604,7 +613,7 @@ describe('Overture classify functions', () => {
604613 'v-st4' ,
605614 { class : 'scrub' , source_tags : '{not valid json' } ,
606615 geom ,
607- { minLng : - 1 , minLat : - 1 , maxLng : 2 , maxLat : 2 }
616+ BOUNDS_POLYGON
608617 ) ;
609618
610619 expect ( veg ! . leafType ) . toBeUndefined ( ) ;
@@ -629,7 +638,7 @@ describe('Overture classify functions', () => {
629638 source_tags : { diameter_crown : 'wide' , leaf_type : 'broadleaved' } ,
630639 } ,
631640 geom ,
632- { minLng : - 1 , minLat : - 1 , maxLng : 2 , maxLat : 2 }
641+ BOUNDS_POLYGON
633642 ) ;
634643
635644 expect ( veg ! . crownDiameter ) . toBeUndefined ( ) ;
0 commit comments