libsim  Versione7.2.6

◆ arrayof_georef_coord_array_remove()

subroutine arrayof_georef_coord_array_remove ( type(arrayof_georef_coord_array this,
integer, intent(in), optional  nelem,
integer, intent(in), optional  pos,
logical, intent(in), optional  nodestroy 
)

Method for removing elements of the array at a desired position.

If necessary, the array is reallocated to reduce space.

Parametri
thisarray object in which an element has to be removed
[in]nelemnumber of elements to remove, if not provided, a single element is removed
[in]posposition of the element to be removed, if it is out of range, it is clipped, if it is not provided, objects are removed at the end
[in]posif provided and .TRUE. , the destructor possibily defined for the TYPE(georef_coord_array) is not called for every deleted object, may be useful if the objects to be deleted have been copied to another instance of arrayof_georef_coord_array and continue their life there

Definizione alla linea 548 del file georef_coord_class.F90.

548 INTEGER,INTENT(IN) :: nshp ! index of shape to write starting from 0, -1 to append
549 
550 INTEGER :: i
551 TYPE(shpobject) :: shpobj
552 
553 IF (ALLOCATED(this%coord)) THEN
554  IF (ALLOCATED(this%parts)) THEN
555  shpobj = shpcreateobject(this%topo, -1, SIZE(this%parts), this%parts, &
556  this%parts, SIZE(this%coord), this%coord(:)%x, this%coord(:)%y)
557  ELSE
558  shpobj = shpcreatesimpleobject(this%topo, SIZE(this%coord), &
559  this%coord(:)%x, this%coord(:)%y)
560  ENDIF
561 ELSE
562  RETURN
563 ENDIF
564 
565 IF (.NOT.shpisnull(shpobj)) THEN
566  i = shpwriteobject(shphandle, nshp, shpobj)
567  CALL shpdestroyobject(shpobj)
568 ENDIF
569 
570 END SUBROUTINE georef_coord_array_export
571 
572 
583 SUBROUTINE arrayof_georef_coord_array_import(this, shpfile)
584 TYPE(arrayof_georef_coord_array),INTENT(out) :: this
585 CHARACTER(len=*),INTENT(in) :: shpfile
586 
587 REAL(kind=fp_d) :: minb(4), maxb(4)
588 INTEGER :: i, ns, shptype, dbfnf, dbfnr
589 TYPE(shpfileobject) :: shphandle
590 
591 shphandle = shpopen(trim(shpfile), 'rb')
592 IF (shpfileisnull(shphandle)) THEN
593  ! log here
594  CALL raise_error()
595  RETURN
596 ENDIF
597 
598 ! get info about file
599 CALL shpgetinfo(shphandle, ns, shptype, minb, maxb, dbfnf, dbfnr)

Generated with Doxygen.