Commit 4f8fff6a authored by Thomas Albrecht's avatar Thomas Albrecht

added missing files

parent ad01cdf7
#!/bin/bash
PROG=install.sh
USAGE="$PROG file"
DESC="<One line of description>"
HELP="<Zero or more lines of Help>"
AUTHOR="Thomas Albrecht"
#[ "$1" == "" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ] && \
# echo -e "Usage: $USAGE\n$DESC\n$HELP" && exit 1
set -u
# Here follows your own code
# rm -rf ln/
# lnall
prefix=LOWI
tgt=e011n47
rm $tgt/${prefix}city*.ac $tgt/${prefix}city*.xml
# mv ln/city-* e013n51/
cp ${prefix}city*.ac $tgt/
cp ${prefix}city*.xml $tgt/
#kate city.stg $tgt/$stg
for stg in *.stg; do
tmp=stg.tmp
sed -e '/# osm2city/,$d' $tgt/$stg > $tmp
cat $tmp $stg > $tgt/$stg
#mv $tmp $tgt/$stg # uninstall
#kate $tgt/$stg &
done
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
shamelessly copied from calc-tile.pl
"""
from math import floor, trunc
def bucket_span(lat):
"""Latitude Range -> Tile Width (deg)"""
alat = abs(lat)
if alat >= 89: return 360
if alat >= 88: return 8
if alat >= 86: return 4
if alat >= 83: return 2
if alat >= 76: return 1
if alat >= 62: return .5
if alat >= 22: return .25
return .125
def tile_index(lon, lat):
tile_width = bucket_span(lat)
EPSILON = 0.0000001
lon_floor = floor(lon)
lat_floor = floor(lat)
span = bucket_span(lat)
if span < EPSILON:
lon = 0
x = 0
elif span <= 1.0:
x = int((lon - lon_floor) / span)
else:
if lon >= 0:
lon = int(int(lon/span) * span)
else:
lon = int(int((lon+1)/span) * span - span)
if lon < -180:
lon = -180
x = 0
y = int((lat - lat_floor) * 8)
index = (int(lon_floor) + 180) << 14
index += (int(lat_floor) + 90) << 6
index += y << 3
index += x
return index
if __name__ == "__main__":
for lon, lat, idx in ((13.687944, 51.074664, 3171138),
(13.9041667, 51.1072222, 3171139),
(13.775, 51.9638889, 3171195),
(0.258094, 29.226081, 2956745),
(-2.216667, 30.008333, 2907651)):
print tile_index(lon, lat) - idx
var path_file = "/home/tom/daten/fgfs/src/fgdata/Nasal/elev.in";
var path_out = "/tmp/elev.xml";
var get = func {
var raw_str = io.readfile(path_file);
var raw_list = split("\n", raw_str);
var file_out = io.open(path_out, "w");
foreach(var l; raw_list) {
var l_list = split(" ", l);
if (size(l_list) == 4) {
var terrain_elev = geo.elevation(l_list[1], l_list[0]);
var elev_str = sprintf("%.3f", (terrain_elev));
# print( l_list[0] ~" "~ l_list[1] ~" "~ l_list[2] ~" "~ l_list[3] ~" "~ elev_str);
io.write(file_out, l_list[0] ~" "~ l_list[1] ~" "~ l_list[2] ~" "~ l_list[3] ~" "~ elev_str ~"\n");
} else {
# print();
io.write(file_out, l ~"\n");
}
}
io.close(file_out);
print(size(raw_list));
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment