I'm working in a Jupyter Notebook and deleted code I thought I didn't need the other. Now I get an overflow error, when running the notebook. I'm pretty sure the code used to work just fine and the problem is caused by me stupidly deleting stuff.
Anyway, I can't seem to find what is missing and would really appreciate help. I'm using a list with coordinates, convert them to a linestring and then transform them. Finally, I lookup the length.
import pyproj
from pyproj import Transformer
from shapely.ops import transform
from shapely.geometry import LineString
route = [[41.875562, -87.624421], [29.949932, -90.070116], [40.712728, -74.006015]]
ls = LineString(route)
project = pyproj.Transformer.from_proj(
pyproj.Proj(init='epsg:4326'),
pyproj.Proj(init='epsg:3857'))
ls_metric = transform(project.transform, ls)
ls_metric_length = round(ls_metric.length / 1000)
This returns
OverflowError: cannot convert float infinity to integer
The problem arises already with ls_metric which doesn't generate a LineString.