[GRASS-SVN] r73065 - grass-addons/grass7/raster/r.in.pdal
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Aug 8 18:57:48 PDT 2018
Author: wenzeslaus
Date: 2018-08-08 18:57:48 -0700 (Wed, 08 Aug 2018)
New Revision: 73065
Modified:
grass-addons/grass7/raster/r.in.pdal/r.in.pdal.py
Log:
r.in.pdal: code was not checking if proj matches, now reprojecting
Modified: grass-addons/grass7/raster/r.in.pdal/r.in.pdal.py
===================================================================
--- grass-addons/grass7/raster/r.in.pdal/r.in.pdal.py 2018-08-09 01:34:19 UTC (rev 73064)
+++ grass-addons/grass7/raster/r.in.pdal/r.in.pdal.py 2018-08-09 01:57:48 UTC (rev 73065)
@@ -271,6 +271,12 @@
shell_script_style = flags['g']
input_as_extent = flags['e']
+ # reprojecting always
+ # TODO: test if it is faster to skip it in the pipeline when
+ # SRSs match, if faster, then get projection ahead of time
+ # (which may be good even to tell user about reprojection happening)
+ reprojection = True
+
# overwrite auf true setzen
os.environ['GRASS_OVERWRITE'] = '1'
@@ -400,6 +406,15 @@
data = {}
data['pipeline'] = []
data['pipeline'].append({'type': format_reader, 'filename': infile})
+ if reprojection:
+ location_srs = grass.read_command('g.proj', flags='j')
+ # making use of universal newlines
+ location_srs = " ".join(location_srs.splitlines())
+ reproj_filter = {
+ "type": "filters.reprojection",
+ "out_srs": location_srs
+ }
+ data['pipeline'].append(reproj_filter)
data['pipeline'].append({
'type': 'writers.text',
'format': 'csv',
More information about the grass-commit
mailing list