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

Guidance Needed: How to Close DXF File #16

Open
catalinpetrisor-simplica opened this issue Jan 9, 2023 · 0 comments
Open

Guidance Needed: How to Close DXF File #16

catalinpetrisor-simplica opened this issue Jan 9, 2023 · 0 comments

Comments

@catalinpetrisor-simplica

Hi,

I am in process of finalising a piece of code in Ruby to convert geometries to DXF. While I was able to code the conversion logic, I am unable to close the DXF file. I tried driver.delete_data_source but does not work. There are no methods like close, destroy, flush on classes Gdal::Ogr::DataSource or Gdal::Ogr::Driver.

Can you please guide me what methods I should call for the final DXF to be flushed and closed?

Thank you.

Below is the basic code:

Create a new DXF driver

driver = Gdal::Ogr.get_driver_by_name("DXF")

Create a new DXF file

dxf_file = driver.create_data_source("my_file.dxf")

create layer and process geometries

Create a new layer in the DXF file

layer_dxf = dxf_file.create_layer("my_layer" ...

process geometries and added them to DXF

layer_dxf.sync_to_disk

TODO close the file

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

1 participant