Skip to content

Doesn't work for Russia #7

Description

@morandd

Steps to reproduce:

  wget https://download.geofabrik.de/russia.poly
  python polygon2geojson.py russia.poly

The error message:

Traceback (most recent call last):
  File "/home/daniemor/miniconda3/envs/gdal33/lib/python3.10/site-packages/shapely/geometry/multipolygon.py", line 189, in geos_multipolygon_from_polygons
    N = len(exemplar[0][0])
TypeError: object of type 'float' has no len()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/data/OSM/polygon2geojson.py", line 63, in <module>
    main(args.polygon_filename)
  File "/mnt/data/OSM/polygon2geojson.py", line 55, in main
    write_geojson(coordinates, polygon_filename)
  File "/mnt/data/OSM/polygon2geojson.py", line 43, in write_geojson
    output.write({'geometry': mapping(MultiPolygon(data)), 'properties': {}})
  File "/home/daniemor/miniconda3/envs/gdal33/lib/python3.10/site-packages/shapely/geometry/multipolygon.py", line 60, in __init__
    geom, n = geos_multipolygon_from_polygons(polygons)
  File "/home/daniemor/miniconda3/envs/gdal33/lib/python3.10/site-packages/shapely/geometry/multipolygon.py", line 191, in geos_multipolygon_from_polygons
    N = exemplar._ndim
AttributeError: 'list' object has no attribute '_ndim'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions