source: subversion/applications/editors/osmpedit/uploadwaypoints @ 30941

Last change on this file since 30941 was 735, checked in by tpersson, 14 years ago

Initial commit of osmpedit

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/usr/bin/env perl
2
3#    Copyright (C) 2005 Tommy Persson, tpe@ida.liu.se
4#
5#    This program is free software; you can redistribute it and/or modify
6#    it under the terms of the GNU General Public License as published by
7#    the Free Software Foundation; either version 2 of the License, or
8#    (at your option) any later version.
9#
10#    This program is distributed in the hope that it will be useful,
11#    but WITHOUT ANY WARRANTY; without even the implied warranty of
12#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#    GNU General Public License for more details.
14#
15#    You should have received a copy of the GNU General Public License
16#    along with this program; if not, write to the Free Software
17#    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
18
19use strict;
20
21use osmnode;
22
23use vars qw ($opt_lat $opt_lon $opt_passwd $opt_user $opt_creator);
24use Getopt::Mixed;
25Getopt::Mixed::getOptions("lat=s lon=s passwd=s user=s creator=s");
26
27if (not defined $opt_creator) {
28    print "--creator must be specifies\n";
29    exit 0;
30}
31
32
33
34foreach my $file (@ARGV) {
35    print STDERR "NAME: $file\n";
36    my $node = new osmnode;
37    $node->parse_waypoint ($file, "buss stop", $opt_creator);
38    $node->print ();
39    my $uid = $node->upload_osm_node ($opt_user, $opt_passwd);
40    if ($uid) {
41        my $data = osmutil::get_node ($uid, $opt_user, $opt_passwd);
42        print STDERR "$data\n";
43    } else {
44        print "WARNING: UPLOAD FAILED\n";
45    }
46}
47
Note: See TracBrowser for help on using the repository browser.