/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Methods/Mapping/scripts/srtm2osm/.svn/text-base/merge.pl.svn-base

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

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