scripts: Fix geotype for bodies of water
This commit is contained in:
parent
7a52d5bb59
commit
215e607cb7
@ -16,12 +16,30 @@ for entry in $data; do
|
||||
continue
|
||||
fi
|
||||
|
||||
case "$section" in
|
||||
"Rivers")
|
||||
name=`echo "$entry" | sed -n 's/\s*\([^|]\+\).*/\1/p' | sed 's/ $//'`
|
||||
type=`echo "$entry" | sed -n 's/\s*\([^|]\+\)||\s*\([^|]\+\).*/\2/p' | sed 's/ $//'`
|
||||
coord=`echo "$entry" | sed -n 's/.*||\s*\([^|]\+\).*/\1/p'`
|
||||
if [[ "$type" == "district" ]]; then
|
||||
continue;
|
||||
if [[ "$name" != "" && "$coord" != "" ]]; then
|
||||
echo "{ \"type\": \"Feature\",
|
||||
\"geometry\": {
|
||||
\"type\": \"LineString\",
|
||||
\"coordinates\": [
|
||||
$coord
|
||||
]
|
||||
},
|
||||
\"properties\": {
|
||||
\"name\": \"$name\",
|
||||
\"type\": \"$type\"
|
||||
}
|
||||
},"
|
||||
fi
|
||||
;;
|
||||
"Oceans, Seas, and Lakes")
|
||||
name=`echo "$entry" | sed -n 's/\s*\([^|]\+\).*/\1/p' | sed 's/ $//'`
|
||||
type=`echo "$entry" | sed -n 's/\s*\([^|]\+\)||\s*\([^|]\+\).*/\2/p' | sed 's/ $//'`
|
||||
coord=`echo "$entry" | sed -n 's/.*||\s*\([^|]\+\).*/\1/p'`
|
||||
if [[ "$name" != "" && "$coord" != "" ]]; then
|
||||
echo "{ \"type\": \"Feature\",
|
||||
\"geometry\": {
|
||||
@ -34,8 +52,10 @@ for entry in $data; do
|
||||
\"name\": \"$name\",
|
||||
\"type\": \"$type\"
|
||||
}
|
||||
},"
|
||||
},"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
export IFS=" "
|
||||
echo "{}"
|
||||
|
Loading…
Reference in New Issue
Block a user