scripts: Fix geotype for bodies of water
This commit is contained in:
parent
7a52d5bb59
commit
215e607cb7
@ -16,26 +16,46 @@ for entry in $data; do
|
||||
continue
|
||||
fi
|
||||
|
||||
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;
|
||||
fi
|
||||
if [[ "$name" != "" && "$coord" != "" ]]; then
|
||||
echo "{ \"type\": \"Feature\",
|
||||
\"geometry\": {
|
||||
\"type\": \"Polygon\",
|
||||
\"coordinates\": [[
|
||||
$coord
|
||||
]]
|
||||
},
|
||||
\"properties\": {
|
||||
\"name\": \"$name\",
|
||||
\"type\": \"$type\"
|
||||
}
|
||||
},"
|
||||
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 [[ "$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\": {
|
||||
\"type\": \"Polygon\",
|
||||
\"coordinates\": [[
|
||||
$coord
|
||||
]]
|
||||
},
|
||||
\"properties\": {
|
||||
\"name\": \"$name\",
|
||||
\"type\": \"$type\"
|
||||
}
|
||||
},"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
export IFS=" "
|
||||
echo "{}"
|
||||
|
Loading…
Reference in New Issue
Block a user