Opened 14 years ago
Closed 14 years ago
#3372 closed defect (fixed)
dxf does not support OCS
Reported by: | pooyapm | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.7.1 |
Component: | OGR_SF | Version: | 1.7.0 |
Severity: | normal | Keywords: | dxf |
Cc: |
Description
Many objects in DXF file use OCS (Object Coordinate Systems) instead of WCS (World coordinate Systems). For example, "LWPOLYLINE" uses OCS for it's vertices. OCS should be converted to WCS when an OGRGeometry is creating. OCS definition is documented in DXF reference. The attached file contains the necessary code for converting OCS to WCS conversion and edited OGRDXFLayer::TranslateLWPOLYLINE() function using this conversion.
Attachments (3)
Change History (10)
by , 14 years ago
Attachment: | DXF-OCS.cpp added |
---|
comment:1 by , 14 years ago
Milestone: | 1.7.1 |
---|---|
Priority: | high → normal |
Status: | new → assigned |
follow-up: 3 comment:2 by , 14 years ago
Component: | default → OGR_SF |
---|
by , 14 years ago
Attachment: | LWPOLYLINE-OCS.dxf added |
---|
comment:3 by , 14 years ago
Replying to warmerdam: The attached file "LWPOLYLINE-OCS.dxf" contains 6 3DPOLYLINEs (in WCS) and 6 LWPOLYLINEs (in OCS). If you open DXF file using a text editor, you can see negative coordinates for some LWPOLYLINEs, but if open it using AutoCad, all coordinates are positive (The file is part of a real map with UTM projection).
comment:4 by , 14 years ago
Milestone: | → 1.7.1 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
I have substantially reworked the patch and it is applied in trunk (r18752) and 1.7 (r18754).
I would appreciate it if you could test the result to see if it is correct.
It should now be possible to add OCS handling to other element types as appropriate just by calling ApplyOCSTransformer() on the geometry; however, I prefer not to do this without test files.
comment:5 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Attached a patch that fixes use of wrong index in CrossProduct() (and also remove unused member variables) that likely explains the failure on epimetheus slavebot. ogr_dxf_9 should be updated accordingly.
comment:7 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Could you provide a file demonstrating LWPOLYLINEs using OCS?