

(Code for building a database of surface and underground permits)
The certificates of granted water use are made publicly available through the website of the Minas Gerais Water Management Institute (Igam) in the state of Minas Gerais. The information is presented in hundreds of files, making it difficult to download, compile, and analyze the points of interest for the user.
In this regard, a code was developed in the R programming language for the automated collection of these documents in PDF format and for a web scrapping, extracting the necessary information in an optimized manner to build a water use database, to support licensing studies.
The code scans the documents, considering naming patterns such as: Decree, Purpose, Municipality, Location (latitude and longitude), Typology (surface or groundwater), Watercourse (when applicable), Tubular well (when applicable), Watershed, and Validity period. This way, it is possible to create an organized database that allows for continuous information updates.