Getting Started #
Last updated on 2026-10-13
The Alaska Vegetation (AKVEG) Database is built in PostgreSQL and hosted on a cloud server that can be accessed in numerous ways. These instructions will show you how to connect to and query the AKVEG Database using R, Python, or ArcGIS Pro.
Obtaining Server Credentials #
You will need server credentials to access the database, which you can request by filling out a Database Access Form. The database is public and free to use; the purpose of server credentials is to prevent excessive loads on the server and for us to know how many people are using the database.
Helpful Resources #
- AKVEG Database GitHub repository: Contains helper functions for connecting to the database, example query scripts in R and Python, and data processing scripts.
- Archived Data Repository: A static snapshot of AKVEG Database Version 2.11.1, deposited as compiled CSV files. This archive is useful if you wish to explore the data before requesting access to the database, or if you prefer to work with flat files and do not need the most current version of the AKVEG Database. The archive includes a R Markdown vignette that demonstrates how to join, filter, and manipulate the data for basic analyses.
Connecting with R or Python #
You will need to install the following packages and modules to connect to the AKVEG Database:
Python 3.9+
- psycopg2
- pandas
- utils_database.py (optional)
Alternatively, you can connect to the database using sqlalchemy and polars (example script).
R 4.4.0+
- DBI
- RPostgres
- utils_database.R (optional)
You will receive the server credentials as a ZIP folder that includes three SSL certificate files and a CSV file.
- Unzip the credentials.
- Open the CSV file and update the file paths for the following rows: 9 (sslrootcert), 10 (sslcert), and 11 (sslkey).
- Ensure you are running the latest version of R/Python.
- Download the required packages and the
utils_databasemodule listed above. - Source and execute the
connect_database_postgresqlfunction from theutils_databasemodule, specifying the file path of the CSV file as the function argument.
Querying the database in R or Python #
Navigate to our GitHub repository and use the scripts in user_tools/connection_examples and the SQL queries in user_tools/queries for examples of how to connect, query, and manipulate tables in the AKVEG Database. You will need to modify the file paths in the scripts to reflect your folder structure.
Downloading example files #
The example scripts require two input files that are not included in the GitHub repository. These files are used in the scripts to show how to relate data in the AKVEG Database to vector and raster data. They are not required to use the AKVEG Database.
- region_input (
AlaskaYukon_USNVC_ZonesRegions_v2p1_3338.gpkg): A GeoPackage containing polygons of the major biomes and vegetation regions of Alaska and adjacent Canada (Yukon and Northern British Columbia). You can download the region input and unzip it into an accessible local folder. - fireyear_input (
AlaskaYukon_FireYear_10m_3338.tif): A 10 m raster dataset of most recent burn year from 1940 to 2023 where zero indicates that no burn was documented during that time frame. You can download the fire year input (~ 800 mb) and unzip it into an accessible local folder.
Connecting with ArcGIS Pro #
To connect to the database using ArcGIS Pro, copy the three SSL certificate files (server-ca, client-cert, and client-key) to a default location (i.e., one that will be recognized automatically by ArcGIS Pro). We recommend the following default location:
C:\Users\<Your_Username>\AppData\Roaming\postgresql\
- Navigate to the default location.
AppDatais a hidden folder; if you don’t see it, enable “Show hidden files, folders, and drives” in File Explorer options. - Create a folder called
postgresqlif it does not exist. - Copy the three SSL files into the
postgresqlfolder. - Rename the three files as follows. You can ignore the warnings about changing file extensions:
- server-ca.pem → root.pem
- client-cert.pem → postgresql.crt (Note the file extension is crt without the ’e’).
- client-key.pem → postgresql.key
- Launch ArcGIS Pro. If it is already opened, close it and launch it again.
- Go to Insert / Connections / New Database / New Database Connection. Choose ‘PostgreSQL’ as the Database Platform. Use the information provided in the CSV file to populate the Instance, Username, and Password fields (the ‘Instance’ is called ‘host’ in the CSV file). Keep the Authentication Type as the default ‘Database authentication’.
- You should see two database names appear in the ‘Database’ field. Select akveg_public. Click OK.
- All of the tables should now appear in the Catalog Pane / Databases. The ‘akveg_public.public.site’ can be converted to a Point Feature Class using the
latitude_ddandlongitude_ddfields (EPSG: 4269). All other tables are non-spatial.
Although there will be a slight delay when working with the data in this way, it is preferable to exporting the data into a local geodatabase. Maintaining a direct connection to the database ensures that you’re always working with the latest version of the database.
Common Connection Issues #
If you are unable to connect to the database:
- Confirm that the CSV file reflects the correct file paths to the credentials files.
- Confirm that your R/Python scripts have been updated to the correct file paths.
- Verify your security settings. Many company Wi-Fi networks and company VPNs block access to Port 5432, which is used to establish a database connection between the PostgreSQL server and the client. If your security settings do not allow access to the database:
- Contact your IT administrator
- Access the database from another Internet connection e.g., a residential Wi-Fi network.
- If neither of those options are available to you, please contact Amanda Droghini to discuss alternatives.
Next Steps #
In the next section, you will learn how the database is structured and how the database tables and fields are related to each other. With this knowledge in hand, you’ll be able to develop your own queries to extract the data you are interested in.