[R-sig-Geo] plotKML using STFDF object replicated polygons plot order error

Constantine VII newsted82 at gmail.com
Sun Feb 5 22:59:39 CET 2017


Greetings,

I am trying to use plotKML in order to produce an animation plot, my STFDF
object "STFDF_December_corr" works OK with stplot function but when I use
plotKML i get the following error:


 plotKML(STFDF_December_corr[,,"SMS_In_activity"])
Error in from at sp[from at index[, 1], ] :
  SpatialPolygons selection: can't find plot order if polygons are
replicated

Any help would be greatly appriciated.

Bellow are the dim and str of the STFDF object (it's a large one):

dim(STFDF_December_corr)
    space      time variables
     6259       744         8




> str(STFDF_December_corr)
Formal class 'STFDF' [package "spacetime"] with 4 slots
  ..@ data   :'data.frame': 4656696 obs. of  8 variables:
  .. ..$ new_mapping              : chr [1:4656696] "1" "2" "3" "4" ...
  .. ..$ Time_interval            : POSIXct[1:4656696], format: "2013-11-30
23:00:00" "2013-11-30 23:00:00" ...
  .. ..$ SMS_In_activity          : num [1:4656696] 2.39 2.85 1.99 4.19
3.62 ...
  .. ..$ SMS_out_activity         : num [1:4656696] 1.42 2.01 2.43 3.31
2.66 ...
  .. ..$ Call_In_activity         : num [1:4656696] 0.53 0.331 0.43 0.348
0.359 ...
  .. ..$ Call_Out_activity        : num [1:4656696] 0.126 0.202 0.372 0.348
0.309 ...
  .. ..$ Internet_traffic_activity: num [1:4656696] 77 60.3 81.8 76.7 95.9
...
  .. ..$ Square_id                : chr [1:4656696] "38" "39" "40" "154" ...
  ..@ sp     :Formal class 'SpatialPolygons' [package "sp"] with 4 slots
  .. .. ..@ polygons   :List of 6259
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 10.9 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 10.9 10.9 10.9 10.9
10.9 ...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 10.9 45.7
  .. .. .. .. .. ..@ ID       : chr "1"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 10.9 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 10.9 10.9 10.9 10.9
10.9 ...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 10.9 45.7
  .. .. .. .. .. ..@ ID       : chr "2"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 10.9 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 10.9 11 11 10.9 10.9
...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 10.9 45.7
  .. .. .. .. .. ..@ ID       : chr "3"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 10.9 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 10.9 10.9 10.9 10.9
10.9 ...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 10.9 45.7
  .. .. .. .. .. ..@ ID       : chr "4"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 10.9 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 10.9 10.9 10.9 10.9
10.9 ...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 10.9 45.7
  .. .. .. .. .. ..@ ID       : chr "5"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 10.9 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 10.9 10.9 10.9 10.9
10.9 ...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 10.9 45.7
  .. .. .. .. .. ..@ ID       : chr "6"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 10.9 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 10.9 11 11 10.9 10.9
...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 10.9 45.7
  .. .. .. .. .. ..@ ID       : chr "7"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 11 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 11 11 11 11 11 ...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 11 45.7
  .. .. .. .. .. ..@ ID       : chr "8"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 11 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 11 11 11 11 11 ...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 11 45.7
  .. .. .. .. .. ..@ ID       : chr "9"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. .. .. ..@ Polygons :List of 1
  .. .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. .. .. ..@ labpt  : num [1:2] 11 45.7
  .. .. .. .. .. .. .. .. ..@ area   : num 0.000116
  .. .. .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 11 11 11 11 11 ...
  .. .. .. .. .. ..@ plotOrder: int 1
  .. .. .. .. .. ..@ labpt    : num [1:2] 11 45.7
  .. .. .. .. .. ..@ ID       : chr "10"
  .. .. .. .. .. ..@ area     : num 0.000116
  .. .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
.................................................................................................

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list