geobox.py
def compute_set(lat, lon, resolution, slice):
  """Computes the set of adjacent Geoboxes for a coordinate."""
  decimal.getcontext().prec = resolution + 3
  primary_box = compute_tuple(lat, lon, resolution, slice)
  slice = decimal.Decimal(str(1.0 * slice * 10 ** -resolution))

  geobox_values = []
  for i in xrange(-1, 2):
    lat_delta = slice * i
    for j in xrange(-1, 2):
      lon_delta = slice * j
      adjusted_box = (primary_box[0] + lat_delta, primary_box[1] + lon_delta,
                      primary_box[2] + lat_delta, primary_box[3] + lon_delta)
      geobox_values.append(format_tuple(adjusted_box, resolution))

  return geobox_values
Computes the set of adjacent Geoboxes for a coordinate.
Computes the set of adjacent Geoboxes for a coordinate.
Computes the set of adjacent Geoboxes for a coordinate .
def compute_set(lat, lon, resolution, slice):
  decimal.getcontext().prec = resolution + 3
  primary_box = compute_tuple(lat, lon, resolution, slice)
  slice = decimal.Decimal(str(1.0 * slice * 10 ** -resolution))
  geobox_values = []
  for i in xrange(-1, 2):
    lat_delta = slice * i
    for j in xrange(-1, 2):
      lon_delta = slice * j
      adjusted_box = (primary_box[0] + lat_delta, primary_box[1] + lon_delta,
                      primary_box[2] + lat_delta, primary_box[3] + lon_delta)
      geobox_values.append(format_tuple(adjusted_box, resolution))
  return geobox_values
def compute_set ( lat , lon , resolution , slice ) : decimal . getcontext ( ) . prec = resolution + 3 primary_box = compute_tuple ( lat , lon , resolution , slice ) slice = decimal . Decimal ( str ( 1.0 * slice * 10 ** - resolution ) ) geobox_values = [ ] for i in xrange ( - 1 , 2 ) : lat_delta = slice * i for j in xrange ( - 1 , 2 ) : lon_delta = slice * j adjusted_box = ( primary_box [ 0 ] + lat_delta , primary_box [ 1 ] + lon_delta , primary_box [ 2 ] + lat_delta , primary_box [ 3 ] + lon_delta ) geobox_values . append ( format_tuple ( adjusted_box , resolution ) ) return geobox_values
Computes the set of adjacent Geoboxes for a coordinate.
Computes the set of adjacent Geoboxes for a coordinate .
"""Computes the set of adjacent Geoboxes for a coordinate."""
lat
lon
resolution
slice