groundhog
groundhog copied to clipboard
Handling AGS3 file with Python
Hello. Is it possible to use groundhog package to handle data in the AGS3 file? If so, how to do it? Thanks
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")
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
Thanks for the comment @manthue. Can you provide an example file that I can work with for testing?