Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically open a pre-configured project file when QGIS starts #5

Open
batpad opened this issue Jan 8, 2024 · 1 comment
Open
Assignees

Comments

@batpad
Copy link
Collaborator

batpad commented Jan 8, 2024

Context

Breaking out of @geohacker's comment here -

We will create a project file with all the layers and configuration we need, and then have QGIS automatically load the project file on startup.

Proposal

The cleanest way is to probably write a startup script that QGIS will execute on startup: https://docs.qgis.org/3.28/en/docs/pyqgis_developer_cookbook/intro.html#running-python-code-when-qgis-starts

In this script, we can handle opening of a project file.

Questions:

  • Should we add the project file to this repository and have it built as part of this image? OR
  • Should we manage the project file separately and have it at some URL that gets pulled in at build time? OR
  • Should the project file live at a URL and get pulled in at run-time?

Anyways, we'll start off just making sure the startup script works to open a project file, and then we can figure details.

cc @yuvipanda @geohacker

Updates and actions

No response

@batpad batpad self-assigned this Jan 8, 2024
@batpad
Copy link
Collaborator Author

batpad commented Jan 12, 2024

@geohacker - in your notes above you recommend writing a python script to load the project file on startup. Looking at the qgis docs, one can also start qgis with a project file with like qgis -p <path/to/project.file> - is there a good reason to not just use that? I can see that putting it in a python script gives us more flexibility, but just trying to understand if we can start off just using the CLI flag to open a project file when starting QGIS.

From the output of qgis --help:

[-p, --project projectfile]	load the given QGIS project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant