code: def hilbert_curve(precision, bits_per_char=6):
      
      bits = precision * bits_per_char
  
      coords = []
      for i in range(1 << bits):
          code = encode_int(i, bits_per_char).rjust(precision, '0')
          coords += [decode(code, bits_per_char)]
  
      return {
          'type': 'Feature',
          'properties': {},
          'geometry': {
              'type': 'LineString',
              'coordinates': coords,
          },
      }
docs: Build the (geojson) `LineString` of the used hilbert-curve
  
      Builds the `LineString` of the used hilbert-curve given the `precision` and
      the `bits_per_char`. The number of bits to encode the geohash is equal to
      `precision * bits_per_char`, and for each level, you need 2 bits, hence
      the number of bits has to be even. The more bits are used, the more precise
      (and long) will the hilbert curve be, e.g. for geohashes of length 3 (precision)
      and 6 bits per character, there will be 18 bits used and the curve will
      consist of 2^18 = 262144 points.
  
      Parameters:
          precision: int      The number of characters in a geohash.
          bits_per_char: int  The number of bits per coding character.
  
      Returns:
          dict: geojson `Feature` containing the hilbert curve as a `LineString`.