Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COPC: Invalid VLR issues after extents removal (#91) #92

Closed
rcoup opened this issue Nov 25, 2021 · 1 comment
Closed

COPC: Invalid VLR issues after extents removal (#91) #92

rcoup opened this issue Nov 25, 2021 · 1 comment

Comments

@rcoup
Copy link
Contributor

rcoup commented Nov 25, 2021

I think the change from #91 is producing invalid COPC files... PDAL master (6c863d99) refuses to read them, and lasinfo warns about VLR issues.

$ pdal --debug info -i $TILE.copc.laz --metadata
(PDAL Debug) Debugging...
PDAL: readers.las: Invalid VLR #4 (
                                   /0) - size exceeds specified file range.

$ lasinfo $TILE.copc.laz
WARNING: only 0 bytes until point block after reading 2 of 3 vlrs. skipping remaining vlrs ...
lasinfo (211112) report for 'ABF_586000_3479000.copc.laz'
reporting all LAS header entries:
  file signature:             'LASF'
  file source ID:             0
  global_encoding:            16
  project ID GUID data 1-4:   00000000-0000-0000-0000-000000000000
  version major.minor:        1.4
  system identifier:          ''
  generating software:        ''
  file creation day/year:     1/1
  header size:                375
  offset to point data:       1259
  number var. length records: 2
  point data format:          6
  point data record length:   30
  number of point records:    3661045
  number of points by return: 3657149 3875 21 0 0
  scale factor x y z:         0.01 0.01 0.01
  offset x y z:               586499.989999999990687 3479499.990000000223517 560.660000000000082
  min x y z:                  586000.00 3479000.00 324.35
  max x y z:                  586999.99 3479999.99 796.98
  start of waveform data packet record: 0
  start of first extended variable length record: 17459031
  number of extended_variable length records: 1
  extended number of point records: 3661045
  extended number of points by return: 3657149 3875 21 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 2:
  reserved             0
  user ID              'copc'
  record ID            1
  length after header  160
  description          'COPC info VLR'
variable length header record 2 of 2:
  reserved             0
  user ID              'LASF_Projection'
  record ID            2112
  length after header  616
  description          ''
    WKT OGC COORDINATE SYSTEM:
    PROJCS["NAD83 / UTM zone 11N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","26911"]]
extended variable length header record 1 of 1:
  reserved             0
  user ID              'copc'
  record ID            1000
  length after header  4768
  description          'EPT Hierarchy'
LASzip compression (version 3.4r3 c3 -1): POINT14 3
reporting minimum and maximum for all LAS point record entries ...
  X              -49999      50000
  Y              -49999      50000
  Z              -23631      23632
  intensity           1        152
  return_number       1          3
  number_of_returns   1          3
  edge_of_flight_line 0          1
  scan_direction_flag 0          1
  classification      2          5
  scan_angle_rank   -15         15
  user_data           0          0
  point_source_ID    11         15
  gps_time 331809.461951 336118.583013
  extended_return_number          1      3
  extended_number_of_returns      1      3
  extended_classification         2      5
  extended_scan_angle         -2500   2500
  extended_scanner_channel        0      0
number of first returns:        3657149
number of intermediate returns: 21
number of last returns:         3657149
number of single returns:       3653274
WARNING: point type is 6 but (legacy) number of point records in header is 3661045 instead zero.
WARNING: point type is 6 but (legacy) number of points by return [1] in header is 3657149 instead zero.
WARNING: point type is 6 but (legacy) number of points by return [2] in header is 3875 instead zero.
WARNING: point type is 6 but (legacy) number of points by return [3] in header is 21 instead zero.
overview over extended number of returns of given pulse: 3653274 7708 63 0 0 0 0 0 0 0 0 0 0 0 0
histogram of classification of points:
         1987408  ground (2)
         1669741  low vegetation (3)
              21  medium vegetation (4)
            3875  high vegetation (5)

If I build untwine from before #91 (5fb05d7e7), and switch laz-perf to pre- hobuinc/laz-perf#107 (ac1725e3) then the COPC files untwine produces seem ok:

