[GRASS-dev] [GRASS GIS] #105: r.in.xyz: zscale parameter addition patch

#105: r.in.xyz: zscale parameter addition patch
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Keywords: |
-------------------------+--------------------------------------------------
Hi,

I have implemented a zscale parameter in r.in.xyz.
Patch submitted to trac for review.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/105&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#105: r.in.xyz: zscale parameter addition patch
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: hamish
      Type: enhancement | Status: assigned
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Changes (by hamish):

  * status: new => assigned
  * owner: grass-dev@lists.osgeo.org => hamish
* cc: grass-dev@lists.osgeo.org (added)

Comment:

Hi,

Sorry I missed the earlier discussion of the -i flag [for ignoring
malformed lines in the data stream]; I had been out of town.

In general my plan for r.in.xyz was to keep the interface (and code) as
simple as possible. The idea is to keep the methodology clean + light, and
so the code bug free + fast.

The code for the -i flag won't slow down the module any (vs prior) and
doesn't really add program complexity, so I don't have a technical problem
with it. Still, for reducing methodology mistakes & encouraging a hands-
on approach to data management, I consider it preferable that the user
should be forced to do something to fix their broken input files rather
than hack their way around them without careful study of what the problem
really is. If there are many files to process they could filter the stream
through any number of UNIX tools like sed or awk and then pipe the result
to r.in.xyz's stdin in some automated way.

--

A zscale= option seems like a reasonable request. Is the purpose that the
elevation data comes in feet and you want it in meters?

I will review the patch, run some speed tests, and take care of committing
as soon as time allows.

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/105#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#105: r.in.xyz: zscale parameter addition patch
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: hamish
      Type: enhancement | Status: assigned
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by neteler):

I would appreciate if you don't revert the -i flag. It's a major PITA to
manually fix files as in the indicated case (with Lidar, you often have
hundreds of tiles to process).

The purpose that the elevation data comes in feet and you want it in
meters or you want centimeters or whatever. Data often come in a different
way than desired.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/105#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#105: r.in.xyz: zscale parameter addition patch
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: hamish
      Type: enhancement | Status: assigned
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by hamish):

Don't worry, I don't mean to revert the -i flag, but I did want to make
clear my design philosophy. If the input file is that badly broken then a
million WARNINGs should be disincentive enough to discourage lazy abuse of
the flag.

FWIW, to chop off the last row of a file, use head with a negative index:
   head -n -1 filename.txt | r.in.xyz in=- out=foo ...

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/105#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#105: r.in.xyz: zscale parameter addition patch
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: hamish
      Type: enhancement | Status: assigned
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords: r.in.xyz
--------------------------+-------------------------------------------------
Changes (by hamish):

  * keywords: => r.in.xyz

Comment:

Patch committed by Markus; looks good. Closing wish.

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/105#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#105: r.in.xyz: zscale parameter addition patch
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: hamish
      Type: enhancement | Status: closed
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: fixed | Keywords: r.in.xyz
--------------------------+-------------------------------------------------
Changes (by hamish):

  * status: assigned => closed
  * resolution: => fixed

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/105#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#105: r.in.xyz: zscale parameter addition patch
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: hamish
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords: r.in.xyz
--------------------------+-------------------------------------------------
Changes (by hamish):

  * status: closed => reopened
  * resolution: fixed =>

Comment:

{{{
z=z/zscale;
}}}

shouldn't that be {{{z *= zscale;}}} ??

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/105#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#105: r.in.xyz: zscale parameter addition patch
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: hamish
      Type: enhancement | Status: closed
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: fixed | Keywords: r.in.xyz
--------------------------+-------------------------------------------------
Changes (by hamish):

  * status: reopened => closed
  * resolution: => fixed

Comment:

With r31713 r.in.xyz's zscale has been changed in svn to multiply by the
scale factor, not divide.

reclosing ticket.

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/105#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>