Opened 14 years ago

Closed 14 years ago

#3334 closed defect (invalid)

DXF creation failed.

Reported by: lucien Owned by: warmerdam
Priority: normal Milestone: 1.7.0
Component: OGR_SF Version: svn-trunk
Severity: major Keywords: DXF CreateDataSource
Cc:

Description

Trying to convert a shapefile to a DXF using the following command on Windows: ogr2ogr.exe -f "DXF" fluss_poly_combioula2.dxf fluss_poly_combioula.shp won’t work. It log the following message :

  • ERROR 4: Failed to open template header file ' ' for reading.
  • ERROR 4: Failed to open template trailer file ' ' for reading.
  • DXF driver failed to create fluss_poly_combioula2.dxf

In my code NULL is returned when calling the CreateDataSource function:

m_DataSource = pDriver->CreateDataSource(myHomeMadePath, NULL);

The strange part is that similar code is perfectly working on Mac. It seems that OGR isn’t able to found header.dxf and footer.dxf although they are both in the DATA folder.

I’m using the latest trunk (18570) either on Mac and Windows.

Change History (1)

comment:1 by warmerdam, 14 years ago

Resolution: invalid
Status: newclosed

Hmm, I'm not thrilled with how the error is reported so I've made some changes in trunk (r18578). The report should now be more like:

ERROR 4: Failed to find template header file header.dxf for reading,
is GDAL_DATA set properly?
DXF driver failed to create out.dxf

But I believe your problem is that the GDAL data directory is not being found. On windows there is essentially no regular install location so you pretty much have to set the GDAL_DATA environment variable to tell GDAL where to find it's data files.

eg.

set GDAL_DATA=C:\gdal\data

If you are convinced you have GDAL_DATA set properly and the issue is deeper feel free to reopen the ticket.

Note: See TracTickets for help on using tickets.