我有一个美国城市的 shapefile,我想在该 shapefile 中获取每个城市的 X 和 Y 坐标。我试过这个:
for city in city_cursor:
geom = city.Shape
point = geom.getPart()
citylist_City_Name.append(city.CITY_NAME)
citylist_Country.append(city.CNTRY_NAME)
citylist_Admin.append(city.ADMIN_NAME)
citylist_Population.append(city.Population)
citylist_X_Coor.append(geom.point.X)
citylist_Y_Coor.append(geom.point.Y)
但我得到了错误
Traceback (most recent call last): File "C:/Users/workd.py", line 43,
in citylist_X_Coor.append(geom.point.X) AttributeError: 'PointGeometry' object
has no attribute 'point'
我真的不明白错误信息?我该如何解决?谢谢!