Ags3/4 compatibility #3
Answered
by
konnerhorton
calebsangarup
asked this question in
Q&A
-
|
hey Joost, do you have any handy tools/methods to extract GI data from AGS3/4(.ags) to excel(.xls/.xlsx) in bulk? the current tool in https://gitlab.com/ags-data-format-wg/ags-python-library/ only does AGS4 after my testing. |
Beta Was this translation helpful? Give feedback.
Answered by
konnerhorton
May 8, 2025
Replies: 1 comment
-
|
This is a little old, but just responding in case others have the question: The dfs = ags_to_dfs(ags4)
# write to separate csv's
for name, df in dfs.items():
df.to_csv(f'{name}.csv', index=False)
# write to worksheets in a workbook
with pd.ExcelWriter('ags_data.xlsx') as writer:
for name, df in dfs.items():
df.to_excel(writer, sheet_name=name, index=False) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
JoostGevaert
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a little old, but just responding in case others have the question:
The
bedrock_ge.gi.ags.read.ags_to_dfsfunction writes an AGS3 or AGS4 to a dictionary of pandas dataframes. So, it would be relatively straight forward to write each dataframe to a csv, or a separate worksheet on an excel workbook: