Giter Site home page Giter Site logo

qgis-dissect's Introduction

Lifecycle:Experimental

dissect (formerly qgis-reports-plugin)

A plugin reporting overlapping GIS datasets

Installation - BC Government Employees

GTS Recommended - Use Geospatial or ArcGIS 10.8 (BCGW queries are very slow if run locally)

  1. Create a new profile in QGIS if desired (Settings/User Profiles/New Profile)
  2. In File Explorer, head to ...\script_whse\python\Reporting\In_Progress\dissect and run install.bat
  3. When prompted, hit enter or select the QGIS profile you'd like to install on
  4. Restart QGIS if necessary

Installation

  1. Download repo
  2. Copy example_config.yml to the root folder and rename to config.yml
  3. Modify optional default parameters as desired
  4. Run install.py:
    • Open QGIS and run the script from the Python Console (CTRL+ALT+P): 1) Show editor, 2) Open script, 3) Run script image
    • if you have a standalone QGIS build, simply run install.bat (and change bcgov_qgis_boiler_plate in install.py to your package)
    • in either case, you will be prompted to select a QGIS profile to install on. You can simply press enter to select the default profile.
  5. Configure data_config.xlsx as desired.

Optional additional configuration steps

  • Modify default parameters in config.yml - then run install.bat/py again
    • Defaults can also be set in QGIS after install in Settings > Options > Advanced > dissect.
  • Modify html templates for output reports
  • Configure protected tables in protected.yml
    • Protected tables will provide only intersect summary stats - geometries will not be exported.

Usage

  1. Start QGIS
  2. Add a file that contains your area of interest polygon (or create a new temp layer add temporary scratch layer)
  3. Open the Processing Toolbox (CTRL+ALT+T) and select dissect from Scripts at the bottom of the toolbox

Processing toolbox

  1. Select your area of interest

Selecting an AOI

  1. Add your database credentials (+).

Create a new authentication configuration

This login will be stored in an encrypted file within your QGIS profile. If you haven't done so previously, you will be asked to set a master password to edit/view stored configurations - this can be whatever you want.

Setting a master password

Give the configuration a name and enter the username and password for the database you are accessing (e.g. BCGW)

Filling in authentication config

  1. If desired, check 'Add overlapping interests to map' to have intersecting features added in QGIS (including all original attributes).

Add overlapping interests

  1. Run! (Expected runtimes are roughly 2 min for a 100 ha AOI or 8 min for a 10 000 ha AOI with the default Terrestrial Datasets configuration)

Report output

When complete, the Results Viewer panel should open on the bottom right with a hyperlink directly to the report file. The html report file contains summary statistics as well as geospatial data for all interests (except protected tables, which have summary stats only).

Results viewer panel

Use the buttons below the map to filter interests by category. Use the 'Draw on map' switch to make interests visible on the map.

Filter buttons

At the bottom of the report page, failed layers, ie data which could not be processed and are not included in the report, are listed. The comment included should provide direction for how to resolve the issue, if possible, or whether perhaps you lack access to the requested data.

Contributing

We encourage contributions. Please see our CONTRIBUTING guidelines. BC Government employees should also ensure they review BC Open Source Development Employee Guide

  • Contribute tools and plugins into tools, standalone scripts and modules to scripts, and small snips and script examples to recipes.
  • Please do your best to document your scripts and provide tool documentation

License

Copyright 2019 BC Provincial Government

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

qgis-dissect's People

Contributors

rustyjux avatar wburt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qgis-dissect's Issues

Improve report filtering

Add a search bar, or give alternate sort options (e.g. alpha)
Or add note to use CTRLF+F to search.

Add popups in webmap

While QGIS will remain the place for detailed investigation of results, having some access to feature attributes could help with distinguishing multiple results for a given layer.
Pop-ups are probably easier to implement than unique attribute symbolization + legend.
And the data is already all there in the embedded json.

It's Been a While Since This Repository has Been Updated

This issue is a kind reminder that your repository has been inactive for 180 days. Some repositories are maintained in accordance with business requirements that infrequently change thus appearing inactive, and some repositories are inactive because they are unmaintained.

To help differentiate products that are unmaintained from products that do not require frequent maintenance, repomountie will open an issue whenever a repository has not been updated in 180 days.

  • If this product is being actively maintained, please close this issue.
  • If this repository isn't being actively maintained anymore, please archive this repository. Also, for bonus points, please add a dormant or retired life cycle badge.

Thank you for your help ensuring effective governance of our open-source ecosystem!

Lets use common phrasing

TL;DR ๐ŸŽ๏ธ

Teams are encouraged to favour modern inclusive phrasing both in their communication as well as in any source checked into their repositories. You'll find a table at the end of this text with preferred phrasing to socialize with your team.

Words Matter

We're aligning our development community to favour inclusive phrasing for common technical expressions. There is a table below that outlines the phrases that are being retired along with the preferred alternatives.

During your team scrum, technical meetings, documentation, the code you write, etc. use the inclusive phrasing from the table below. That's it - it really is that easy.

For the curious mind, the Public Service Agency (PSA) has published a guide describing how Words Matter in our daily communication. Its an insightful read and a good reminder to be curious and open minded.

What about the master branch?

The word "master" is not inherently bad or non-inclusive. For example people get a masters degree; become a master of their craft; or master a skill. It's generally when the word "master" is used along side the word "slave" that it becomes non-inclusive.

Some teams choose to use the word main for the default branch of a repo as opposed to the more commonly used master branch. While it's not required or recommended, your team is empowered to do what works for them. If you do rename the master branch consider using main so that we have consistency among the repos within our organization.

Preferred Phrasing

Non-Inclusive Inclusive
Whitelist => Allowlist
Blacklist => Denylist
Master / Slave => Leader / Follower; Primary / Standby; etc
Grandfathered => Legacy status
Sanity check => Quick check; Confidence check; etc
Dummy value => Placeholder value; Sample value; etc

Pro Tip ๐Ÿค“

This list is not comprehensive. If you're aware of other outdated nomenclature please create an issue (PR preferred) with your suggestion.

Improve navigation of summaries alongside map

Possible solution would be a fixed map section up top + scrolling panel below containing interest info.
Or map could be centered and interest information could be in a layer list-like panel on the right (show layer name + intersect area, w/ on/off switches and showing summary below on click)

Add missing topics

TL;DR

Topics greatly improve the discoverability of repos; please add the short code from the table below to the topics of your repo so that ministries can use GitHub's search to find out what repos belong to them and other visitors can find useful content (and reuse it!).

Why Topic

In short order we'll add our 800th repo. This large number clearly demonstrates the success of using GitHub and our Open Source initiative. This huge success means it's critical that we work to make our content as discoverable as possible. Through discoverability, we promote code reuse across a large decentralized organization like the Government of British Columbia as well as allow ministries to find the repos they own.

What to do

Below is a table of abbreviation a.k.a short codes for each ministry; they're the ones used in all @gov.bc.ca email addresses. Please add the short codes of the ministry or organization that "owns" this repo as a topic.

add a topic

That's it, you're done!!!

How to use

Once topics are added, you can use them in GitHub's search. For example, enter something like org:bcgov topic:citz to find all the repos that belong to Citizens' Services. You can refine this search by adding key words specific to a subject you're interested in. To learn more about searching through repos check out GitHub's doc on searching.

Pro Tip ๐Ÿค“

  • If your org is not in the list below, or the table contains errors, please create an issue here.

  • While you're doing this, add additional topics that would help someone searching for "something". These can be the language used javascript or R; something like opendata or data for data only repos; or any other key words that are useful.

  • Add a meaningful description to your repo. This is hugely valuable to people looking through our repositories.

  • If your application is live, add the production URL.

Ministry Short Codes

Short Code Organization Name
AEST Advanced Education, Skills & Training
AGRI Agriculture
ALC Agriculture Land Commission
AG Attorney General
MCF Children & Family Development
CITZ Citizens' Services
DBC Destination BC
EMBC Emergency Management BC
EAO Environmental Assessment Office
EDUC Education
EMPR Energy, Mines & Petroleum Resources
ENV Environment & Climate Change Strategy
FIN Finance
FLNR Forests, Lands, Natural Resource Operations & Rural Development
HLTH Health
IRR Indigenous Relations & Reconciliation
JEDC Jobs, Economic Development & Competitiveness
LBR Labour Policy & Legislation
LDB BC Liquor Distribution Branch
MMHA Mental Health & Addictions
MAH Municipal Affairs & Housing
BCPC Pension Corporation
PSA Public Service Agency
PSSG Public Safety and Solicitor General
SDPR Social Development & Poverty Reduction
TCA Tourism, Arts & Culture
TRAN Transportation & Infrastructure

NOTE See an error or omission? Please create an issue here to get it remedied.

Add project lifecycle badge

No Project Lifecycle Badge found in your readme!

Hello! I scanned your readme and could not find a project lifecycle badge. A project lifecycle badge will provide contributors to your project as well as other stakeholders (platform services, executive) insight into the lifecycle of your repository.

What is a Project Lifecycle Badge?

It is a simple image that neatly describes your project's stage in its lifecycle. More information can be found in the project lifecycle badges documentation.

What do I need to do?

I suggest you make a PR into your README.md and add a project lifecycle badge near the top where it is easy for your users to pick it up :). Once it is merged feel free to close this issue. I will not open up a new one :)

Double counting areas in summary stats

Area stats double (or more) count for overlapping polygons within the same query, resulting in exaggerated summary stats.
Examples on BCGW: Timber Supply Areas, First Nations Consultative Areas

Rename the plugin and create an icon

keywords to inform a name:

  • Intersect
  • Interest
  • Overlap
  • Search
  • Summary

names:

  • Intersector / Intersecter / Intersectr
  • ?

Icon:

  • Venn diagram
  • crosshairs

Improve error reporting for invalid layers

Several different types of issues with loading layers will be reported at the end of run as 'not validated layers'.
Providing more specific reporting would help improve UX. E.g. 'invalid input', 'no access', etc

Map: set initial zoom to extent

Set initial map zoom to AOI extent, not just center at zoom 10.

Use fit bounds. Search for centerLatLong in init.py to find where this is currently being sent over to the layout.

Map radio button shows wrong basemap on load

On report load, the layer radio button shows 'Topographic (D)', even though 'Topographic' is actually displayed first. To show Topo (D), it requires toggling to another basemap and then back to Topo (D).

what shows on load

this shows up on load

what should have been selected initially

this is what is should have shown

Of course this issue is only present when additional basemap layers are loaded.

Reports not given unique filenames

Report filename is determined based on when the processing algorithm is opened - not when it is run or completed.
As a result, opening the tool and running repeatedly (even with different configuration) will use the same filename and overwrite previous reports.

Add AOI validation

invalid AOI will fail to execute aoi = aoiSource.materialize(QgsFeatureRequest())

Should check geometry of aoiSource and fix geometry if necessary

move debug to debugpy

Need to add listener to debug method
import debugpy
debugpy.listen(("localhost", 5678))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.