wm

Wang–Müller line generalization algorithm in PostGIS
Log | Files | Refs | README | LICENSE

vars.awk (565B) - Raw


      1 #!/usr/bin/awk -f
      2 
      3 BEGIN { FS="[(); ]" }
      4 
      5 /small_angle constant real default radians/ {
      6   x1 += 1;
      7   d1 = sprintf("\\newcommand{\\smallAngle}{$%d^\\circ$}",$8);
      8 }
      9 /isolation_threshold constant real default / {
     10   x2 += 1;
     11   d2 = sprintf("\\newcommand{\\isolationThreshold}{%.1f}",$7);
     12 }
     13 /scale2 constant float default / {
     14   x3 += 1;
     15   d3 = sprintf("\\newcommand{\\exaggerationEnthusiasm}{%.1f}",$7);
     16 }
     17 
     18 END{
     19   if(x1 == 1 && x2 == 1 && x3 == 1) {
     20     print d1 > "vars.inc.tex"
     21     print d2 >> "vars.inc.tex"
     22     print d3 >> "vars.inc.tex"
     23   } else {
     24     exit 1
     25   }
     26 }