Changeset 9091
 Timestamp:
 Feb 7, 2012 8:36:59 PM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/liblwgeom/libtgeom.c
r9080 r9091 473 473 for (i=1 ; i <= tgeom>nedges ; i++) { 474 474 475 if ( tgeom>edges[i]>s>x < tgeom>bbox>xmin) tgeom>bbox>xmin = tgeom>edges[i]>s>x;475 if (i == 1  tgeom>edges[i]>s>x < tgeom>bbox>xmin) tgeom>bbox>xmin = tgeom>edges[i]>s>x; 476 476 if (tgeom>edges[i]>e>x < tgeom>bbox>xmin) tgeom>bbox>xmin = tgeom>edges[i]>e>x; 477 477 478 if ( tgeom>edges[i]>s>y < tgeom>bbox>ymin) tgeom>bbox>ymin = tgeom>edges[i]>s>y;478 if (i == 1  tgeom>edges[i]>s>y < tgeom>bbox>ymin) tgeom>bbox>ymin = tgeom>edges[i]>s>y; 479 479 if (tgeom>edges[i]>e>y < tgeom>bbox>ymin) tgeom>bbox>ymin = tgeom>edges[i]>e>y; 480 480 481 if ( tgeom>edges[i]>s>z < tgeom>bbox>zmin) tgeom>bbox>zmin = tgeom>edges[i]>s>z;481 if (i == 1  tgeom>edges[i]>s>z < tgeom>bbox>zmin) tgeom>bbox>zmin = tgeom>edges[i]>s>z; 482 482 if (tgeom>edges[i]>e>z < tgeom>bbox>zmin) tgeom>bbox>zmin = tgeom>edges[i]>e>z; 483 483 484 if ( tgeom>edges[i]>s>x > tgeom>bbox>xmax) tgeom>bbox>xmax = tgeom>edges[i]>s>x;484 if (i == 1  tgeom>edges[i]>s>x > tgeom>bbox>xmax) tgeom>bbox>xmax = tgeom>edges[i]>s>x; 485 485 if (tgeom>edges[i]>e>x > tgeom>bbox>xmax) tgeom>bbox>xmax = tgeom>edges[i]>e>x; 486 486 487 if ( tgeom>edges[i]>s>y > tgeom>bbox>ymax) tgeom>bbox>ymax = tgeom>edges[i]>s>y;487 if (i == 1  tgeom>edges[i]>s>y > tgeom>bbox>ymax) tgeom>bbox>ymax = tgeom>edges[i]>s>y; 488 488 if (tgeom>edges[i]>e>y > tgeom>bbox>ymax) tgeom>bbox>ymax = tgeom>edges[i]>e>y; 489 489 490 if ( tgeom>edges[i]>s>z > tgeom>bbox>zmax) tgeom>bbox>zmax = tgeom>edges[i]>s>z;490 if (i == 1  tgeom>edges[i]>s>z > tgeom>bbox>zmax) tgeom>bbox>zmax = tgeom>edges[i]>s>z; 491 491 if (tgeom>edges[i]>e>z > tgeom>bbox>zmax) tgeom>bbox>zmax = tgeom>edges[i]>e>z; 492 492 } … … 626 626 size += sizeof(uint8_t); /* flags */ 627 627 size += sizeof(uint32_t); /* srid */ 628 if (tgeom>bbox) size += sizeof( double) * 6; /* bbox */628 if (tgeom>bbox) size += sizeof(float) * 6; /* bbox */ 629 629 630 630 size += sizeof(uint32_t); /* nedges */ … … 658 658 { 659 659 int i,j; 660 float f; 660 661 size_t size=0; 661 662 uint8_t *loc=buf; … … 683 684 if (tgeom>bbox) 684 685 { 685 memcpy(loc, &tgeom>bbox>xmin, sizeof(double)); 686 loc += sizeof(double); 687 memcpy(loc, &tgeom>bbox>ymin, sizeof(double)); 688 loc += sizeof(double); 689 memcpy(loc, &tgeom>bbox>zmin, sizeof(double)); 690 loc += sizeof(double); 691 memcpy(loc, &tgeom>bbox>xmax, sizeof(double)); 692 loc += sizeof(double); 693 memcpy(loc, &tgeom>bbox>ymax, sizeof(double)); 694 loc += sizeof(double); 695 memcpy(loc, &tgeom>bbox>zmax, sizeof(double)); 696 loc += sizeof(double); 697 698 size += sizeof(double) * 6; 686 f = next_float_down(tgeom>bbox>xmin); 687 memcpy(loc, &f, sizeof(float)); 688 loc += sizeof(float); 689 690 f = next_float_down(tgeom>bbox>ymin); 691 memcpy(loc, &f, sizeof(float)); 692 loc += sizeof(float); 693 694 f = next_float_down(tgeom>bbox>zmin); 695 memcpy(loc, &f, sizeof(float)); 696 loc += sizeof(float); 697 698 f = next_float_up(tgeom>bbox>xmax); 699 memcpy(loc, &f, sizeof(float)); 700 loc += sizeof(float); 701 702 f = next_float_up(tgeom>bbox>ymax); 703 memcpy(loc, &f, sizeof(float)); 704 loc += sizeof(float); 705 706 f = next_float_up(tgeom>bbox>zmax); 707 memcpy(loc, &f, sizeof(float)); 708 loc += sizeof(float); 709 710 size += sizeof(float) * 6; 699 711 } 700 712 … … 844 856 { 845 857 result>bbox = lwalloc(sizeof(BOX3D)); 846 memcpy(&(result>bbox>xmin), loc, sizeof( double));847 loc += sizeof( double);848 memcpy(&(result>bbox>ymin), loc, sizeof( double));849 loc += sizeof( double);850 memcpy(&(result>bbox>zmin), loc, sizeof( double));851 loc += sizeof( double);852 memcpy(&(result>bbox>xmax), loc, sizeof( double));853 loc += sizeof( double);854 memcpy(&(result>bbox>ymax), loc, sizeof( double));855 loc += sizeof( double);856 memcpy(&(result>bbox>zmax), loc, sizeof( double));857 loc += sizeof( double);858 memcpy(&(result>bbox>xmin), loc, sizeof(float)); 859 loc += sizeof(float); 860 memcpy(&(result>bbox>ymin), loc, sizeof(float)); 861 loc += sizeof(float); 862 memcpy(&(result>bbox>zmin), loc, sizeof(float)); 863 loc += sizeof(float); 864 memcpy(&(result>bbox>xmax), loc, sizeof(float)); 865 loc += sizeof(float); 866 memcpy(&(result>bbox>ymax), loc, sizeof(float)); 867 loc += sizeof(float); 868 memcpy(&(result>bbox>zmax), loc, sizeof(float)); 869 loc += sizeof(float); 858 870 } 859 871 else result>bbox = NULL;
Note: See TracChangeset
for help on using the changeset viewer.