QA for OSM:

* add license (GPL v3)
* add separate html header file
This commit is contained in:
lars 2009-05-24 22:44:32 +00:00
parent 264680d67a
commit ae1e2b93e5
2 changed files with 51 additions and 3 deletions

View file

@ -1,19 +1,45 @@
#!/bin/sh #!/bin/sh
#
# Add a calculation of "inhabitants per node" to Gary68's quality evaluation
# data.
# See http://wiki.openstreetmap.org/wiki/Mapping_Quality
#
# Copyright 2009 Lars Kruse
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3 dated June, 2007.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# original data # original data
QUALITY_URL="http://www.gary68.de/osm/qa/unmapped/mecklenburg-vorpommern.htm" QUALITY_URL="http://www.gary68.de/osm/qa/unmapped/mecklenburg-vorpommern.htm"
# where to get the number of inhabitants # where to get the number of inhabitants
WIKIPEDIA_URL="http://de.wikipedia.org/wiki" WIKIPEDIA_URL="http://de.wikipedia.org/wiki"
PLACE_TYPE="(town|city)" PLACE_TYPE="(town|city)"
# include this header file before the content
HEADER_TEMPLATE_FILE=mv_sparsely_mapped_towns_header.template
# some wikipedia pages have different names # some wikipedia pages have different names
# remove ALL non-letters (7-bit) characters from the _first_ column # remove ALL non-letters (7-bit) characters from the _first_ column
PLACE_NAME_MAPPING="Feldberg Feldberger_Seenlandschaft PLACE_NAME_MAPPING="Feldberg Feldberger_Seenlandschaft
BoizenburgElbe Boizenburg BoizenburgElbe Boizenburg
Dmitz D%C3%B6mitz
Friedland Friedland_(Mecklenburg)
FrstenbergHavel F%C3%BCrstenberg/Havel FrstenbergHavel F%C3%BCrstenberg/Havel
Goldberg Goldberg_(Mecklenburg) Goldberg Goldberg_(Mecklenburg)
Malchow Malchow_(Mecklenburg) Malchow Malchow_(Mecklenburg)
OstseebadRerik Rerik OstseebadRerik Rerik
RbelMritz Röbel RbelMritz R%C3%B6bel
Schnberg Sch%C3%B6nberg_(Mecklenburg)
Strasburg Strasburg_(Uckermark) Strasburg Strasburg_(Uckermark)
Tessin Tessin_(bei_Rostock) Tessin Tessin_(bei_Rostock)
Wesenberg Wesenberg_(Mecklenburg) Wesenberg Wesenberg_(Mecklenburg)
@ -21,17 +47,17 @@ Zarrentin Amt_Zarrentin"
get_place_data() { get_place_data() {
echo '<html><body><table border="1">'
wget --quiet --output-document - "$QUALITY_URL" \ wget --quiet --output-document - "$QUALITY_URL" \
| sed -n "1,/Details all information/p" \ | sed -n "1,/Details all information/p" \
| grep -E -A 4 -B 2 "^<td>$PLACE_TYPE</td>$" \ | grep -E -A 4 -B 2 "^<td>$PLACE_TYPE</td>$" \
| grep -v "^--$" | grep -v "^--$"
echo '</table></body></html>'
} }
get_place_size() { get_place_size() {
# call "zcat -f" to uncompress a page if necessary
wget --quiet --output-document - "$WIKIPEDIA_URL/$1" \ wget --quiet --output-document - "$WIKIPEDIA_URL/$1" \
| zcat -f \
| grep -A 1 "^<td>Einwohner:</td>$" \ | grep -A 1 "^<td>Einwohner:</td>$" \
| tail -1 | cut -d ">" -f 2 | cut -d "<" -f 1 \ | tail -1 | cut -d ">" -f 2 | cut -d "<" -f 1 \
| sed s/[^0-9]//g | sed s/[^0-9]//g
@ -73,5 +99,9 @@ get_place_inhabitants() {
# we need the default locales - otherwise 'sed' will not filter umlauts # we need the default locales - otherwise 'sed' will not filter umlauts
export LANG= export LANG=
sed "s/__DATE__/$(date +%d.%m.%Y)/" "$HEADER_TEMPLATE_FILE"
echo '<table border="1">'
echo '<tr><th>Ort</th><th>Kategory</th><th></th><th>Qualit&auml;t</th><th>Anzahl der Nodes</th><th>Einwohner</th><th>Einwohner pro Node</th></tr>'
get_place_data | get_place_inhabitants get_place_data | get_place_inhabitants
echo '</table></body></html>'

View file

@ -0,0 +1,18 @@
<html>
<head>
<title>Geringf&uuml;gig erfasste Orte in MV</title>
</head>
<body>
<h2>Geringf&uuml;gig erfasste Orte in Mecklenburg-Vorpommern</h2>
<p>Die folgenden Daten basieren auf der <a href="http://wiki.openstreetmap.org/wiki/Mapping_Quality">Qualit&auml;tsanalyse von Gary68</a> und auf den Einwohnerzahlen aus der <a href="http://wikipedia.org">Wikipedia</a>.</p>
<p>Je kleiner der Wert f&uuml;r <i>Einwohner pro Node</i> ist, desto besser ist der jeweilige Ort erfasst.</p>
<p>Die Ergebnisse sind &auml;u&szlig;erst grob - bitte lass dich nicht von den scheinbar exakten Zahlen t&auml;uschen ...</p>
<p>Aktualisierungsdatum: __DATE__</p>
<p>Den Code zum Generieren dieser &Uuml;bersicht findest du in meinem <a href="https://svn.systemausfall.org/svn/codekasten/osm/qa/sparsely_mapped">Subversion-Repository</a>.</p>