kadyb / rgugik

Download datasets from Polish Head Office of Geodesy and Cartography
https://kadyb.github.io/rgugik/
Other
33 stars 4 forks source link

add new fun "borders_get" #47

Closed kadyb closed 4 years ago

kadyb commented 4 years ago

@Nowosad How can I add geometries to the empty list? Currently, it doesn't work.

str(geom)
sfc_POLYGON of length 1; first list element: List of 1
 $ : num [1:120, 1:2] 541417 541478 541490 541521 541707 ...
 - attr(*, "class")= chr [1:3] "XY" "POLYGON" "sfg"

str(geom_stack)
List of 2
 $ :List of 1
  ..$ : num [1:198, 1:2] 482651 482720 482926 486738 488083 ...
  ..- attr(*, "class")= chr [1:3] "XY" "POLYGON" "sfg"
 $ :List of 1
  ..$ : num [1:120, 1:2] 541417 541478 541490 541521 541707 ...
  ..- attr(*, "class")= chr [1:3] "XY" "POLYGON" "sfg"

df_geom = sf::st_sf(geom_stack)
Error in sf::st_sf(geom_stack) : 
  no simple features geometry column present

It is related to 75-76 and 88-89 lines.

kadyb commented 4 years ago

Now we initialize an empty list as: geometry = st_sfc(st_polygon(), crs = 2180) It works but now we have to remove first empty geometry from data frame.

Nowosad commented 4 years ago

@kadyb is there any issues left or can I just ignore your previous question?

kadyb commented 4 years ago

It works, but maybe there is a better way to do it. We can leave it as is.