0

我有这段代码,我运行它,一切都很好,但是当我使用.head() 时,列中没有显示原始代码,其余代码没有运行,因为原始数据是空的..

这是代码

import geopandas as gpd
import json
import numpy as np
from shapely.geometry import LineString, Point, box
import ast
from pyproj import Proj
paths = road_features.SHAPE.map(lambda x: np.array(ast.literal_eval(x)["paths"][0]))
pathLineStrings = paths.map(LineString)
gdf = gpd.GeoDataFrame(road_features,geometry=pathLineStrings)
#gdf.crs = {'init': 'epsg:3857'}
gdf.crs = {'init': 'epsg:4326'}
gdf = gdf.to_crs({'init': 'epsg:4326'})
x0 = -112.8
x1 = -111.0
y0 = 39.6
y1 = 41.6
SLC = box(x0,y0,x1,y1)

slc_df = gdf[gdf.intersects(SLC)]

我跑

slc_df.head()

显示了这个

segment_id
OBJECTID_1
Join_Count
TARGET_FID
Join_Count_1
TARGET_FID_1
Join_Count_12
TARGET_FID_12
OBJECTID
pre_dir
...
road_orient_approx
proximity_to_signal
proximity_to_billboard
proximity_to_nearest_intersection
proximity_to_major_road
population_density
station_id
SHAPE
accident_counts
geometry

0 rows × 32 columns

我错过了什么?谢谢你一年的时间

4

0 回答 0