[GRASS-SVN] r67632 - grass/trunk/scripts/v.import
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 23 04:33:29 PST 2016
Author: martinl
Date: 2016-01-23 04:33:29 -0800 (Sat, 23 Jan 2016)
New Revision: 67632
Modified:
grass/trunk/scripts/v.import/v.import.py
Log:
v.import: add -o flag
Modified: grass/trunk/scripts/v.import/v.import.py
===================================================================
--- grass/trunk/scripts/v.import/v.import.py 2016-01-23 12:30:10 UTC (rev 67631)
+++ grass/trunk/scripts/v.import/v.import.py 2016-01-23 12:33:29 UTC (rev 67632)
@@ -91,8 +91,12 @@
#% key: l
#% description: List available OGR layers in data source and exit
#%end
+#%flag
+#% key: o
+#% label: Override projection check (use current location's projection)
+#% description: Assume that the dataset has same projection as the current location
+#%end
-
import sys
import os
import atexit
@@ -134,9 +138,12 @@
output = options['output']
layers = options['layer']
- vflags = None
+ vflags = ''
if options['extent'] == 'region':
- vflags = 'r'
+ vflags += 'r'
+ if flags['o']:
+ vflags += 'o'
+
vopts = {}
if options['encoding']:
vopts['encoding'] = options['encoding']
@@ -193,8 +200,8 @@
os.environ['GISRC'] = str(tgtgisrc)
# try v.in.ogr directly
- if grass.run_command('v.in.ogr', input=OGRdatasource, flags='j',
- errors='status', quiet=True) == 0:
+ if flags['o'] or grass.run_command('v.in.ogr', input=OGRdatasource, flags='j',
+ errors='status', quiet=True) == 0:
try:
grass.run_command('v.in.ogr', input=OGRdatasource,
flags=vflags, **vopts)
More information about the grass-commit
mailing list