Straighten out hilbert and quadkey encoding

This commit is contained in:
Erica Fischer
2024-03-14 14:36:51 -07:00
parent a852c04ed4
commit a12bea7129
7 changed files with 37 additions and 18 deletions
+8
View File
@@ -200,6 +200,14 @@ void decode_quadkey(unsigned long long index, unsigned *wx, unsigned *wy) {
}
}
unsigned coordinate_to_encodable(long long coord) {
return (unsigned) (coord / (1LL << (GLOBAL_DETAIL - 32)));
}
long long decoded_to_coordinate(unsigned coord) {
return ((long long) coord) * (1LL << (GLOBAL_DETAIL - 32));
}
void set_projection_or_exit(const char *optarg) {
struct projection *p;
for (p = projections; p->name != NULL; p++) {