@@ -62,8 +62,8 @@ ngDescribe({
62
62
expect ( nodes [ '3' ] . id ) . toBe ( 3 ) ;
63
63
expect ( nodes [ '3' ] . type ) . toBe ( 'node' ) ;
64
64
expect ( nodes [ '3' ] . latLng . length ) . toBe ( 2 ) ;
65
- expect ( nodes [ '3' ] . latLng [ 0 ] ) . toBe ( 321 ) ;
66
- expect ( nodes [ '3' ] . latLng [ 1 ] ) . toBe ( 123 ) ;
65
+ expect ( nodes [ '3' ] . latLng [ 0 ] ) . toBe ( 123 ) ;
66
+ expect ( nodes [ '3' ] . latLng [ 1 ] ) . toBe ( 321 ) ;
67
67
expect ( nodes [ '3' ] . tags . highway ) . toBe ( 'mini_roundabout' ) ;
68
68
69
69
//must work the same if node is array & tag is array of tags
@@ -76,8 +76,8 @@ ngDescribe({
76
76
expect ( nodes [ '3' ] . id ) . toBe ( 3 ) ;
77
77
expect ( nodes [ '3' ] . type ) . toBe ( 'node' ) ;
78
78
expect ( nodes [ '3' ] . latLng . length ) . toBe ( 2 ) ;
79
- expect ( nodes [ '3' ] . latLng [ 0 ] ) . toBe ( 321 ) ;
80
- expect ( nodes [ '3' ] . latLng [ 1 ] ) . toBe ( 123 ) ;
79
+ expect ( nodes [ '3' ] . latLng [ 0 ] ) . toBe ( 123 ) ;
80
+ expect ( nodes [ '3' ] . latLng [ 1 ] ) . toBe ( 321 ) ;
81
81
expect ( nodes [ '3' ] . tags . highway ) . toBe ( undefined ) ;
82
82
83
83
} ) ;
@@ -251,14 +251,6 @@ ngDescribe({
251
251
result = deps . osmtogeojson . interestingNode ( node , ways , relations ) ;
252
252
expect ( result ) . toBe ( true ) ;
253
253
254
- relations = [ ] ;
255
- node . tags = { name : 'toto' } ;
256
- result = deps . osmtogeojson . interestingNode ( node , ways , relations ) ;
257
- expect ( result ) . toBe ( true ) ;
258
-
259
- node . tags = { source : 'uninterestingTags' } ;
260
- result = deps . osmtogeojson . interestingNode ( node , ways , relations ) ;
261
- expect ( result ) . toBe ( false ) ;
262
254
} ) ;
263
255
264
256
it ( 'should getFeatures to work with changeset' , function ( ) {
@@ -274,16 +266,16 @@ ngDescribe({
274
266
} ] ;
275
267
var features = deps . osmtogeojson . getFeatures ( data ) ;
276
268
expect ( features . length ) . toBe ( 1 ) ;
277
- expect ( features [ 0 ] . type ) . toBe ( 'Polygon' ) ;
278
- expect ( features [ 0 ] . coordinates [ 0 ] [ 0 ] ) . toBe ( - 234 ) ;
279
- expect ( features [ 0 ] . coordinates [ 0 ] [ 1 ] ) . toBe ( - 123 ) ;
280
- expect ( features [ 0 ] . coordinates [ 1 ] [ 0 ] ) . toBe ( - 234 ) ;
281
- expect ( features [ 0 ] . coordinates [ 1 ] [ 1 ] ) . toBe ( 123 ) ;
282
- expect ( features [ 0 ] . coordinates [ 2 ] [ 0 ] ) . toBe ( 234 ) ;
283
- expect ( features [ 0 ] . coordinates [ 2 ] [ 1 ] ) . toBe ( 123 ) ;
284
- expect ( features [ 0 ] . coordinates [ 3 ] [ 0 ] ) . toBe ( 234 ) ;
285
- expect ( features [ 0 ] . coordinates [ 3 ] [ 1 ] ) . toBe ( - 123 ) ;
286
- expect ( features [ 0 ] . coordinates [ 4 ] ) . toBe ( ) ;
269
+ expect ( features [ 0 ] . geometry . type ) . toBe ( 'Polygon' ) ;
270
+ expect ( features [ 0 ] . geometry . coordinates [ 0 ] [ 0 ] ) . toBe ( - 234 ) ;
271
+ expect ( features [ 0 ] . geometry . coordinates [ 0 ] [ 1 ] ) . toBe ( - 123 ) ;
272
+ expect ( features [ 0 ] . geometry . coordinates [ 1 ] [ 0 ] ) . toBe ( - 234 ) ;
273
+ expect ( features [ 0 ] . geometry . coordinates [ 1 ] [ 1 ] ) . toBe ( 123 ) ;
274
+ expect ( features [ 0 ] . geometry . coordinates [ 2 ] [ 0 ] ) . toBe ( 234 ) ;
275
+ expect ( features [ 0 ] . geometry . coordinates [ 2 ] [ 1 ] ) . toBe ( 123 ) ;
276
+ expect ( features [ 0 ] . geometry . coordinates [ 3 ] [ 0 ] ) . toBe ( 234 ) ;
277
+ expect ( features [ 0 ] . geometry . coordinates [ 3 ] [ 1 ] ) . toBe ( - 123 ) ;
278
+ expect ( features [ 0 ] . geometry . coordinates [ 4 ] ) . toBe ( ) ;
287
279
} ) ;
288
280
it ( 'should getFeatures to work with node' , function ( ) {
289
281
var data = [ {
@@ -294,10 +286,10 @@ ngDescribe({
294
286
} ] ;
295
287
var features = deps . osmtogeojson . getFeatures ( data ) ;
296
288
expect ( features . length ) . toBe ( 1 ) ;
297
- expect ( features [ 0 ] . type ) . toBe ( 'Point' ) ;
298
- expect ( features [ 0 ] . coordinates [ 0 ] ) . toBe ( 234 ) ;
299
- expect ( features [ 0 ] . coordinates [ 1 ] ) . toBe ( 123 ) ;
300
- expect ( features [ 0 ] . coordinates [ 2 ] ) . toBe ( ) ;
289
+ expect ( features [ 0 ] . geometry . type ) . toBe ( 'Point' ) ;
290
+ expect ( features [ 0 ] . geometry . coordinates [ 0 ] ) . toBe ( 234 ) ;
291
+ expect ( features [ 0 ] . geometry . coordinates [ 1 ] ) . toBe ( 123 ) ;
292
+ expect ( features [ 0 ] . geometry . coordinates [ 2 ] ) . toBe ( ) ;
301
293
} ) ;
302
294
it ( 'should getFeatures to work with way' , function ( ) {
303
295
var n1 = {
@@ -320,13 +312,13 @@ ngDescribe({
320
312
} ] ;
321
313
var features = deps . osmtogeojson . getFeatures ( data ) ;
322
314
expect ( features . length ) . toBe ( 1 ) ;
323
- expect ( features [ 0 ] . type ) . toBe ( 'MultiLineString ' ) ;
315
+ expect ( features [ 0 ] . geometry . type ) . toBe ( 'LineString ' ) ;
324
316
expect ( features [ 0 ] . properties . tags . name ) . toBe ( 'my way' ) ;
325
- expect ( features [ 0 ] . coordinates [ 0 ] [ 0 ] ) . toBe ( 123 ) ;
326
- expect ( features [ 0 ] . coordinates [ 0 ] [ 1 ] ) . toBe ( 234 ) ;
327
- expect ( features [ 0 ] . coordinates [ 1 ] [ 0 ] ) . toBe ( 1234 ) ;
328
- expect ( features [ 0 ] . coordinates [ 1 ] [ 1 ] ) . toBe ( 2345 ) ;
329
- expect ( features [ 0 ] . coordinates [ 2 ] ) . toBe ( ) ;
317
+ expect ( features [ 0 ] . geometry . coordinates [ 0 ] [ 0 ] ) . toBe ( 234 ) ;
318
+ expect ( features [ 0 ] . geometry . coordinates [ 0 ] [ 1 ] ) . toBe ( 123 ) ;
319
+ expect ( features [ 0 ] . geometry . coordinates [ 1 ] [ 0 ] ) . toBe ( 2345 ) ;
320
+ expect ( features [ 0 ] . geometry . coordinates [ 1 ] [ 1 ] ) . toBe ( 1234 ) ;
321
+ expect ( features [ 0 ] . geometry . coordinates [ 2 ] ) . toBe ( ) ;
330
322
} ) ;
331
323
332
324
it ( 'should getFeatures to work with way (area)' , function ( ) {
@@ -356,14 +348,14 @@ ngDescribe({
356
348
} ] ;
357
349
var features = deps . osmtogeojson . getFeatures ( data ) ;
358
350
expect ( features . length ) . toBe ( 1 ) ;
359
- expect ( features [ 0 ] . type ) . toBe ( 'Polygon' ) ;
360
- expect ( features [ 0 ] . coordinates [ 0 ] [ 0 ] ) . toBe ( 1 ) ;
361
- expect ( features [ 0 ] . coordinates [ 0 ] [ 1 ] ) . toBe ( 2 ) ;
362
- expect ( features [ 0 ] . coordinates [ 1 ] [ 0 ] ) . toBe ( 12 ) ;
363
- expect ( features [ 0 ] . coordinates [ 1 ] [ 1 ] ) . toBe ( 23 ) ;
364
- expect ( features [ 0 ] . coordinates [ 2 ] [ 0 ] ) . toBe ( 123 ) ;
365
- expect ( features [ 0 ] . coordinates [ 2 ] [ 1 ] ) . toBe ( 234 ) ;
366
- expect ( features [ 0 ] . coordinates [ 3 ] ) . toBe ( ) ;
351
+ expect ( features [ 0 ] . geometry . type ) . toBe ( 'Polygon' ) ;
352
+ expect ( features [ 0 ] . geometry . coordinates [ 0 ] [ 0 ] ) . toBe ( 2 ) ;
353
+ expect ( features [ 0 ] . geometry . coordinates [ 0 ] [ 1 ] ) . toBe ( 1 ) ;
354
+ expect ( features [ 0 ] . geometry . coordinates [ 1 ] [ 0 ] ) . toBe ( 23 ) ;
355
+ expect ( features [ 0 ] . geometry . coordinates [ 1 ] [ 1 ] ) . toBe ( 12 ) ;
356
+ expect ( features [ 0 ] . geometry . coordinates [ 2 ] [ 0 ] ) . toBe ( 234 ) ;
357
+ expect ( features [ 0 ] . geometry . coordinates [ 2 ] [ 1 ] ) . toBe ( 123 ) ;
358
+ expect ( features [ 0 ] . geometry . coordinates [ 3 ] ) . toBe ( ) ;
367
359
} ) ;
368
360
369
361
@@ -422,8 +414,8 @@ ngDescribe({
422
414
expect ( geojson . features . length ) . toBe ( 2 ) ;
423
415
expect ( Array . isArray ( geojson . features ) ) . toBe ( true ) ;
424
416
expect ( geojson . features [ 1 ] . properties . tags . highway ) . toBe ( 'mini_roundabout' ) ;
425
- expect ( geojson . features [ 1 ] . type ) . toBe ( 'MultiLineString ' ) ;
426
- expect ( geojson . features [ 0 ] . type ) . toBe ( 'Point' ) ;
417
+ expect ( geojson . features [ 1 ] . geometry . type ) . toBe ( 'LineString ' ) ;
418
+ expect ( geojson . features [ 0 ] . geometry . type ) . toBe ( 'Point' ) ;
427
419
} ) ;
428
420
429
421
}
0 commit comments