Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#7006 closed defect (fixed)

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

Reported by: atlight 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 atlight 2 months ago.
OGR-DXF-insert-fix.diff (872 bytes) - added by atlight 2 months ago.
Patch

Download all attachments as: .zip

Change History (6)

Changed 2 months ago by atlight

Attachment: insert-only.dxf added

Changed 2 months ago by atlight

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

Patch

comment:1 Changed 2 months ago by Even Rouault

In 39837:

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

comment:2 Changed 2 months ago by Even Rouault

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 Changed 2 months ago by Even Rouault

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 Changed 2 months ago by Even Rouault

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