[pdal] Filters.assign: not all filters applied

Eric Robeck erobeck at gmail.com
Sat Apr 14 17:38:32 PDT 2018


PDAL team -

I mentioned this in an earlier email but thought it would be better in its
own thread. I wrote a pipeline to assign two SMRF variables (window and
slope) to separate dimensions, as I eventually want to combine them into a
single Postgres database and compare the effectiveness of each iteration.

My pipeline has several stages, as shown below. First I read the file,
capturing the non-standard dimensions I created earlier, then I ferry the
two new fields. Next reset the classifications (before running SMRF) and
assign per-file values to Window and Slope. This is where the process
breaks down. Only the last assignment is made. In the pipeline below, I
added GpsTime and Red for testing purposes. As shown in the *info --stats*
output (bottom, highlighted text), no changes were made to Window, Slope or
GpsTime, but Red is assigned a value of 255. When I remove the Red
assignment, GpsTime is assigned the correct value of 3000, but Window and
Slope are still unchanged.

If I insert more *filters.assign* stages in the pipeline, I can set values
multiple dimensions, but only if they are the last listed in each stage.

*However, I can't set the values of Window and Slope* - even if they are
last. (I don't care about the others - they are just for testing.) Why
can't I assign values to my newly created dimensions? Is it because I don't
specify their type until the writer stage?

Thanks in advance.

Regards,
Eric


*Pipeline (limited to the first 100,000 points for testing). File is LAZ
1.4 format:*

{
  "pipeline":
  [
    {
      "filename":"C:/data/forest_park/forest_park_orig_dtm.laz",
      "type":"readers.las",
      "extra_dims":"OldClassification=uint8, DTM=float",
      "count":100000
    },
    {
      "type":"filters.ferry",
      "tag":"filtersferry",
      "dimensions":"=>Window, =>Slope"
    },
    {
      "inputs":"filtersferry",
      "type":"filters.assign",
      "tag":"filtersassign",
      "assignment":"Classification[:]=0",
      "assignment":"Window[:]=12",
      "assignment":"Slope[:]=0_50",
      "assignment":"GpsTime[:]=3000",
      "assignment":"Red[:]=255"
    },
    {
      "inputs":"filtersassign",
      "type":"filters.smrf",
      "tag":"filterssmurf",
      "cell":1.00,
      "cut":0,
      "scalar":1.25,
      "slope":0.05,
      "threshold":0.50,
      "window":12
    },
    {
        "inputs":"filterssmurf",
      "type":"writers.las",
      "minor_version":"4",
      "compression":"true",
      "extra_dims":"OldClassification=uint8, DTM=float, Window=uint8,
Slope=float",
      "scale_x":"0.01",
      "scale_y":"0.01",
      "scale_z":"0.01",
      "offset_x":"auto",
      "offset_y":"auto",
      "offset_z":"auto",
      "filename":"C:/data/forest_park/smrf/forest_park (window-12,
slope-0_05).laz"
    }
  ]
}

*info -stats JSON output:*

