Parcourir la source

v.import: move testing if the data are of the same CRS before creating temporary location

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70519 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová il y a 8 ans
Parent
commit
7c143f3449
1 fichiers modifiés avec 14 ajouts et 13 suppressions
  1. 14 13
      scripts/v.import/v.import.py

+ 14 - 13
scripts/v.import/v.import.py

@@ -182,6 +182,20 @@ def main():
     if output:
         vopts['output'] = output
     vopts['snap'] = options['snap']
+
+    # try v.in.ogr directly
+    if flags['o'] or grass.run_command('v.in.ogr', input=OGRdatasource, flags='j',
+                                       errors='status', quiet=True, overwrite=overwrite) == 0:
+        try:
+            grass.run_command('v.in.ogr', input=OGRdatasource,
+                              flags=vflags, overwrite=overwrite, **vopts)
+            grass.message(
+                _("Input <%s> successfully imported without reprojection") %
+                OGRdatasource)
+            return 0
+        except CalledModuleError:
+            grass.fatal(_("Unable to import <%s>") % OGRdatasource)
+
     try:
         grass.run_command('v.in.ogr', input=OGRdatasource,
                           location=TMPLOC, flags='i', quiet=True, overwrite=overwrite, **vopts)
@@ -200,19 +214,6 @@ def main():
     # switch to target location
     os.environ['GISRC'] = str(tgtgisrc)
 
-    # try v.in.ogr directly
-    if flags['o'] or grass.run_command('v.in.ogr', input=OGRdatasource, flags='j',
-                                       errors='status', quiet=True, overwrite=overwrite) == 0:
-        try:
-            grass.run_command('v.in.ogr', input=OGRdatasource,
-                              flags=vflags, overwrite=overwrite, **vopts)
-            grass.message(
-                _("Input <%s> successfully imported without reprojection") %
-                OGRdatasource)
-            return 0
-        except CalledModuleError:
-            grass.fatal(_("Unable to import <%s>") % OGRdatasource)
-
     # make sure target is not xy
     if grass.parse_command('g.proj', flags='g')['name'] == 'xy_location_unprojected':
         grass.fatal(