Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7006 closed defect (fixed)

DXF: INSERT missed when it is the last entity and DXF_MERGE_BLOCK_GEOMETRIES is false

Reported by: Alan Thomas Owned by: warmerdam
Priority: normal Milestone: 2.2.2
Component: OGR_SF Version: unspecified
Severity: normal Keywords: dxf
Cc:

Description

The attached DXF file has only one entity, an INSERT. Importantly, the block being inserted contains more than one geometry. When opened with --config DXF_MERGE_BLOCK_GEOMETRIES FALSE, the file appears empty:

$ ogrinfo -sql "SELECT * FROM Entities" -geom=summary --config DXF_MERGE_BLOCK_GEOMETRIES FALSE insert-only.dxf
DXF ASCII and binary is not supported yet.Warning 4: Failed to open insert-only.dxf, No error.
Had to open data source read-only.
INFO: Open of `insert-only.dxf'
      using driver `DXF' successful.

Layer name: Entities
Geometry: Unknown (any)
Feature Count: 0
Layer SRS WKT:
(unknown)
Geometry Column = _ogr_geometry_
Layer: String (0.0)
SubClasses: String (0.0)
ExtendedEntity: String (0.0)
Linetype: String (0.0)
EntityHandle: String (0.0)
Text: String (0.0)

(by the way, what is with the bogus "ASCII and binary" warning at the top of the output?)

See attached patch for a potential fix to allow this file to be imported correctly.

Attachments (2)

insert-only.dxf (276.9 KB ) - added by Alan Thomas 7 years ago.
OGR-DXF-insert-fix.diff (872 bytes ) - added by Alan Thomas 7 years ago.
Patch

Download all attachments as: .zip

Change History (6)

by Alan Thomas, 7 years ago

Attachment: insert-only.dxf added

by Alan Thomas, 7 years ago

Attachment: OGR-DXF-insert-fix.diff added

Patch

comment:1 by Even Rouault, 7 years ago

In 39837:

CAD: do not emit warning on .dxf files (if registered before the DXF driver) (refs #7006)

comment:2 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 39839:

DXF: fix reading files where INSERT is the last entity and DXF_MERGE_BLOCK_GEOMETRIES is false (patch by atlight, test by myself, fixes #7006)

comment:3 by Even Rouault, 7 years ago

In 39840:

DXF: fix reading files where INSERT is the last entity and DXF_MERGE_BLOCK_GEOMETRIES is false (patch by atlight, test by myself, fixes #7006)

comment:4 by Even Rouault, 7 years ago

Milestone: 2.2.2
Note: See TracTickets for help on using tickets.