I've been developing code to take a .csv with lat-long coords and convert them to LineStrings before creating parallel offsets for them. This has been working so far, but yesterday after clearing my variables, I started running into an error when running my code.
from shapely.geometry import LineString, Point import pandas as pd import geopandas as gpd df = pd.read_csv("***/Kingsboro Rd NE.csv") df = df.drop_duplicates() geometry = [Point(xy) for xy in zip(df.lng, df.lat)] df['geometry'] = geometry df['agg'] = 1 df_line = gpd.GeoDataFrame(df.groupby(['agg'])['geometry'].apply(lambda x: LineString(x.tolist())), geometry='geometry') df_line = df_line.set_crs("EPSG:4326") df_line = df_line.to_crs("EPSG:2240") df_offset_l = pd.DataFrame(df_line.iloc.geometry.parallel_offset(25, 'left', 2, mitre_limit = 100.0))
Everything runs fine until the final line, for which I get the following error:
ValueError: DataFrame constructor not properly called!
As I mentioned before, I have not been getting this error until yesterday, and I need it to work properly to perform the other data manipulation steps following this line of code.
Here's a sample of the input file: