From 2fd72f43f97c8cac4d45fe19276a2a2310b16d7c Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Sat, 14 May 2005 18:13:14 +0000 Subject: [PATCH] Start on tool to maintain pcode database. --- gis/openstreetmap/pcode-location-update | 76 +++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100755 gis/openstreetmap/pcode-location-update diff --git a/gis/openstreetmap/pcode-location-update b/gis/openstreetmap/pcode-location-update new file mode 100755 index 0000000000..d260301f46 --- /dev/null +++ b/gis/openstreetmap/pcode-location-update @@ -0,0 +1,76 @@ +#!/usr/bin/perl +# +# Create postgis database from the postal code +# +# Author: Petter Reinholdtsen +# Date: 2005-05-14 +# Lisence: GNU Public Lisence + +my $dbtable = "postal_codes"; + +sub create_table { + + $sql = <) { + chomp; + s/#.*//; + next if /^\s*$/; + my ($postal_code, $lat, $lon) = split; + print insert_location($postal_code, $lat, $lon); + } + close(FILE); +} + +sub save_sql_table { + print < +# Date: 2005-02-13 +# +# Updates and corrections are most welcome. The accurasy is unknown, +# as the positions are based on a random set of addresses with the +# given zip code. +# +# zip latitude longitude +EOF + d + +} + + +print drop_table(); +load_sql_table(); -- 2.47.2