comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: write array 2 *.shp file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: write array 2 *.shp file [message #61693 is a reply to message #61692] Mon, 28 July 2008 06:37 Go to previous messageGo to previous message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On 28 Jul., 06:13, David Fanning <n...@dfanning.com> wrote:
> d.po...@gmail.com writes:
>> I have some lat long data (UTM) and I want to write them to *.shp
>> file .
>> Help shows that how we can do this for 1 point but I want to write N
>> entities to that shape file (put an array to shape file). I put one
>> loop but no result  (I cant open it again) .
>
> I've always used the method outlined in the IDL help in a
> loop without problems. There must be something else wrong
> here.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

David
Here is my code but I have got just one point in the attribute table:
........
.........
mynewshape=OBJ_NEW('IDLffShape',file,/UPDATE, ENTITY_TYPE=1)

mynewshape->AddAttribute, 'lat', 7, 25, $
PRECISION=0
mynewshape->AddAttribute, 'lon', 7, 25, $
PRECISION=0

entNew ={IDL_SHAPE_ENTITY}
for J=0,N-1 do begin
entNew.SHAPE_TYPE = 1
entNew.ISHAPE = fix(randomu(10)*10000)
entNew.BOUNDS[0]=(A[0,j])
entNew.BOUNDS[1]=( A [1,j])
entNew.BOUNDS[2]=0.00000000
entNew.BOUNDS[3]=0.00000000
entNew.BOUNDS[4]=( A [0,j])
entNew.BOUNDS[5]=( A [1,j])
entNew.BOUNDS[6]=0.00000000
entNew.BOUNDS[7]=0.00000000
entNew.N_VERTICES = 1
endfor

attrNew = mynewshape ->GetAttributes(/ATTRIBUTE_STRUCTURE)

mynewshape -> PutEntity,entNew
mynewshape -> SetAttributes, 0, attrNew

OBJ_DESTROY, mynewshape

Cheers
Dave
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Finding the Top Two Most Common Coordinates in a Multi-Dimensional Array
Next Topic: Software Package Free! ... about our Free Software

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 07:51:48 PDT 2025

Total time taken to generate the page: 2.07675 seconds