#!/usr/bin/env python

#%Module
#% description: export elevation data from grass to ossim 
#% keywords: raster
#%End

#%flag
#% key: 1
#% description: export elevation data  
#%END
#%flag
#% key: 2
#% description: copy data in ossm elevation folder 
#%END
#%flag
#% key: a
#% description: set the tiling size 
#%END
#%flag
#% key: b
#% description: use raster resolution to set the tiling (only for meters)
#%END
#%option
#% key: elevation
#% type: string
#% gisprompt: old,cell,raster
#% description: Input elevation data
#% required: no
#%end
#%option
#% key: tiling
#% type: double
#% description: tiling size 
#% required : no
#%end
#%option
#% key: directory
#% type: string
#% gisprompt: new_file,file,output
#% description: directory where save output
#% required : no
#%end
#%option
#% key: name
#% type: string
#% description: nome elevation export
#% required : no
#%end


import sys
import grass.script as grass
import os
import platform


directory = options['directory'] 
elevation = options['elevation'] 
name = options['name'] 
tiling = options['tiling'] 
surface = options['surface'] 
name_surf = options['name_surf'] 
surf = options['surf'] 
pcs = options['pcs'] 



def main():
    systemplatform = platform.system()
    if systemplatform == 'Darwin':
        orthoigen='/private/var/tmp/XcodeBuilds/Release/orthoigen'
    else :
        orthoigen='/usr/local/bin/orthoigen'
    os.system("mkdir %s") % (directory)
    os.system("cd %s") % (directory) 
    os.system("mkdir srtm_elevation")
    print 'Vector map is 3D'
    print directory, elevation, name, tiling, surface, name_surf, surf, pcs
    print directory, elevation, name, tiling, surface, name_surf, surf, pcs

if __name__ == "__main__":
    options, flags = grass.parser()
    sys.exit(main())