89 latitudinal lines for each degree between equator and pole
~10,000km distance (at 510 pixles -> ~ 20 km per pixel)
between equator and pole, a degree every ~ 5.7 pixels (/ 510.0 89)
between equator and pole, every pixel spans ~10 arc minutes (/ 60 5.7)
12 meridians every 30 degrees (the sinusoidal map we're using is interrupted and has 12 gores)
around the equator, there is a degree every ~ 4.4 pixels (/ 1600.0 360)
this calculation needs to be done again, every time one moves up or down in the y direction, as the number of pixels with data has decreased ... thus as you move away from the equator in the y direction, the number of degrees longitude per pixel goes up
calculating latitude and longitude degrees for every pixel
while a pixel is square, the bounding area the pixel represents is approximated as a polygon
the top and bottom sides have different lengths
the sides are not parallel to each other, but rather are angled toward each other
thus the game world globe is not a sphere, but rather a polyhedron whose faces at the poles are three-sided polygons and everywhere else are four-sided parallelograms
Tiles in Redis:
each pixel represents a tile
each tile has a value for altitude, feature type (land, sea, ice), biome type
each tile is represented as polygon
defined by three lat.lon coordinates at the poles (four, including the repeat of the first)
defined everywhere else by four lat,lon coordinates (five, including the repeat of the first)
Questions:
how will tiles be used?
what tile am I in? (here's my lat/lon ... what tile contains that lat/lon?)
similarly, where is X?
how far away are X and Y? (GEODIST)
what else is around X? (GEORADIUS)
what tile is SW from here?
to perform that last one ...
index ll and ur for all tiles?
GEORADIUS will be used, so maybe index the center location of each tile?
how to associate the coords of a tile's polygon corner coords with "a tile" in Redis?
how will lat/lon be used?
should always be center of tile
sentient and object locations
distance between things
tracking travel distance
Notes on Redis GEO:
Valid longitudes are from -180 to 180 degrees
Valid latitudes are from -85.05112878 to 85.05112878 N
Redis assumes that the Earth is a sphere; in the worst case distance errors may be as much as 0.5%
Sinusoidal data:
Tiles in Redis:
Questions:
Notes on Redis GEO: