1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/perl
#-----------------------------------------------------------------------------
# Set data source file name in map-features file
#-----------------------------------------------------------------------------
appendOSMfile($ARGV[0], $ARGV[1]);
sub appendOSMfile(){
my ($Datafile,$Datafile1) = @_;
# Strip the trailing </osm> from the datafile
open(my $fpIn1, "<", "$Datafile");
my $Data = join("",<$fpIn1>);
close $fpIn1;
die("no such $Datafile") if(! -f $Datafile);
$Data =~ s/<\/osm>//s;
#print
print $Data;
# Read the merge file remove the xml prolog and opening <osm> tag and append to the datafile
open(my $fpIn2, "<", "$Datafile1");
my $discard = <$fpIn2>;
$discard = <$fpIn2>;
my $Data = join("",<$fpIn2>);
close $fpIn2;
die("no such $Datafile1") if(! -f $Datafile1);
#$Data =~ s/.*server\">//s;
# Append to the data file
print $Data;
}
|