groundhog icon indicating copy to clipboard operation
groundhog copied to clipboard

Handling AGS3 file with Python

Open honami1111 opened this issue 1 year ago • 3 comments

Hello. Is it possible to use groundhog package to handle data in the AGS3 file? If so, how to do it? Thanks

honami1111 avatar Apr 14 '23 01:04 honami1111

This is possible with the AGSConverter class. There is a notebook available in the groundhog notebooks folder. The functionality is developed for AGS4.x files by default but support for AGS3.1 files is also available by using agsformat="3.1" as optional keyword argument. This has been tested on a limited number of files. Let me know if you run into any issues.

Please note that I was planning to remove AGS functionality from groundhog as this package is fully functional: https://gitlab.com/ags-data-format-wg/ags-python-library. However, it only supports AGS4, so I will not deprecate the AGSConverter yet to keep offering functionality for AGS3.1.

from groundhog.general.agsconversion import AGSConverter
agsdata = AGSConverter(path='<file_path>', agsformat="3.1")

snakesonabrain avatar Aug 16 '23 08:08 snakesonabrain

Hi, I used the groundhog AGSConverter class to convert AGS3.1 files (with tag agsformat="3.1") to pandas dataframes and then to export to csv.

I noticed however that in the csv file there are some of these continuation lines (which start with <CONT>) which I guess derive from the column-width limitations of Excel in the past. So if a line is too long, in AGS3.1 it is broken into additional <CONT> lines.

I guess your converter should correct that by merging the data into a single line as these limitations are not there anymore. I don't know now if this is a bug or not, but it would be nice if you could adjust that. Thanks

manthue avatar Nov 17 '23 18:11 manthue

Thanks for the comment @manthue. Can you provide an example file that I can work with for testing?

snakesonabrain avatar Nov 29 '23 13:11 snakesonabrain