Opened 4 years ago

Closed 6 months ago

Last modified 4 months ago

#5592 closed defect (fixed)

Reading DXF with AcDbBlockReference entity is offsetting points coordinates

Reported by: ngarel Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords: DXF
Cc: ngarel@…


In the file attach, all the coordinates are offset from the first point of the string. This also happens in Quantum GIS, but not DWG true view.

For instance, if the first point in a string is at X = 20633.0213, the location of the point would be at 41266.0426 (20633.0213 + 20633.0213). If the second point is at X = 21068.8577, the location of the point would be at 41701.879 (21068.8577 + 20633.0213). And so on.

The problem is happening in OGRDWGLayer::TranslateINSERT( OdDbEntityPtr? poEntity ) where a GeometryInsertTransformer? is created and transofrmation is applied.

I do not understand the reason for this transformation.

Attachments (1)

test.DXF (3.9 KB) - added by ngarel 4 years ago.
DXF issue

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by ngarel

Attachment: test.DXF added

DXF issue

comment:1 Changed 3 years ago by Even Rouault

Milestone: 2.0

Removing obsolete milestone

comment:2 Changed 7 months ago by Alan Thomas

Opening the file in AutoCAD, I see two yellow rectangles, one inside the other (they are actually both INSERTs). According to the Properties pane, the inner rectangle is inserted at WCS (20661.4165, 10945.8265, 1018.3012) while the outer rectangle is inserted at WCS (20633.0213, 10964.5315, 1018.3012). They are about 400 units wide and 250 units tall.

In OGR, the features are indeed offset. This is because OGR ignores the origin (10/20/30) specified on the BLOCK entity in the DXF file. It seems that all the geometries should be offset by this amount when they are being read in by ogrdxf_blockmap.cpp.

I also see lots of unnecessary POINT features coming in because we don't honor the ATTDEF group code 70. If the LSB is set in this bit field, we should skip the ATTDEF:

comment:3 Changed 6 months ago by Alan Thomas

In 40712:

DXF: Correct color for ByBlock? text features; respect hidden objects (refs #5592, refs #7099, refs #7121)

comment:4 Changed 6 months ago by Alan Thomas

In 40717:

DXF: Don't require subclasses to be present to correctly detect ATTDEFs (refs #5592)

comment:5 Changed 6 months ago by Alan Thomas

Resolution: fixed
Status: newclosed

In 40826:

DXF: Honor block base points (fixes #5592)

comment:6 Changed 4 months ago by Alan Thomas

In 41231:

DXF: Also transform original coordinates on INSERT entity inside a block with a base point (refs #5592)

Note: See TracTickets for help on using tickets.