Return a sortable key based on the center point of the GBOX.
Definition at line 893 of file gbox.c.
894{
895 union floatuint {
896 uint32_t u;
897 float f;
898 };
899
900 union floatuint
x,
y;
901
902
903
904
905
906
907
909 {
917
918 x.f = 1.5 + gpt.
lon / 512.0;
919 y.f = 1.5 + gpt.
lat / 256.0;
920 }
921 else
922 {
925
926
927
928
929
930
931
932 if (srid == 3857 || srid == 3395)
933 {
934 x.f = 1.5 +
x.f / 67108864.0;
935 y.f = 1.5 +
y.f / 67108864.0;
936 }
937 else if (srid == 4326)
938 {
939 x.f = 1.5 +
x.f / 512.0;
940 y.f = 1.5 +
y.f / 256.0;
941 }
942 }
943
945}
static uint64_t uint32_hilbert(uint32_t px, uint32_t py)
#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.
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().