libsim Versione 7.2.6
|
◆ arrayof_georef_coord_array_remove()
Method for removing elements of the array at a desired position. If necessary, the array is reallocated to reduce space.
Definizione alla linea 533 del file georef_coord_class.F90. 538ENDIF
539
540
541END SUBROUTINE georef_coord_array_import
542
543
544! internal method for exporting a single shape
545SUBROUTINE georef_coord_array_export(this, shphandle, nshp)
546TYPE(georef_coord_array),INTENT(in) :: this
547TYPE(shpfileobject),INTENT(inout) :: shphandle
548INTEGER,INTENT(IN) :: nshp ! index of shape to write starting from 0, -1 to append
549
550INTEGER :: i
551TYPE(shpobject) :: shpobj
552
553IF (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
561ELSE
562 RETURN
563ENDIF
564
565IF (.NOT.shpisnull(shpobj)) THEN
566 i = shpwriteobject(shphandle, nshp, shpobj)
567 CALL shpdestroyobject(shpobj)
568ENDIF
569
570END SUBROUTINE georef_coord_array_export
571
572
573!> Import an array of \a georef_coord_array objects from a file
574!! in ESRI/Shapefile format. The \a this argument is an uninitialised
575!! \a arrayof_georef_coord_array, every element of which,
576!! this%array(n), is of type \a georef_coord_array and, on return,
577!! will contain information from the n-th shape of the file. Topology
578!! information and possible polygon parts are imported as well, while
579!! no projection information, even if available, is imported. An
580!! error condition while opening the file can be detected by checking
581!! .NOT.ASSOCIATED(this%array), while an error reading shape \a n can
582!! be detected by checking .NOT.c_e(this%array(n)).
583SUBROUTINE arrayof_georef_coord_array_import(this, shpfile)
584TYPE(arrayof_georef_coord_array),INTENT(out) :: this !< uninitialised array object
585CHARACTER(len=*),INTENT(in) :: shpfile !< name of shapefile (with or without extension)
586
587REAL(kind=fp_d) :: minb(4), maxb(4)
588INTEGER :: i, ns, shptype, dbfnf, dbfnr
589TYPE(shpfileobject) :: shphandle
|