[GRASS-SVN] r45168 - grass-addons/ossim_grass/v.planet
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 23 09:49:42 EST 2011
Author: epifanio
Date: 2011-01-23 06:49:42 -0800 (Sun, 23 Jan 2011)
New Revision: 45168
Modified:
grass-addons/ossim_grass/v.planet/ogrTovrt.py
grass-addons/ossim_grass/v.planet/v.planet.py
Log:
bugfix
Modified: grass-addons/ossim_grass/v.planet/ogrTovrt.py
===================================================================
--- grass-addons/ossim_grass/v.planet/ogrTovrt.py 2011-01-23 14:33:57 UTC (rev 45167)
+++ grass-addons/ossim_grass/v.planet/ogrTovrt.py 2011-01-23 14:49:42 UTC (rev 45168)
@@ -1,12 +1,10 @@
#!/usr/bin/env python
################################################################################
#
-# MODULE: ogrTovrt.py
+# MODULE: r.planet.py
#
-# AUTHOR(S): Massimo Di Stefano 2010-02-7
-# relicensed with permission by
-# Frank Warmerdam - warmerdam at pobox.com - original author
-# original code : ogr2vrt.py
+# AUTHOR(S): Massimo Di Stefano 2010-02-7 - massimodisasha at yahoo.it
+# (original code : ogr2vrt.py - Frank Warmerdam, warmerdam at pobox.com)
#
#
# PURPOSE: Create OGR VRT from source datasource and
Modified: grass-addons/ossim_grass/v.planet/v.planet.py
===================================================================
--- grass-addons/ossim_grass/v.planet/v.planet.py 2011-01-23 14:33:57 UTC (rev 45167)
+++ grass-addons/ossim_grass/v.planet/v.planet.py 2011-01-23 14:49:42 UTC (rev 45168)
@@ -134,7 +134,7 @@
mapfile = os.path.join(vectorpath, 'head')
vrtdir = os.path.join(grassenv['GISDBASE'], grassenv['LOCATION_NAME'], mappa[1], 'vrt', 'vector/')
except :
- vectorpath = os.path.join(grassenv['GISDBASE'], grassenv['LOCATION_NAME'], grassenv['MAPSET'], 'vector', mappa[0] )
+ vectorpath = os.path.join(grassenv['GISDBASE'], grassenv['LOCATION_NAME'], grassenv['MAPSET'], mappa[0] )
mapfile = os.path.join(vectorpath, 'head' )
vrtdir = os.path.join(grassenv['GISDBASE'], grassenv['LOCATION_NAME'], grassenv['MAPSET'], 'vrt', 'vector/')
d = os.path.dirname(vrtdir)
@@ -142,23 +142,23 @@
os.makedirs(d)
vrtfilename = mappa[0] + '.vrt'
output = os.path.join(vrtdir, vrtfilename)
+ if not os.path.exists(output):
+ ogrvrt(mapfile,output)
+ print 'try to make omd'
+ makestile(output, options['brush'], options['pen'], options['size'], options['fill'], options['thickness'])
+ proj_info = projinfo()
+ unit = proj_info['units']
+ if unit.lower() == 'meters':
+ zoom_position = setCPRJ(options['map'])
+ if unit.lower() == 'metres':
+ zoom_position = setCPRJ(options['map'])
+ if unit == 'Degrees':
+ zoom_position = setCLL(options['map'])
+ lat = zoom_position[0]
+ lon = zoom_position[1]
+ distance = zoom_position[2]
if add :
try:
- if not os.path.exists(output):
- ogrvrt(mapfile,output)
- print 'try to make omd'
- makestile(output, options['brush'], options['pen'], options['size'], options['fill'], options['thickness'])
- proj_info = projinfo()
- unit = proj_info['units']
- if unit.lower() == 'meters':
- zoom_position = setCPRJ(options['map'])
- if unit.lower() == 'metres':
- zoom_position = setCPRJ(options['map'])
- if unit == 'Degrees':
- zoom_position = setCLL(options['map'])
- lat = zoom_position[0]
- lon = zoom_position[1]
- distance = zoom_position[2]
addzoom(output,lon,lat,distance,host,dport,pport)
print 'Added vector file :', mappa[0]
print 'Camera positioned to : '
More information about the grass-commit
mailing list