~ubuntu-branches/ubuntu/trusty/liblas/trusty-proposed

« back to all changes in this revision

Viewing changes to apps/txt2las.c

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2014-01-05 17:00:29 UTC
  • mfrom: (7.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140105170029-ddtp0j63x5jvck2u
Tags: 1.7.0+dfsg-2
Fixed missing linking of system boost component.
(closes: #733282)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#define LAS_FORMAT_11 1
21
21
#define LAS_FORMAT_12 2
22
22
 
 
23
 
 
24
 
23
25
void usage()
24
26
{
25
27
 
536
538
    if (file_name_out == NULL && file_name_in != NULL)
537
539
    {
538
540
        int len = (int)strlen(file_name_in);
539
 
        file_name_out = strdup(file_name_in);
 
541
        file_name_out = LASCopyString(file_name_in);
540
542
 
541
543
        while (len > 0 && file_name_out[len] != '.')
542
544
        {
567
569
    }
568
570
 
569
571
    /* create a cheaper parse string that only looks for 'x' 'y' 'z' and 'r' */
570
 
    parse_less = strdup(parse_string);
 
572
    parse_less = LASCopyString(parse_string);
571
573
    for (i = 0; i < (int)strlen(parse_string); i++)
572
574
    {
573
575
        if (parse_less[i] != 'x' && 
701
703
        xyz_max_dequant[i] = xyz_offset[i] + (xyz_max_quant[i] * xyz_scale[i]);
702
704
    }
703
705
 
704
 
 
705
 
#define log_xor !=0==!
706
 
 
707
706
    /* make sure there is not sign flip */
708
707
    for (i = 0; i < 3; i++)
709
708
    {
710
 
        if ((xyz_min[i] > 0) log_xor (xyz_min_dequant[i] > 0))
 
709
        if ((xyz_min[i] > 0) != (xyz_min_dequant[i] > 0))
711
710
        {
712
711
            fprintf(stderr, 
713
712
                    "WARNING: quantization sign flip for %s min coord %g -> %g. use offset or scale up\n", 
716
715
                    xyz_min_dequant[i]
717
716
                   );
718
717
        }
719
 
        if ((xyz_max[i] > 0) log_xor (xyz_max_dequant[i] > 0))
 
718
        if ((xyz_max[i] > 0) != (xyz_max_dequant[i] > 0))
720
719
        {
721
720
            fprintf(stderr, 
722
721
                    "WARNING: quantization sign flip for %s max coord %g -> %g. use offset or scale up\n", 
727
726
        }
728
727
    }
729
728
 
730
 
#undef log_xor
731
 
 
732
729
    /* populate the header */
733
730
      
734
731
    header = LASHeader_Create();
819
816
    while (fgets(line, sizeof(char) * MAX_CHARACTERS_PER_LINE, file_in))
820
817
    {
821
818
        point = LASPoint_Create();
 
819
        LASPoint_SetHeader(point, header);
822
820
        if (parse(parse_string, line, xyz, point, &gps_time))
823
821
        {
824
822
            /* init the bounding box */
836
834
            LASPoint_SetY(point, xyz[1]);
837
835
            LASPoint_SetZ(point, xyz[2]);
838
836
 
 
837
            LASPoint_SetTime(point, gps_time); 
 
838
 
839
839
            /* write the first point */
840
840
            err = LASWriter_WritePoint(writer, point);
841
841
            if (err) {
868
868
    while (fgets(line, sizeof(char) * MAX_CHARACTERS_PER_LINE, file_in))
869
869
    {
870
870
        point = LASPoint_Create();
 
871
        LASPoint_SetHeader(point, header);
 
872
        
871
873
        if (parse(parse_string, line, xyz, point, &gps_time))
872
874
        {
873
875
            /* update bounding box */
884
886
            LASPoint_SetY(point, xyz[1]);
885
887
            LASPoint_SetZ(point, xyz[2]);
886
888
 
 
889
            LASPoint_SetTime(point, gps_time); 
 
890
            
887
891
            /* write the first point */
888
892
            err = LASWriter_WritePoint(writer, point);
889
893
            if (err) {