$ pdal --debug info -i $TILE.copc.laz --metadata
(PDAL Debug) Debugging...
(pdal info Debug) Executing pipeline in stream mode.
{
  "file_size": 17466559,
  "filename": "ABF_586000_3479000.copc.laz",
  "metadata":
  {
    "comp_spatialreference": "PROJCS[\"NAD83 / UTM zone 11N\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-117],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"26911\"]]",
    "compressed": true,
    "count": 3661045,
    "creation_doy": 1,
    "creation_year": 1,
    "dataformat_id": 6,
    "dataoffset": 1631,
    "filesource_id": 0,
    "global_encoding": 16,
    "global_encoding_base64": "EAA=",
    "gtiff": "",
    "header_size": 375,
    "major_version": 1,
    "maxx": 586999.99,
    "maxy": 3479999.99,
    "maxz": 796.98,
    "minor_version": 4,
    "minx": 586000,
    "miny": 3479000,
    "minz": 324.35,
    "offset_x": 586499.99,
    "offset_y": 3479499.99,
    "offset_z": 560.66,
    "point_length": 30,
    "project_id": "00000000-0000-0000-0000-000000000000",
    "scale_x": 0.01,
    "scale_y": 0.01,
    "scale_z": 0.01,
    "software_id": "",
    "spatialreference": "PROJCS[\"NAD83 / UTM zone 11N\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-117],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"26911\"]]",
    "srs":
    {
      "compoundwkt": "PROJCS[\"NAD83 / UTM zone 11N\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-117],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"26911\"]]",
      "horizontal": "PROJCS[\"NAD83 / UTM zone 11N\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-117],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"26911\"]]",
      "isgeocentric": false,
      "isgeographic": false,
      "prettycompoundwkt": "PROJCS[\"NAD83 / UTM zone 11N\",\n    GEOGCS[\"NAD83\",\n        DATUM[\"North_American_Datum_1983\",\n            SPHEROID[\"GRS 1980\",6378137,298.257222101,\n                AUTHORITY[\"EPSG\",\"7019\"]],\n            AUTHORITY[\"EPSG\",\"6269\"]],\n        PRIMEM[\"Greenwich\",0,\n            AUTHORITY[\"EPSG\",\"8901\"]],\n        UNIT[\"degree\",0.0174532925199433,\n            AUTHORITY[\"EPSG\",\"9122\"]],\n        AUTHORITY[\"EPSG\",\"4269\"]],\n    PROJECTION[\"Transverse_Mercator\"],\n    PARAMETER[\"latitude_of_origin\",0],\n    PARAMETER[\"central_meridian\",-117],\n    PARAMETER[\"scale_factor\",0.9996],\n    PARAMETER[\"false_easting\",500000],\n    PARAMETER[\"false_northing\",0],\n    UNIT[\"metre\",1,\n        AUTHORITY[\"EPSG\",\"9001\"]],\n    AXIS[\"Easting\",EAST],\n    AXIS[\"Northing\",NORTH],\n    AUTHORITY[\"EPSG\",\"26911\"]]",
      "prettywkt": "PROJCS[\"NAD83 / UTM zone 11N\",\n    GEOGCS[\"NAD83\",\n        DATUM[\"North_American_Datum_1983\",\n            SPHEROID[\"GRS 1980\",6378137,298.257222101,\n                AUTHORITY[\"EPSG\",\"7019\"]],\n            AUTHORITY[\"EPSG\",\"6269\"]],\n        PRIMEM[\"Greenwich\",0,\n            AUTHORITY[\"EPSG\",\"8901\"]],\n        UNIT[\"degree\",0.0174532925199433,\n            AUTHORITY[\"EPSG\",\"9122\"]],\n        AUTHORITY[\"EPSG\",\"4269\"]],\n    PROJECTION[\"Transverse_Mercator\"],\n    PARAMETER[\"latitude_of_origin\",0],\n    PARAMETER[\"central_meridian\",-117],\n    PARAMETER[\"scale_factor\",0.9996],\n    PARAMETER[\"false_easting\",500000],\n    PARAMETER[\"false_northing\",0],\n    UNIT[\"metre\",1,\n        AUTHORITY[\"EPSG\",\"9001\"]],\n    AXIS[\"Easting\",EAST],\n    AXIS[\"Northing\",NORTH],\n    AUTHORITY[\"EPSG\",\"26911\"]]",
      "proj4": "+proj=utm +zone=11 +datum=NAD83 +units=m +no_defs",
      "units":
      {
        "horizontal": "metre",
        "vertical": ""
      },
      "vertical": "",
      "wkt": "PROJCS[\"NAD83 / UTM zone 11N\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-117],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"26911\"]]"
    },
    "system_id": "",
    "vlr_0":
    {
      "data": "AwAAAAMEAwAAAAAA//////////////////////////8BAAoAHgADAA==",
      "description": "lazperf variant",
      "record_id": 22204,
      "user_id": "laszip encoded"
    },
    "vlr_1":
    {
      "data": "UFJPSkNTWyJOQUQ4MyAvIFVUTSB6b25lIDExTiIsR0VPR0NTWyJOQUQ4MyIsREFUVU1bIk5vcnRoX0FtZXJpY2FuX0RhdHVtXzE5ODMiLFNQSEVST0lEWyJHUlMgMTk4MCIsNjM3ODEzNywyOTguMjU3MjIyMTAxLEFVVEhPUklUWVsiRVBTRyIsIjcwMTkiXV0sQVVUSE9SSVRZWyJFUFNHIiwiNjI2OSJdXSxQUklNRU1bIkdyZWVud2ljaCIsMCxBVVRIT1JJVFlbIkVQU0ciLCI4OTAxIl1dLFVOSVRbImRlZ3JlZSIsMC4wMTc0NTMyOTI1MTk5NDMzLEFVVEhPUklUWVsiRVBTRyIsIjkxMjIiXV0sQVVUSE9SSVRZWyJFUFNHIiwiNDI2OSJdXSxQUk9KRUNUSU9OWyJUcmFuc3ZlcnNlX01lcmNhdG9yIl0sUEFSQU1FVEVSWyJsYXRpdHVkZV9vZl9vcmlnaW4iLDBdLFBBUkFNRVRFUlsiY2VudHJhbF9tZXJpZGlhbiIsLTExN10sUEFSQU1FVEVSWyJzY2FsZV9mYWN0b3IiLDAuOTk5Nl0sUEFSQU1FVEVSWyJmYWxzZV9lYXN0aW5nIiw1MDAwMDBdLFBBUkFNRVRFUlsiZmFsc2Vfbm9ydGhpbmciLDBdLFVOSVRbIm1ldHJlIiwxLEFVVEhPUklUWVsiRVBTRyIsIjkwMDEiXV0sQVhJU1siRWFzdGluZyIsRUFTVF0sQVhJU1siTm9ydGhpbmciLE5PUlRIXSxBVVRIT1JJVFlbIkVQU0ciLCIyNjkxMSJdXQ==",
      "description": "",
      "record_id": 2112,
      "user_id": "LASF_Projection"
    }
  },
  "now": "2021-11-25T11:38:02+0000",
  "pdal_version": "2.3.0 (git-version: 6c863d)",
  "reader": "readers.las"
}

