Skip to content
Permalink
Browse files

DXF: do not discard Z value when reading a HATCH (fixes #2349)

  • Loading branch information
rouault committed Mar 25, 2020
1 parent 198d510 commit 4b39d4093be7b17ee65eec89e4881944c2a02ad3
Showing with 24 additions and 0 deletions.
  1. +21 −0 autotest/ogr/ogr_dxf.py
  2. +3 −0 gdal/ogr/ogrsf_frmts/dxf/ogrdxf_hatch.cpp
@@ -3624,6 +3624,27 @@ def test_ogr_dxf_very_close_neg_to_zero_knot():
assert extent == pytest.approx((163.0306017054786, 166.6530957511469,
78.40469559017359, 81.82569418640966), abs=1e-5)

###############################################################################


def test_ogr_dxf_polygon_3D():


tmpfile = '/vsimem/test_ogr_dxf_polygon_3D.dxf'
ds = ogr.GetDriverByName('DXF').CreateDataSource(tmpfile)
lyr = ds.CreateLayer('test')
f = ogr.Feature(lyr.GetLayerDefn())
g = ogr.CreateGeometryFromWkt('POLYGON((0 0 10,0 1 10,1 1 10,0 0 10))')
f.SetGeometry(g)
lyr.CreateFeature(f)
ds = None
ds = ogr.Open(tmpfile)
lyr = ds.GetLayer(0)
f = lyr.GetNextFeature()
got_g = f.GetGeometryRef()
assert got_g.Equals(g)
gdal.Unlink(tmpfile)


###############################################################################
# cleanup
@@ -592,6 +592,9 @@ OGRErr OGRDXFLayer::CollectPolylinePath( OGRGeometryCollection *poGC,
int nVertexCount = -1;
bool bHaveBulges = false;

if( dfElevation != 0 )
oSmoothPolyline.setCoordinateDimension(3);

/* -------------------------------------------------------------------- */
/* Read the boundary path type. */
/* -------------------------------------------------------------------- */

0 comments on commit 4b39d40

Please sign in to comment.
You can’t perform that action at this time.