MCPcopy Create free account
hub / github.com/LAStools/LAStools / check_parse_string

Method check_parse_string

LASlib/src/laswriter_txt.cpp:596–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596BOOL LASwriterTXT::check_parse_string(const CHAR* parse_string)
597{
598 const CHAR* p = parse_string;
599 while (p[0])
600 {
601 if ((p[0] != 'x') && // the x coordinate
602 (p[0] != 'y') && // the y coordinate
603 (p[0] != 'z') && // the z coordinate
604 (p[0] != 't') && // the gps time
605 (p[0] != 'R') && // the red channel of the RGB field
606 (p[0] != 'G') && // the green channel of the RGB field
607 (p[0] != 'B') && // the blue channel of the RGB field
608 (p[0] != 's') && // a string or a number that we don't care about
609 (p[0] != 'i') && // the intensity
610 (p[0] != 'a') && // the scan angle
611 (p[0] != 'n') && // the number of returns of given pulse
612 (p[0] != 'r') && // the number of the return
613 (p[0] != 'c') && // the classification
614 (p[0] != 'u') && // the user data
615 (p[0] != 'p') && // the point source ID
616 (p[0] != 'e') && // the edge of flight line flag
617 (p[0] != 'd') && // the direction of scan flag
618 (p[0] != 'h') && // the withheld flag
619 (p[0] != 'k') && // the keypoint flag
620 (p[0] != 'g') && // the synthetic flag
621 (p[0] != 'o') && // the overlap flag
622 (p[0] != 'l') && // the scanner channel
623 (p[0] != 'm') && // the index of the point (count starts at 0)
624 (p[0] != 'M') && // the index of the point (count starts at 1)
625 (p[0] != 'w') && // the wavepacket descriptor index
626 (p[0] != 'W') && // all wavepacket attributes
627 (p[0] != 'X') && // the unscaled and unoffset integer x coordinate
628 (p[0] != 'Y') && // the unscaled and unoffset integer y coordinate
629 (p[0] != 'Z')) // the unscaled and unoffset integer z coordinate
630 {
631 if (p[0] >= '0' && p[0] <= '9')
632 {
633 I32 index = (I32)(p[0] - '0');
634 if (index >= header->number_attributes)
635 {
636 laserror("extra bytes attribute '%d' does not exist.", index);
637 return FALSE;
638 }
639 attribute_starts[index] = header->get_attribute_start(index);
640 }
641 else
642 {
643 laserror("unknown symbol '%c' in parse string. valid are\n" \
644 "\t'x' : the x coordinate\n" \
645 "\t'y' : the y coordinate\n" \
646 "\t'z' : the z coordinate\n" \
647 "\t't' : the gps time\n" \
648 "\t'R' : the red channel of the RGB field\n" \
649 "\t'G' : the green channel of the RGB field\n" \
650 "\t'B' : the blue channel of the RGB field\n" \
651 "\t's' : a string or a number that we don't care about\n" \
652 "\t'i' : the intensity\n" \
653 "\t'a' : the scan angle\n" \

Callers

nothing calls this directly

Calls 1

laserrorFunction · 0.85

Tested by

no test coverage detected