$ lasinfo $TILE.copc.laz
lasinfo (211112) report for 'ABF_586000_3479000.copc.laz'
reporting all LAS header entries:
  file signature:             'LASF'
  file source ID:             0
  global_encoding:            16
  project ID GUID data 1-4:   00000000-0000-0000-0000-000000000000
  version major.minor:        1.4
  system identifier:          ''
  generating software:        ''
  file creation day/year:     1/1
  header size:                375
  offset to point data:       1537
  number var. length records: 3
  point data format:          6
  point data record length:   30
  number of point records:    3661045
  number of points by return: 3657149 3875 21 0 0
  scale factor x y z:         0.01 0.01 0.01
  offset x y z:               586499.989999999990687 3479499.990000000223517 560.660000000000082
  min x y z:                  586000.00 3479000.00 324.35
  max x y z:                  586999.99 3479999.99 796.98
  start of waveform data packet record: 0
  start of first extended variable length record: 17461731
  number of extended_variable length records: 1
  extended number of point records: 3661045
  extended number of points by return: 3657149 3875 21 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 3:
  reserved             0
  user ID              'copc'
  record ID            1
  length after header  160
  description          'COPC offsets'
variable length header record 2 of 3:
  reserved             0
  user ID              'LASF_Projection'
  record ID            2112
  length after header  616
  description          ''
    WKT OGC COORDINATE SYSTEM:
    PROJCS["NAD83 / UTM zone 11N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","26911"]]
variable length header record 3 of 3:
  reserved             0
  user ID              'copc'
  record ID            10000
  length after header  224
  description          'COPC extents'
extended variable length header record 1 of 1:
  reserved             0
  user ID              'copc'
  record ID            1000
  length after header  4768
  description          'EPT Hierarchy'
LASzip compression (version 3.4r3 c3 -1): POINT14 3
reporting minimum and maximum for all LAS point record entries ...
  X              -49999      50000
  Y              -49999      50000
  Z              -23631      23632
  intensity           1        152
  return_number       1          3
  number_of_returns   1          3
  edge_of_flight_line 0          1
  scan_direction_flag 0          1
  classification      2          5
  scan_angle_rank   -15         15
  user_data           0          0
  point_source_ID    11         15
  gps_time 331809.461951 336118.583013
  extended_return_number          1      3
  extended_number_of_returns      1      3
  extended_classification         2      5
  extended_scan_angle         -2500   2500
  extended_scanner_channel        0      0
number of first returns:        3657149
number of intermediate returns: 21
number of last returns:         3657149
number of single returns:       3653274
WARNING: point type is 6 but (legacy) number of point records in header is 3661045 instead zero.
WARNING: point type is 6 but (legacy) number of points by return [1] in header is 3657149 instead zero.
WARNING: point type is 6 but (legacy) number of points by return [2] in header is 3875 instead zero.
WARNING: point type is 6 but (legacy) number of points by return [3] in header is 21 instead zero.
overview over extended number of returns of given pulse: 3653274 7708 63 0 0 0 0 0 0 0 0 0 0 0 0
histogram of classification of points:
         1987408  ground (2)
         1669741  low vegetation (3)
              21  medium vegetation (4)
            3875  high vegetation (5)
@hobu
Copy link
Collaborator

hobu commented Nov 25, 2021

Should be fixed in c28d537. Please reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants