Browse Source

proof of concept for using direct srtm data

rtree
Marc 12 years ago
parent
commit
2c8cdcb37a
  1. 17
      airspace/altiresolver.py
  2. 3
      airspace/zone.py

17
airspace/altiresolver.py

@ -19,11 +19,28 @@
import urllib2
import error
import subprocess
class AltiResolver:
def getGroundLevelAt(self, lat, lon):
pass
OSSIM_HEIGHT_EXEC="/usr/bin/ossim-height"
class OssimResolverProcess(AltiResolver):
def __init__(self, ossim_config):
self.config = ossim_config
def getGroundLevelAt(self, lat, lon):
args = [OSSIM_HEIGHT_EXEC,
"-P", self.config,
str(lat), str(lon)]
p = subprocess.Popen(args, stdout=subprocess.PIPE)
for l in p.stdout.xreadlines():
if l.startswith("Height above MSL:"):
return float(l.strip().split(':')[1].strip())
VALID_GN_SRC=("gtopo30", "astergdem")
class GeoNamesResolver(AltiResolver):

3
airspace/zone.py

@ -52,7 +52,8 @@ class Zone:
current_center = None
direction = "cw"
altitude_resolver = altiresolver.GeoNamesResolver(datasource="gtopo30")
altitude_resolver = altiresolver.OssimResolverProcess("/mnt/supra-fat/dkm/marble-srtm-data/unzipe/ossim_preferences_template")
#altiresolver.GeoNamesResolver(datasource="gtopo30")
def __init__(self, name=None, aclass=None):
"""

Loading…
Cancel
Save