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

[processing] add area report to raster layer unique values algorithm #5334

Merged
merged 1 commit into from
Oct 10, 2017

Conversation

nirvn
Copy link
Contributor

@nirvn nirvn commented Oct 10, 2017

Description

This PR adds area alongside pixel count to the raster unique values countreport algorithm.

As indicated above, I've renamed the algorithm since it now does more than counting pixels.

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and containt sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

Copy link
Collaborator

@nyalldawson nyalldawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "Raster Layer Statistics" be a better name here?

@@ -0,0 +1,29 @@
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"/></head><body>
<p>Analyzed file: /home/webmaster/dev/cpp/QGIS/python/plugins/processing/tests/testdata/raster.tif (band 1)</p>
<p>Extent: 270736.0673250681720674,4458888.9563983473926783 : 270899.8544675338780507,4459029.5745217483490705</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be handy to export all these extra properties as outputs from the alg too, so they could be used in later model steps

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson , you tink so? Which one(s) would you like to be exposed? TOTAL_PIXEL_COUNT, and NODATA_COUNT?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expose ALL the things!

Extent, projection (as authid), all the numeric values

They could all be potentially reused later in a model

@nirvn
Copy link
Contributor Author

nirvn commented Oct 10, 2017

@nyalldawson , "raster layer statistics" is already taken by an algorithm that provides basic stats for a given raster layer band.

Using report is a nod to GRASS' r.report module, which provides unique value count & area values too.

@nirvn
Copy link
Contributor Author

nirvn commented Oct 10, 2017

@nyalldawson , however, I should probably add statistic as a keyword for this alg.

@nirvn
Copy link
Contributor Author

nirvn commented Oct 10, 2017

@nyalldawson , comments addressed in the updated commit. Thanks.

@nyalldawson
Copy link
Collaborator

Looks good!

@nirvn nirvn merged commit 61dcba4 into qgis:master Oct 10, 2017
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

Successfully merging this pull request may close these issues.

2 participants