|
◆ arrayof_georef_coord_array_remove()
subroutine, private georef_coord_class::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 |
|
) |
| |
|
private |
Method for removing elements of the array at a desired position.
If necessary, the array is reallocated to reduce space. - Parametri
-
| this | array object in which an element has to be removed |
[in] | nelem | number of elements to remove, if not provided, a single element is removed |
[in] | pos | position 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] | pos | if 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 543 del file georef_coord_class.F90.
548 INTEGER, INTENT(IN) :: nshp
551 TYPE(shpobject) :: shpobj
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)
558 shpobj = shpcreatesimpleobject(this%topo, SIZE(this%coord), &
559 this%coord(:)%x, this%coord(:)%y)
565 IF (.NOT.shpisnull(shpobj)) THEN
566 i = shpwriteobject(shphandle, nshp, shpobj)
567 CALL shpdestroyobject(shpobj)
570 END SUBROUTINE georef_coord_array_export
583 SUBROUTINE arrayof_georef_coord_array_import(this, shpfile)
584 TYPE(arrayof_georef_coord_array), INTENT(out) :: this
585 CHARACTER(len=*), INTENT(in) :: shpfile
587 REAL(kind=fp_d) :: minb(4), maxb(4)
588 INTEGER :: i, ns, shptype, dbfnf, dbfnr
589 TYPE(shpfileobject) :: shphandle
591 shphandle = shpopen(trim(shpfile), 'rb')
592 IF (shpfileisnull(shphandle)) THEN
599 CALL shpgetinfo(shphandle, ns, shptype, minb, maxb, dbfnf, dbfnr)
|