These are chat archives for PDAL/PDAL

29th
May 2018
Romulo Goncalves
@romulogoncalves
May 29 13:22

Hi

We are cropping a LAZ file with the following polygon:
POLYGON ((127000.0 482000.0, 127000.0 485000.0, 128000.0 485000.0, 128000.0 482000.0, 127000.0 482000.0))

And when we save the result, no points were cropped. If we use bounds (bounding box equivalent to the above polygon) it crops:
"bounds":"([127000.0,128000.0], [482000.0, 485000.0])"

Is the Polygon correctly defined? We defined it clockwise starting the at the bottom left corner of the polygon. We also tried counter clockwise and same issue.
Any idea, or should we open an issue?

Luigi Pirelli
@luipir
May 29 13:26
@romulogoncalves lack of a 0 in the UTM northing?
Romulo Goncalves
@romulogoncalves
May 29 13:47
@luipir sorry this is not my field, could you explain it a bit more? thanks a lot
Romulo Goncalves
@romulogoncalves
May 29 14:05
do u mean set option a_srs?
We did use "a_srs":"EPSG:4326" and same effect.
Andrew Bell
@abellgithub
May 29 14:34
@romulogoncalves: I'd suggest posting a pipeline. I can't think of any obvious reason why the polygon specification isn't working.
Luigi Pirelli
@luipir
May 29 14:35
where the polygons is located?
Romulo Goncalves
@romulogoncalves
May 29 14:35

@abellgithub

{
  "pipeline":[
    {
      "type":"readers.las",
      "filename":"C_25GN2.laz",
      "compression":"lazperf"
    },
    {
      "type":"filters.crop",
      "polygon":"POLYGON ((127000.00 482000.00, 128000.00 482000.00, 128000.00 485000.00, 127000.00 485000.00, 127000.00 482000.00))",
      "a_srs":"EPSG:4326"
    },
    {
      "type":"writers.las",
      "filename":"C_25GN2_hag.laz",
      "compression":"laszip"
    }
  ]
}

this one works:

{
  "pipeline":[
    {
      "type":"readers.las",
      "filename":"C_25GN2.laz",
      "compression":"lazperf"
    },
    {
      "type":"filters.crop",
      "bounds":"([127000.0,128000.0], [482000.0, 485000.0])"
    },
    {
      "type":"writers.las",
      "filename":"C_25GN2_crop.laz",
      "compression":"laszip"
    }
  ]
}
Luigi Pirelli
@luipir
May 29 14:35
in europe sually instead of 482.000.0 is 4.820.000.0
Grigory
@pomadchin
May 29 14:38
btw @romulogoncalves there is a similar to .md markdown; you can surround blocks of code with ``` <code> ```
Romulo Goncalves
@romulogoncalves
May 29 14:39
@pomadchin thanks :)
Grigory
@pomadchin
May 29 14:39
:+1:
Luigi Pirelli
@luipir
May 29 14:40
EPSG:4326 with projected coordinates?
Andrew Bell
@abellgithub
May 29 14:44
I'm not sure why you've projected the polygon but not the bounds box.
Romulo Goncalves
@romulogoncalves
May 29 14:47
I tried it with and without projection, I was trying to see if that would affect it or not.
Andrew Bell
@abellgithub
May 29 15:04
I don't know what the problem might be. If you can post the data somewhere, I can look.
Romulo Goncalves
@romulogoncalves
May 29 15:06
I will prepare a small test case, one sec
Romulo Goncalves
@romulogoncalves
May 29 15:24

The data can be downloaded from:

wget https://geodata.nationaalgeoregister.nl/ahn3/extract/ahn3_laz/C_25EZ2.LAZ

For it pdal info --metadata returns 24487575 points

Here is the pipeline for a Polygon:

{
  "pipeline":[
    {
      "type":"readers.las",
      "filename":"C_25EZ2.laz",
      "compression":"lazperf"
    },
    {
      "type":"filters.crop",
      "polygon":"POLYGON ((127000.00 487000.00, 128000.00 487000.00, 128000.00 488500.00, 127000.00 488500.00, 127000.00 487000.00))"
    },
    {
      "type":"writers.las",
      "filename":"C_25EZ2_crop_p.laz",
      "compression":"laszip"
    }
  ]
}

When counting the number of points in C_25EZ2_crop_p.laz, pdal info C_25EZ2_crop_p.laz --metadata returns 24487575 points.

Here is the pipeline using bounds:

{
  "pipeline":[
    {
      "type":"readers.las",
      "filename":"C_25EZ2.laz",
      "compression":"lazperf"
    },
    {
      "type":"filters.crop",
      "bounds":"([127000.0,128000.0], [487000.0, 488500.0])"
    },
    {
      "type":"writers.las",
      "filename":"C_25EZ2_crop_b.laz",
      "compression":"laszip"
    }
  ]
}

When counting the number of points in C_25EZ2_crop_b.laz, pdal info C_25EZ2_crop_b.laz --metadata returns 523787 points.

PDAL:

pdal --version
------------------------------------------------------------------------------------------------------------------
pdal 1.7.2 (git-version: 85ea14)
------------------------------------------------------------------------------------------------------------------

I save the pipeline into a JSON file (translate.json) and I run them like this:

pdal pipeline translate.json