Change the gps_points table to store latitude and longitude values to
seven decimal places to given a worse case precision of about 1cm.
This commit is contained in:
parent
62dfa5ff45
commit
9afb35449b
5 changed files with 14 additions and 14 deletions
|
@ -27,5 +27,5 @@ long long tile_for_point(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *
|
|||
long long lat = *(long long *)args->args[0];
|
||||
long long lon = *(long long *)args->args[1];
|
||||
|
||||
return xy2tile(lon2x(lon / 1000000.0), lat2y(lat / 1000000.0));
|
||||
return xy2tile(lon2x(lon / 10000000.0), lat2y(lat / 10000000.0));
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ class TileTracepoints < ActiveRecord::Migration
|
|||
add_index "gps_points", ["tile"], :name => "points_tile_idx"
|
||||
remove_index "gps_points", :name => "points_idx"
|
||||
|
||||
Tracepoint.update_all("tile = tile_for_point(latitude, longitude)")
|
||||
Tracepoint.update_all("latitude = latitude * 10, longitude = longitude * 10, tile = tile_for_point(latitude * 10, longitude * 10)")
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue