source: subversion/utils/srtm2osm/merge.pl @ 2191

Last change on this file since 2191 was 2125, checked in by enxrah, 13 years ago

srtm2osm a little utility to create contour lines in OSM format

  • Property svn:executable set to *
File size: 915 bytes
RevLine 
[2125]1#!/usr/bin/perl
2#-----------------------------------------------------------------------------
3# Set data source file name in map-features file
4#-----------------------------------------------------------------------------
5
6appendOSMfile($ARGV[0], $ARGV[1]);
7
8sub 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
Note: See TracBrowser for help on using the repository browser.