Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix della conversione del geojson in geobuf. #7

Open
jenkin opened this issue Dec 5, 2019 · 0 comments
Open

Fix della conversione del geojson in geobuf. #7

jenkin opened this issue Dec 5, 2019 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@jenkin
Copy link
Contributor

jenkin commented Dec 5, 2019

La conversione dello shapefile in geobuf è operata dal modulo omonimo a partire dal geojson.

La conversione fallisce con il seguente errore.

20190101/geojson/unita-territoriali-sovracomunali/unita-territoriali-sovracomunali.json
Traceback (most recent call last):
  File "main.py", line 132, in <module>
    pbf = geobuf.encode(json.load(f))
  File "[virtualenv]/lib/python3.7/site-packages/geobuf/__init__.py", line 8, in encode
    return Encoder().encode(*args)
  File "[virtualenv]/lib/python3.7/site-packages/geobuf/encode.py", line 38, in encode
    if data_type == 'FeatureCollection': self.encode_feature_collection(data.feature_collection, obj)
  File "[virtualenv]/lib/python3.7/site-packages/geobuf/encode.py", line 51, in encode_feature_collection
    self.encode_feature(feature_collection.features.add(), feature_json)
  File "[virtualenv]/lib/python3.7/site-packages/geobuf/encode.py", line 58, in encode_feature
    self.encode_geometry(feature.geometry, feature_json.get('geometry'))
  File "[virtualenv]/lib/python3.7/site-packages/geobuf/encode.py", line 120, in encode_geometry
    self.add_multi_line(geometry, coords_or_arcs)
  File "[virtualenv]/lib/python3.7/site-packages/geobuf/encode.py", line 199, in add_multi_line
    for points in lines: self.add_line(geometry.coords, points)
  File "[virtualenv]/lib/python3.7/site-packages/geobuf/encode.py", line 192, in add_line
    for j in r: self.add_coord(coords, p[j] - (points[i - 1][j] if i else 0))
  File "[virtualenv]/lib/python3.7/site-packages/geobuf/encode.py", line 181, in add_coord
    coords.append(coord if self.transformed else int(round(coord * self.e)))
ValueError: Value out of range: 770721593900
@jenkin jenkin added bug Something isn't working help wanted Extra attention is needed labels Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant