#!/usr/bin/perl -w
use strict ;
use OSM::osm ;
my $file ;
my $nodeUser ;
my @nodeTags ;
my $nodeTags ;
my $ref1 ;
my $line ;
my $tag;
my $nodeName;
my $id ="1" ;
my $lat ;
my $lon ;
my $name ;
my $amenity ;
my $operator ;
my $vending;
$file = "c:/osm/planet/pois.osm" ;
openOsmFile ($file) ;
open(AUSGABE, ">c:/osm/planet/mysql.txt");
($id, $lon, $lat, $nodeUser, $ref1) = getNode2 () ;
while ($id != -1 ) {
$name ="" ;
$amenity ="" ;
$operator ="" ;
$vending ="" ;
@nodeTags = @$ref1;
foreach my $tag (@nodeTags) {
if ($tag->[0] eq "name") { $name = scalar ($tag->[1] )};
if ($tag->[0] eq "amenity") { $amenity = scalar ($tag->[1] )};
if ($tag->[0] eq "operator") { $operator = scalar ($tag->[1] )};
if ($tag->[0] eq "vending") { $vending = scalar ($tag->[1] )}
}
if ($name ne "" | $amenity ne "" | $operator ne"" | $vending ne"")
{print AUSGABE "$id^$lat^$lon^$name^$amenity^$operator^$vending\n";}
($id, $lon, $lat, $nodeUser, $ref1) = getNode2 () ;
}
close(AUSGABE);
closeOsmFile () ;
####
use DBI;
use XML::Twig;
####
$file = "c:/osm/planet/pois.osm" ;
####
"open(AUSGABE, ">c:/osm/planet/mysql.txt"); "