my code is :
fp=....\continent.shp'
shapeFile=OBJ_NEW('IDLffShape',fp)
shapeFile->GetProperty,N_ENTITIES=nEntities
COLOR=[255,255,0]
FOR i=0,nEntities-1 DO BEGIN
entitie=shapeFile->Getentity(i)
IF PTR_VALID(entitie.parts) NE 0 THEN BEGIN
cuts=[*entitie.parts,entitie.n_vertices]
FOR j=0,entitie.n_parts-1 DO BEGIN
tempLon=(*entitie.vertices)[0,cuts[j]:cuts[j+1]-1]*!dtor
tempLat=(*entitie.vertices)[1,cuts[j]:cuts[j+1]-1]*!dtor
IF N_ELEMENTS(tempLat) GT 1 THEN BEGIN
verts=FLTARR(3,N_ELEMENTS(tempLat))
verts[0,*]=COS(templat)*COS(tempLon)
verts[1,*]=COS(tempLat)*SIN(tempLon)
verts[2,*]=SIN(tempLat)
tempPlot=OBJ_NEW('IDLgrPolygon',verts,POLYGON=polygon_list,COLOR=color,STYLE=1)
oModel->Add,tempPlot
ENDIF
ENDFOR
ENDIF
shapeFile->Destroyentity,entitie
ENDFOR
OBJ_DESTROY,shapeFile
|