Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mixed topology files - example GPKG #26

Closed
mdsumner opened this issue Oct 5, 2016 · 2 comments
Closed

mixed topology files - example GPKG #26

mdsumner opened this issue Oct 5, 2016 · 2 comments

Comments

@mdsumner
Copy link
Member

mdsumner commented Oct 5, 2016

I was putting together a GPKG with areas, lines, and points but got sidelined by Manifold's export of closed lines - it seems they are written and/or interpreted as polygons, so I have to do some more to make this useable in sf.

Still, it's an example GPKG file.
us_counties_states.zip

library(USAboundaries)
library(sf)

## warns but still works 
# Warning message:
#   In CPL_write_ogr(obj, dsn, layer, driver, as.character(options),  :
#                      GDAL Message 6: dataset us_counties.mif does not support layer creation option FORMAT

st_write(st_as_sf(us_counties()), "us_counties.mif", "us_counties", driver = "MapInfo File", options = "FORMAT=MIF")

## read into Manifold and add lines and points
## EDIT: no Manifold export writes MULTIPOLYGON here 
## dissolve counties by state, add boundaries of the states
## add inner centroids of the states
## points only get state attributes copied
## export to MIF

cs <- st_read("Us_counties_states.mif", "Us_counties_states")
st_write(cs, "us_counties_states.gpkg", "us_counties_states", "GPKG")


cs <- st_read("Us_counties_states.gpkg", "Us_counties_states")
## plotting these the counties-polys and state-points get covered by the state-polys, which is
## not what was intended
@edzer
Copy link
Member

edzer commented Oct 5, 2016

FORMAT=MIF is a dataset creation option, but st_write now only knows about layer creation options, this was already on my TODO list. Otherwise, this issue is a way of saying "cool, I can create GPKG", right?

@mdsumner
Copy link
Member Author

mdsumner commented Oct 5, 2016

Yep, was meant to be better but not yet finished so for now it's just a back slap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants