Handle duplicate headers and changing number of data columns.
This pull-request enables parsing some of the LAS files in issue:
more malformed LAS files from USGS to handle, mostly florida #61
Changes to dist/index.js:
Only read a required unique header and its data once.
Ignore additional entries for the unique header.
These are the headers: ~V, ~W, ~C, ~P, ~O, and ~A.
Move the inital parsing from las string data in interim structured
section data to sub-function: las2json.readSections()
Move las2json sub-functions to the bottom of the section to make the
main logic more prominent.
Handle cases of data sections that have an inconsistent number of data
columns in the data rows. If a row has more data columns than the
headings, then add generic colunms titled 'UNKNOWN' + a number. Then
populate the previous rows for that column with zero string values '0'
Add tests:
dist/test/las2json/test_duplicate_header.js
dist/test/las2json/test_extra_data_columns.js
This is a fairly big change, with moving some code sections around and replacing some code with a sub-function.
Sorry I've been slow on this one. Will try to review this within the week. As you say, it's a bigger change than normal, so want to give it a good review.
Description:
Handle duplicate headers and changing number of data columns. This pull-request enables parsing some of the LAS files in issue:
more malformed LAS files from USGS to handle, mostly florida
#61Changes to dist/index.js:
Add tests:
This is a fairly big change, with moving some code sections around and replacing some code with a sub-function.
Test Results:
--
Let me know if this change could be accepted (or rejected) or needs some additional changes to be approved and merged.
Thank you, DC