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

Documentation [question] writing a table to a layer #153

Open
Nosferican opened this issue Nov 12, 2020 · 1 comment
Open

Documentation [question] writing a table to a layer #153

Nosferican opened this issue Nov 12, 2020 · 1 comment

Comments

@Nosferican
Copy link

I have a DataFrame with a column being the geometry and the rest being attributes. I am trying to export it as a geojson but I am not sure how to create a layer with the attributes for then writing the layer out as geojson.
Here is my case

data # Table with geometry and values I want to export
ArchGDAL.create(outfile), driver = ArchGDAL.getdriver("geoJSON")) do dataset
    # Not sure what goes here
end

currently I use R as way to export the data.

pacman::p_load(RPostgreSQL, sf)
conn <- dbConnect(drv = PostgreSQL())
layer <- st_read(dsn = conn, layer = c(schema = "some_schema", name = "relation"))
st_write(obj = layer, dsn = "outfile.geojson", layer = "relation", driver = "GeoJSON")
@yeesian
Copy link
Owner

yeesian commented Nov 15, 2020

We do not currently have a convenient way of doing so, other than directly creating an ArchGDAL.Dataset (c.f. #152) and writing it to file.

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

No branches or pull requests

2 participants