Comments (13)
The difference with what I tried is that here you want to dissolve line features, right?
@ecodiv yes, right! And v.extract doesn't support aggregation by specific columns. So my task can't be done with GRASS.
@geografin I think it can be used, see #3433
from grass.
@geografin I can't reproduce the problem on GRASS 8.4.0 on Ubuntu 22.04, using aggregate_backend=sql.
from grass.
Thanks for reporting this. Can you please provide the code to reproduce ideally using the NC SPM sample dataset or other public data? The code can be just copied commands from the GUI if you are using it (there is Copy button in the tool dialog).
from grass.
v.dissolve input=over_geo column=subid aggregate_columns=a_length,a_source_elev,a_outlet_elev aggregate_methods=sum,max,min result_columns=LENGTH,SOURCE,OUTLET output=over_geo_diss --overwrite
This is the command that ends with error. The map taken is a simple rivers layers generated with r.stream.order and overlayed with subwatersheds vector with v.overlay
.
from grass.
I don't use GUI. I use bash linux with GRASS docker image (from main branch, the last one)
from grass.
Sorry @geografin what I meant was a minimal reproducible example. @ecodiv was not able to reproduce it, so I'm looking for a way to get the same data and situation you have. Bash is definitively better starting point than GUI, so that's great. Can you try to run relevant commands with the NC SPM sample dataset and share these commands?
from grass.
Well. So take NorthCarolina dataset (full) and reproduce (I copy some maps form the dataset, that are identical to mine by type):
g.copy vect=roadsmajor,streams_init --overwrite
g.copy vect=zipcodes_wake,geodata_subbasins --overwrite
v.overlay ainput=streams_init binput=geodata_subbasins operator=and atype=line output=over_geo --overwrite
v.db.addcolumn map=over_geo columns="subid VARCHAR(15),maindown VARCHAR(15)"
v.db.update map=over_geo column=subid query_column="CAST(b_ZIPCODE_ID AS varchar)" where="b_ZIPCODE_ID <> 'N/A'"
v.dissolve input=over_geo column=subid aggregate_columns=a_SHAPE_LEN aggregate_methods=sum result_columns=LENGTH output=over_geo_diss --overwrite --verbose
This results in error:
ERROR: There is no table connected to <over_geo_diss>. Run v.db.connect or
v.db.addtable first.
ERROR: A processing step failed. Check the above error messages and see the
following details:
Module run `v.db.addcolumn map=over_geo_diss layer=1 columns=LENGTH
DOUBLE` ended with an error.
The subprocess ended with a non-zero return code: 1. See errors
above the traceback or in the error output.
That is the error I am talking about. Use --verbose flag in the last command to see that the error is caused by v.reclass which creates a new database table.
from grass.
@geografin I can confirm the example results in the reported error. The difference with what I tried is that here you want to dissolve line features, right?
@wenzeslaus The manual exclusively refers to polygon data. Is this function supposed to be able to dissolve line features?
from grass.
...Is this function supposed to be able to dissolve line features?
Thanks for looking into this. I didn't dive into that and focused on the attribute aggregation, so I don't know from top of my head. The geometrical part is taken care of by v.reclass and v.extract, so you can check those. The lines in v.dissolve are:
gs.run_command(
"v.reclass",
input=input_vector,
output=tmpfile,
layer=layer,
column=column,
)
gs.run_command(
"v.extract",
flags="d",
input=tmpfile,
output=output,
type="area",
layer=layer,
)
from grass.
...Is this function supposed to be able to dissolve line features?
Thanks for looking into this. I didn't dive into that and focused on the attribute aggregation, so I don't know from top of my head. The geometrical part is taken care of by v.reclass and v.extract, so you can check those. The lines in v.dissolve are:
gs.run_command( "v.reclass", input=input_vector, output=tmpfile, layer=layer, column=column, ) gs.run_command( "v.extract", flags="d", input=tmpfile, output=output, type="area", layer=layer, )
Without having tested it, the type="area" might be the problem?
from grass.
Without having tested it, the type="area" might be the problem?
Haha, that sure looks like that! Maybe deleting it will do trick?
from grass.
The difference with what I tried is that here you want to dissolve line features, right?
@ecodiv yes, right! And v.extract doesn't support aggregation by specific columns. So my task can't be done with GRASS.
from grass.
#3433 will be merged in following hours when the CI is done testing it. Thanks @ecodiv for the update!
from grass.
Related Issues (20)
- Rules about which issues and pull requests should have which milestone HOT 2
- [Bug] t.register: registering vector maps from other mapsets writes cruft in the current mapset
- [Bug] r.horizon: test fails on Mac with arm64 HOT 2
- [Bug] r3.flow: test fails on Mac with arm64 HOT 6
- [Bug] Docker builds don't seem successful HOT 2
- [Help needed] Adjusting build for code coverage HOT 3
- PYTHONHOME conflict in using gdb to debug GRASS GIS C modules on Windows 11 HOT 1
- [Feat] g.region: implement standalone flat flag in g.region HOT 1
- g.region: revision of output formats HOT 3
- [Bug] `g.proj` output is not flushed to stdout when redirected in Windows
- [Bug] Profile Analysis Tool Segment break points position HOT 4
- [Feat] temporal: allow appending to existing STDS
- [Feat] Packaging: include all version data in tarball
- [Bug] libgrass_gis missing dependency on libgrass_datetime HOT 3
- [Feat] jupyter: Support custom CRS with Proj4Leaflet HOT 1
- [Bug] GRASS won't start for unknown locale HOT 12
- r.horizon: finishing each raster after every step HOT 1
- [Help-needed] Properly handle pyc files in makefiles
- [Bug] Cannot remove/overwrite corrupt vector maps
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grass.