Hi, I have the same problem,
I try to create a Shapefile with an PolylineZ and I can create the minimum and the maximum boundarys but without anything inside. Have you found an answer for your Problem?
PRO test_1, x,y,z
;Create the new shapefile and define the entity type to Point
;mynewshape=OBJ_NEW('IDLffShape', FILEPATH('Staedte.shp', SUBDIR=['examples', 'data']), /UPDATE, ENTITY_TYPE=18)
mynewshape=OBJ_NEW('IDLffShape',("D:\mars\idl_out\mola_4.shp"), /UPDATE, ENTITY_TYPE=1)
;Set the attribute definitions for the new Shapefile
mynewshape->IDLffShape::AddAttribute, 'test_1', 7, 25, PRECISION=0
mynewshape->IDLffShape::AddAttribute, 'test_2', 7, 25, PRECISION=0
mynewshape->IDLffShape::AddAttribute, 'test_3', 7, 25, PRECISION=0
;Create structure for new entity
entNew = {IDL_SHAPE_ENTITY}
; Define the values for the new entity
entNew.SHAPE_TYPE = 18
entNew.BOUNDS[0] = min(x)
entNew.BOUNDS[1] = min(y)
entNew.BOUNDS[2] = min(z)
entNew.BOUNDS[3] = 0.00000000
entNew.BOUNDS[4] = max(x)
entNew.BOUNDS[5] = max(y)
entNew.BOUNDS[6] = max(z)
entNew.BOUNDS[7] = 0.00000000
entNew.n_vertices=0 ;idl_long?
a=double(transpose([[x],[y],[z]]))
ptr=ptr_new(a)
entNew.vertices=ptr
;Create structure for new attributes
attrNew = mynewshape->IDLffShape::GetAttributes(/ATTRIBUTE_STRUCTURE)
;Define the values for the new attributes
attrNew.ATTRIBUTE_0 = 'blah_1'
attrNew.ATTRIBUTE_1 = 'blah_2'
attrNew.ATTRIBUTE_2 = 'blah_3'
;Add the new entity to new shapefile
mynewshape->IDLffShape::PutEntity, entNew
;Add the Colorado attributes to new shapefile
mynewshape->IDLffShape::SetAttributes, 0, attrNew
;Close the shapefilee
OBJ_DESTROY, mynewshape
END
Thanks for your help
Peter
|