@@ -62,8 +62,8 @@ ngDescribe({
6262 expect ( nodes [ '3' ] . id ) . toBe ( 3 ) ;
6363 expect ( nodes [ '3' ] . type ) . toBe ( 'node' ) ;
6464 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 ) ;
6767 expect ( nodes [ '3' ] . tags . highway ) . toBe ( 'mini_roundabout' ) ;
6868
6969 //must work the same if node is array & tag is array of tags
@@ -76,8 +76,8 @@ ngDescribe({
7676 expect ( nodes [ '3' ] . id ) . toBe ( 3 ) ;
7777 expect ( nodes [ '3' ] . type ) . toBe ( 'node' ) ;
7878 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 ) ;
8181 expect ( nodes [ '3' ] . tags . highway ) . toBe ( undefined ) ;
8282
8383 } ) ;
@@ -251,14 +251,6 @@ ngDescribe({
251251 result = deps . osmtogeojson . interestingNode ( node , ways , relations ) ;
252252 expect ( result ) . toBe ( true ) ;
253253
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 ) ;
262254 } ) ;
263255
264256 it ( 'should getFeatures to work with changeset' , function ( ) {
@@ -274,16 +266,16 @@ ngDescribe({
274266 } ] ;
275267 var features = deps . osmtogeojson . getFeatures ( data ) ;
276268 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 ( ) ;
287279 } ) ;
288280 it ( 'should getFeatures to work with node' , function ( ) {
289281 var data = [ {
@@ -294,10 +286,10 @@ ngDescribe({
294286 } ] ;
295287 var features = deps . osmtogeojson . getFeatures ( data ) ;
296288 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 ( ) ;
301293 } ) ;
302294 it ( 'should getFeatures to work with way' , function ( ) {
303295 var n1 = {
@@ -320,13 +312,13 @@ ngDescribe({
320312 } ] ;
321313 var features = deps . osmtogeojson . getFeatures ( data ) ;
322314 expect ( features . length ) . toBe ( 1 ) ;
323- expect ( features [ 0 ] . type ) . toBe ( 'MultiLineString ' ) ;
315+ expect ( features [ 0 ] . geometry . type ) . toBe ( 'LineString ' ) ;
324316 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 ( ) ;
330322 } ) ;
331323
332324 it ( 'should getFeatures to work with way (area)' , function ( ) {
@@ -356,14 +348,14 @@ ngDescribe({
356348 } ] ;
357349 var features = deps . osmtogeojson . getFeatures ( data ) ;
358350 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 ( ) ;
367359 } ) ;
368360
369361
@@ -422,8 +414,8 @@ ngDescribe({
422414 expect ( geojson . features . length ) . toBe ( 2 ) ;
423415 expect ( Array . isArray ( geojson . features ) ) . toBe ( true ) ;
424416 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' ) ;
427419 } ) ;
428420
429421 }
0 commit comments