-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
v.dissolve: Compute attribute aggregate statistics #2388
Conversation
This depends on JSON output in #2386. |
1c6fe46
to
e440269
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wenzeslaus Overall, it looks good to me. Just have a few minor comments.
I made some significant updates. The interface is now tailored for two different use cases, one for interactive use, when a lot of things happen automatically and then the other one for scripting when user is expected to be very explicit about what should be computed. This is now described in the documentation. I resolved some of the comments after writing a comment with resolution, but some may still require some discussion. Thank you for the feedback, @HuidaeCho. |
Should the option names be in singular or plural? For this module, it is Is it singular as in: r.patch input=aaa,bbb,ccc output=xxx
v.patch input=aaa,bbb,ccc output=xxx
g.list type=raster,vector or plural as in: v.db.select map=aaa columns=xxx,yyy
v.db.addcolumn map=aaa columns="xxx double precision,yyy integer"
v.db.addtable map=aaa columns="xxx double precision,yyy integer" ? Singular versus plural in option namesThe following does not include more special options in terms of use of singular and plural such as cats, coordinates or GDAL options. Standard optionsStandard options with multiple set to yes.
Notes: G_OPT_V_OUTPUTS does not exist, but given the other ones, it would be output. There is many temporal options, but they are not used that much as the other ones: all combined are used 10 times while just G_OPT_V_INPUTS is used 5 times and G_OPT_R3_INPUTS 3 times. Vector modules in CC modules with
Python modulesPython modules with
|
1f7058f
to
d2cd66f
Compare
d2cd66f
to
b646272
Compare
b646272
to
d14d6f2
Compare
While this could be faster or parallel, the aggregation works well for simple cases and can deal with some complex cases, too. From my perspective, this is ready to be merged right after #3090. |
In addition to geometry dissolving, compute aggregate statistics for the attribute values of dissolved features with v.db.univar. Requires v.db.univar JSON output. v.db.select with group is used to obtain unique values of the column the dissolving is based on. Add column and update now happens for every value, column, and statistics.
…supported in the rest of the code), test
…rom the main function. Remove global variables. Use PID and node name for the temporary vector.
…y dev null in cleanup code. Modernize and Pylint generic error message.
…ractive) result column handling
… v.db.select columns)
…s checks. Now depends on v.db.select producing the list of column names OSGeo#3090. Test and example included.
7cd9500
to
be56efd
Compare
Issues addressed, code changed significantly, review is no longer relevant.
In addition to geometry dissolving, compute aggregate statistics for the attribute values of dissolved features with v.db.univar and SQL. v.db.select with group is used to obtain unique values of the column the dissolving is based on. Add column and update now happens for every value, column, and statistics. Originally implemented with v.db.univar only because it has a good set of functions, but direct SQL is faster and potentially can have more functions (although default SQLite has less). Auto-generates names and combinations of column-method for convenience, but when all needed parameters are provided, uses them as is. Has documentation, examples, image for original functionality, and test (image generated in notebook). Uses plural for columns and methods. Removes duplicate columns and methods for non-explicit automatic (interactive) result column handling. Support SQL expressions as columns (as in v.db.update query_column or v.db.select columns). Supports general SQL syntax just like v.db.select for the price of less checks. Supports also text-returning aggregate functions and functions with multiple parameters such as SQLite group_concat. Supports any layer, not just 1, for attributes. Uses a simple SQL escape function to double single quotes. Requires v.db.univar JSON output and v.db.select column info in JSON output. Handles cleanup from the main function. Removes global variables. Uses PID and node name for the temporary vector. Partially modernizes the existing code by using gs alias instead of grass alias. Improves author lists.
In addition to geometry dissolving, compute aggregate statistics for the attribute values of dissolved features with v.db.univar and SQL. v.db.select with group is used to obtain unique values of the column the dissolving is based on. Add column and update now happens for every value, column, and statistics. Originally implemented with v.db.univar only because it has a good set of functions, but direct SQL is faster and potentially can have more functions (although default SQLite has less). Auto-generates names and combinations of column-method for convenience, but when all needed parameters are provided, uses them as is. Has documentation, examples, image for original functionality, and test (image generated in notebook). Uses plural for columns and methods. Removes duplicate columns and methods for non-explicit automatic (interactive) result column handling. Support SQL expressions as columns (as in v.db.update query_column or v.db.select columns). Supports general SQL syntax just like v.db.select for the price of less checks. Supports also text-returning aggregate functions and functions with multiple parameters such as SQLite group_concat. Supports any layer, not just 1, for attributes. Uses a simple SQL escape function to double single quotes. Requires v.db.univar JSON output and v.db.select column info in JSON output. Handles cleanup from the main function. Removes global variables. Uses PID and node name for the temporary vector. Partially modernizes the existing code by using gs alias instead of grass alias. Improves author lists.
In addition to geometry dissolving, compute aggregate statistics for the attribute values of dissolved features with v.db.univar and SQL.
v.db.select with group is used to obtain unique values of the column the dissolving is based on. Add column and update now happens for every value, column, and statistics.
Originally implemented with v.db.univar only because it has a good set of functions, but direct SQL is faster and potentially can have more functions (although default SQLite has less).
Auto-generates names and combinations of column-method for convenience, but when all needed parameters are provided, uses them as is.
Has documentation, examples, image for original functionality, and test (image generated in notebook).
Uses plural for columns and methods.
Removes duplicate columns and methods for non-explicit automatic (interactive) result column handling.
Support SQL expressions as columns (as in v.db.update query_column or v.db.select columns). Supports general SQL syntax just like v.db.select for the price of less checks. Supports also text-returning aggregate functions and functions with multiple parameters such as SQLite group_concat. Supports any layer, not just 1, for attributes.
Uses a simple SQL escape function to double single quotes.
Requires v.db.univar JSON output and v.db.select column info in JSON output.
Handles cleanup from the main function. Removes global variables. Uses PID and node name for the temporary vector. Partially modernizes the existing code by using gs alias instead of grass alias. Improves author lists.