Intermediate step while trying to clean CORINE data ....
This commit is contained in:
parent
94f0291400
commit
0346a8cb8f
4 changed files with 14 additions and 10 deletions
|
@ -44,7 +44,8 @@ case ${MODE} in
|
|||
shp)
|
||||
# Local, pre-intersected Shapefiles
|
||||
DSN=${HOME}/live/corine
|
||||
PREFIX=nl_
|
||||
# PREFIX=nl_
|
||||
PREFIX=clc00_
|
||||
SELECTION=${DSN}/${PREFIX}c[0-9][0-9][0-9].shp
|
||||
SNAP=1
|
||||
SPAT=""
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
# $MODE-values for the "case" clause, like 'grass03patch.sh_shp'
|
||||
MODE=`basename ${0} | cut -f 2 -d \_`
|
||||
#
|
||||
PATCHMAP=clc00_nl
|
||||
#PATCHMAP=clc00_nl
|
||||
PATCHMAP=clc00
|
||||
|
||||
case ${MODE} in
|
||||
shp)
|
||||
|
|
|
@ -26,7 +26,8 @@ COMMAND=`basename ${0} | cut -f 1 -d \_`
|
|||
MODE=`basename ${0} | cut -f 2 -d \_`
|
||||
RUN=`basename ${0} | cut -f 3 -d \_`
|
||||
|
||||
PATCHMAP=clc00_nl
|
||||
#PATCHMAP=clc00_nl
|
||||
PATCHMAP=clc00
|
||||
|
||||
case ${MODE} in
|
||||
shp)
|
||||
|
@ -42,13 +43,14 @@ MIN_AREA=10
|
|||
case ${RUN} in
|
||||
first)
|
||||
v.clean input=${PATCHMAP} output=${PATCHMAP}_clean tool=snap,bpol,rmdupl,rmline,break,rmdupl,rmdangle,rmarea thresh=${SNAP},0,0,0,0,0,0,${MIN_AREA} type=boundary --verbose
|
||||
v.dissolve input=${PATCHMAP}_clean output=${PATCHMAP}_dissolved
|
||||
;;
|
||||
second)
|
||||
v.clean input=${PATCHMAP}_clean output=${PATCHMAP}_clobber tool=break,rmdupl,rmdangle type=boundary --verbose
|
||||
v.clean input=${PATCHMAP}_dissolved output=${PATCHMAP}_clobber tool=break,rmdupl,rmdangle type=boundary --verbose
|
||||
;;
|
||||
loop)
|
||||
g.remove vect=${PATCHMAP}_clean
|
||||
g.rename vect=${PATCHMAP}_clobber,${PATCHMAP}_clean
|
||||
g.remove vect=${PATCHMAP}_dissolved
|
||||
g.rename vect=${PATCHMAP}_clobber,${PATCHMAP}_dissolved
|
||||
${COMMAND}_${MODE}_second
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -31,8 +31,9 @@ cd ${RUNDIR}
|
|||
#
|
||||
|
||||
MAPPINGFILE=${BASEDIR}/CORINEtoCStest.txt
|
||||
CLEANMAP=clc00_nl_clobber
|
||||
EXTRACTPREFIX=clc00_nl_
|
||||
#EXTRACTPREFIX=clc00_nl_
|
||||
EXTRACTPREFIX=clc00_
|
||||
CLEANMAP=${EXTRACTPREFIX}clobber
|
||||
|
||||
case ${MODE} in
|
||||
shp)
|
||||
|
@ -49,8 +50,7 @@ SELECTION=`v.category input=${CLEANMAP} type=centroid option=print | sort -n | u
|
|||
for CATEGORY in ${SELECTION}; do
|
||||
LAYER=`grep \^${CATEGORY} ${MAPPINGFILE} | awk '{print $2}' | sed -e "s/^cs_/${EXTRACTPREFIX}/g"`
|
||||
v.extract list=${CATEGORY} input=${CLEANMAP} output=${EXTRACTPREFIX}${CATEGORY} type=area
|
||||
v.dissolve input=${EXTRACTPREFIX}${CATEGORY} output=${EXTRACTPREFIX}${CATEGORY}_dissolved
|
||||
v.out.ogr input=${EXTRACTPREFIX}${CATEGORY}_dissolved dsn=${DUMPDIR}/${LAYER}.shp
|
||||
v.out.ogr input=${EXTRACTPREFIX}${CATEGORY} dsn=${DUMPDIR}/${LAYER}.shp
|
||||
done
|
||||
|
||||
# EOF
|
||||
|
|
Loading…
Reference in a new issue