Return a sortable key based on the center point of the GBOX.
Definition at line 808 of file gbox.c.
809{
810 union floatuint {
811 uint32_t u;
812 float f;
813 };
814
815 union floatuint
x,
y;
816
817
818
819
820
821
822
824 {
832
833 x.f = 1.5 + gpt.
lon / 512.0;
834 y.f = 1.5 + gpt.
lat / 256.0;
835 }
836 else
837 {
840
841
842
843
844
845
846
847 if (srid == 3857 || srid == 3395)
848 {
849 x.f = 1.5 +
x.f / 67108864.0;
850 y.f = 1.5 +
y.f / 67108864.0;
851 }
852 else if (srid == 4326)
853 {
854 x.f = 1.5 +
x.f / 512.0;
855 y.f = 1.5 +
y.f / 256.0;
856 }
857 }
858
860}
#define FLAGS_GET_GEODETIC(flags)
void normalize(POINT3D *p)
Normalize to a unit vector.
void cart2geog(const POINT3D *p, GEOGRAPHIC_POINT *g)
Convert cartesian coordinates on unit sphere to spherical coordinates.
static uint64_t uint32_hilbert(uint32_t px, uint32_t py)
Point in spherical coordinates on the world.
References cart2geog(), GBOX::flags, FLAGS_GET_GEODETIC, GEOGRAPHIC_POINT::lat, GEOGRAPHIC_POINT::lon, normalize(), uint32_hilbert(), POINT3D::x, GBOX::xmax, GBOX::xmin, POINT3D::y, GBOX::ymax, GBOX::ymin, POINT3D::z, GBOX::zmax, and GBOX::zmin.
Referenced by gserialized_cmp(), gserialized_get_sortable_hash(), and rect_node_cmp().