Skip to content

Filling polygons near to Greenwich #11

@nicgar20

Description

@nicgar20

So I have been trying to get quadkeys for countries like Spain or France, but I am getting an error, after it I tried to fill a small box near greenwich and I still get this error

Polygon examples that get this error

poly = Polygon([[0.01, 20], [0.2, 20], [0.2, 20.5], [0.01, 20.5], [0.01, 20]])
poly = Polygon([[-0.1, 20], [0.1, 20], [0.1, 20.5], [-0.1, 20.5], [-0.1, 20]])

after executing:

tiles = Babel("bing").polyfill(poly, resolution=18)

I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/nicgar/software/anaconda3/envs/obmgap/lib/python3.9/site-packages/babelgrid/babelgrid.py", line 322, in polyfill
    for tile_id in quadtree.polyfill(geometry.shapely, resolution)
  File "/home/nicgar/software/anaconda3/envs/obmgap/lib/python3.9/site-packages/babelgrid/quadtree.py", line 66, in polyfill
    return _get_contained_keys(geometry, _get_initial_tile(geometry), resolution)
  File "/home/nicgar/software/anaconda3/envs/obmgap/lib/python3.9/site-packages/babelgrid/quadtree.py", line 59, in _get_contained_keys
    func(initial_key, False)
  File "/home/nicgar/software/anaconda3/envs/obmgap/lib/python3.9/site-packages/babelgrid/quadtree.py", line 46, in func
    area_ratio = _area_ratio(_key_to_shapely(key), geometry)
  File "/home/nicgar/software/anaconda3/envs/obmgap/lib/python3.9/site-packages/babelgrid/quadtree.py", line 11, in _key_to_shapely
    return wkt.loads(tile_to_geo_boundary(key))
  File "/home/nicgar/software/anaconda3/envs/obmgap/lib/python3.9/site-packages/babelgrid/quadtree.py", line 71, in tile_to_geo_boundary
    a = Tile.from_quad_tree(key)
  File "/home/nicgar/software/anaconda3/envs/obmgap/lib/python3.9/site-packages/pygeotile/tile.py", line 21, in from_quad_tree
    google_x, google_y = [reduce(lambda result, bit: (result << 1) | bit, bits, 0)

It seems like there is an issue in pygeotile, can it be fixed from Babelgrid?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions