Well hello here,
I wanted to know how to make a python script that reads the attribute table from .sde feature class? In my case that feature class is inside feature dataset. At the moment I know how to make it happen with excel, but wanted to reconstruct script a little bit to miss that part where you need to export excel file out.
So, here is a code snippet of how I'm reading latitude and longitude from a excel file:
file_path = r"D:\coordinates\coordinates_excel.xls"
dataframe = pd.read_excel(file_path)
for i in range(0,len(dataframe)):
lat2 = dataframe['lat'][i]
lon2 = dataframe['lon'][i]
distance = haversine(lat, lon, lat2, lon2)
distance_nxt.append(distance)
The goal is to read attribute table (lat, lon) from a shapefile which is in .SDE, and to do further tasks. Right now, this script is reading LAT and LON from excel file. Maybe someone have an idea of how to shoot it right away from .sde database? How to read shapefile attribute table like excel table?