{
  "filename": "C:\\data\\forest_park\\smrf\\forest_park (window-12,
slope-0_05).laz",
  "pdal_version": "1.7.1 (git-version: Release)",
  "stats":
  {
    "bbox":
    {
      "EPSG:4326":
      {
        "bbox":
        {
          "maxx": -90.26228629,
          "maxy": 38.63885582,
          "maxz": 231.3,
          "minx": -90.26674834,
          "miny": 38.63740345,
          "minz": 146.26
        },
        "boundary": {
   "coordinates" : [
      [
         [ -90.266748340000007, 38.637506649999999 ],
         [ -90.266697059999998, 38.638855820000003 ],
         [ -90.262286290000006, 38.638752609999997 ],
         [ -90.262337650000006, 38.637403450000001 ],
         [ -90.266748340000007, 38.637506649999999 ]
      ]
   ],
   "type" : "Polygon"
}

      },
      "native":
      {
        "bbox":
        {
          "maxx": 738284.32,
          "maxy": 4280246,
          "maxz": 231.3,
          "minx": 737900.01,
          "miny": 4280096.12,
          "minz": 146.26
        },
        "boundary": {
   "coordinates" : [
      [
         [ 737900.01000000001, 4280096.1200000001 ],
         [ 737900.01000000001, 4280246 ],
         [ 738284.31999999995, 4280246 ],
         [ 738284.31999999995, 4280096.1200000001 ],
         [ 737900.01000000001, 4280096.1200000001 ]
      ]
   ],
   "type" : "Polygon"
}

      }
    },
    "statistic":
    [
      {
        "average": 738047.8528,
        "count": 100000,
        "kurtosis": -1.058617353e+21,
        "maximum": 738284.32,
        "minimum": 737900.01,
        "name": "X",
        "position": 0,
        "skewness": 5.819331476e+21,
        "stddev": 2335.463392,
        "variance": 5454389.253
      },
      {
        "average": 4280180.736,
        "count": 100000,
        "kurtosis": 1.110237075e+20,
        "maximum": 4280246,
        "minimum": 4280096.12,
        "name": "Y",
        "position": 1,
        "skewness": 5.833279928e+21,
        "stddev": 13535.46299,
        "variance": 183208758.5
      },
      {
        "average": 172.814753,
        "count": 100000,
        "kurtosis": -1.151862193e+17,
        "maximum": 231.3,
        "minimum": 146.26,
        "name": "Z",
        "position": 2,
        "skewness": 4.786721963e+16,
        "stddev": 24.75900268,
        "variance": 613.0082139
      },
      {
        "average": 13627.78624,
        "count": 100000,
        "kurtosis": -9.799196037e+11,
        "maximum": 65520,
        "minimum": 48,
        "name": "Intensity",
        "position": 3,
        "skewness": 2.271591546e+11,
        "stddev": 11494.12826,
        "variance": 132114984.4
      },
      {
        "average": 1.16788,
        "count": 100000,
        "kurtosis": -3.136035307e+15,
        "maximum": 7,
        "minimum": 1,
        "name": "ReturnNumber",
        "position": 4,
        "skewness": 2.081955413e+15,
        "stddev": 0.4458118459,
        "variance": 0.198748202
      },
      {
        "average": 1.33647,
        "count": 100000,
        "kurtosis": 2.44020564e+16,
        "maximum": 7,
        "minimum": 1,
        "name": "NumberOfReturns",
        "position": 5,
        "skewness": 5.819448528e+15,
        "stddev": 0.6329627186,
        "variance": 0.4006418031
      },
      {
        "average": 0.50087,
        "count": 100000,
        "kurtosis": -2.000079167,
        "maximum": 1,
        "minimum": 0,
        "name": "ScanDirectionFlag",
        "position": 6,
        "skewness": -0.003486625756,
        "stddev": 0.5000250321,
        "variance": 0.2500250328
      },
      {
        "average": 0,
        "count": 100000,
        "maximum": 0,
        "minimum": 0,
        "name": "EdgeOfFlightLine",
        "position": 7,
        "stddev": 0,
        "variance": 0
      },
      {
        "average": 1.69919,
        "count": 100000,
        "kurtosis": -1.16609259e+16,
        "maximum": 2,
        "minimum": 1,
        "name": "Classification",
        "position": 8,
        "skewness": 1.912221988e+15,
        "stddev": 0.4586301939,
        "variance": 0.2103416548
      },
      {
        "average": -2.09112,
        "count": 100000,
        "kurtosis": 6.331454949e+15,
        "maximum": 6,
        "minimum": -7,
        "name": "ScanAngleRank",
        "position": 9,
        "skewness": -1.275371659e+15,
        "stddev": 3.14954445,
        "variance": 9.919630242
      },
      {
        "average": 0,
        "count": 100000,
        "maximum": 0,
        "minimum": 0,
        "name": "UserData",
        "position": 10,
        "stddev": 0,
        "variance": 0
      },
      {
        "average": 45,
        "count": 100000,
        "kurtosis": 99997,
        "maximum": 45,
        "minimum": 45,
        "name": "PointSourceId",
        "position": 11,
        "skewness": 5.833372669e+21,
        "stddev": 0.1423032062,
        "variance": 0.0202502025
      },
      {
        "average": 255,
        "count": 100000,
        "kurtosis": 99997,
        "maximum": 255,
        "minimum": 255,
        *"name": "Red",*
        "position": 12,
        "skewness": 5.833372669e+21,
        "stddev": 0.8063848353,
        "variance": 0.6502565026
      },
      {
        "average": 0,
        "count": 100000,
        "maximum": 0,
        "minimum": 0,
        "name": "Green",
        "position": 13,
        "stddev": 0,
        "variance": 0
      },
      {
        "average": 0,
        "count": 100000,
        "maximum": 0,
        "minimum": 0,
        "name": "Blue",
        "position": 14,
        "stddev": 0,
        "variance": 0
      },
      {
        "average": 172254001,
        "count": 100000,
        "kurtosis": -3.202512756e+16,
        "maximum": 172254002.3,
        "minimum": 172253999.8,
        *"name": "GpsTime",*
        "position": 15,
        "skewness": 5.833372669e+21,
        "stddev": 544717.7005,
        "variance": 2.967173733e+11
      },
      {
        "average": 0,
        "count": 100000,
        "maximum": 0,
        "minimum": 0,
        "name": "ScanChannel",
        "position": 16,
        "stddev": 0,
        "variance": 0
      },
      {
        "average": 0,
        "count": 100000,
        "maximum": 0,
        "minimum": 0,
        "name": "ClassFlags",
        "position": 17,
        "stddev": 0,
        "variance": 0
      },
      {
        "average": 18.01678,
        "count": 100000,
        "kurtosis": -1.884682428e+10,
        "maximum": 66,
        "minimum": 1,
        "name": "OldClassification",
        "position": 18,
        "skewness": 7910529149,
        "stddev": 28.56978029,
        "variance": 816.2323461
      },
      {
        "average": 153.4204378,
        "count": 100000,
        "kurtosis": -3.477613714e+20,
        "maximum": 156.4029999,
        "minimum": 146.477005,
        "name": "DTM",
        "position": 19,
        "skewness": 1.411306933e+20,
        "stddev": 1.666234469,
        "variance": 2.776337307
      },
      {
        "average": 0,
        "count": 100000,
        "maximum": 0,
        "minimum": 0,
        *"name": "Window",*
        "position": 20,
        "stddev": 0,
        "variance": 0
      },
      {
        "average": 0,
        "count": 100000,
        "maximum": 0,
        "minimum": 0,
        *"name": "Slope",*
        "position": 21,
        "stddev": 0,
        "variance": 0
      }
    ]
  }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20180414/ca7729f5/attachment-0001.html>


More information about the pdal mailing list