#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@… |
Description
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)
Change History (7)
by , 10 years ago
comment:2 by , 6 years ago
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: https://www.autodesk.com/techpubs/autocad/acadr14/dxf/attdef_al_u05_c.htm
DXF issue