Bug report #13592

Processing: `r.to.vect` and `v.generalize` fail

Added by Paolo Cavallini almost 5 years ago. Updated over 4 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/GRASS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:21634

Description

r.to.vect input=tmp1444762289725 type=area output=outputb0d6bd9d340c4c829513101f45f91968 --overwrite
v.out.ogr -c -s -e input=outputb0d6bd9d340c4c829513101f45f91968 type=auto output="/tmp/processing/8a519603d75a423fa510b0d2a9e24e48" format=ESRI_Shapefile olayer=output

basin_toscana.tif.zip (86.6 KB) Paolo Cavallini, 2015-10-13 11:32 PM

qgis2_10_processing_r_to_vect_toscana.jpg - basin_toscana.tif vectorized (206 KB) Markus Neteler, 2015-10-18 10:28 AM

lixo_.mp4 (1.62 MB) Giovanni Manghi, 2015-11-08 04:39 AM

History

#1 Updated by Paolo Cavallini almost 5 years ago

Strangely enough, an apparently unrelated module (v.generalize) also creates an empty shapefile.
This is the command:
processing.runalg("grass7:v.generalize","/home/paolo/Scrivania/analisi/QGIS_data/processing/iterative/watersheds.shp",0,30,7,50,0.5,3,0,0,0,1,1,1,False,True,"262871.525725,277846.525725,4454025.0,4464275.0",-1,0.0001,0,None)

#2 Updated by Paolo Cavallini almost 5 years ago

  • Subject changed from Processing: `r.to.vect` fails to Processing: `r.to.vect` and `v.generalize` fail

#3 Updated by Markus Neteler almost 5 years ago

This issue is not clear to me. Can you point me to a simple test case?

Eg using test data from here: http://grassbook.org/datasets/datasets-3rd-edition/
--> Data in common GIS formats (NC data set):
--> SHP/GeoTIFF

#4 Updated by Paolo Cavallini almost 5 years ago

In fact, basin_50k.tif works fine. With the attached file it does not. If I cut a portion of it, it works again.

#5 Updated by Paolo Cavallini almost 5 years ago

It does not work with the data provided for the Processing tutorial as well.

http://qgis.org/downloads/data/training_manual_exercise_data.zip

#6 Updated by Paolo Cavallini almost 5 years ago

Check e.g. v.generalize on the `iterative` project.

#7 Updated by Markus Neteler almost 5 years ago

Paolo Cavallini wrote:

In fact, basin_50k.tif works fine. With the attached file it does not. If I cut a portion of it, it works again.

I have tried, works fine here. Screenshot attached.

#8 Updated by Paolo Cavallini almost 5 years ago

Thanks Markus for testing. Unclear what's happening (different GRASS version?).
Local issues not very likely (clean .qgis2, packages from official repos).
Here the log (note the ERROR: the layer exists in OGR origin; so it may be a Processing error):

0..2..4..6..8..10..12..14..16..18..20..22..24..26..28..30..32..34..36..38..40..42..44..46..48..50..52..54..56..58..60..62..64..66..68..70..72..74..76..78..80..82..84..86..88..90..92..94..96..98..100
176 areas built
One isle built
Isole allegate...
100
Centroidi allegati...
1..3..5..7..9..11..13..15..17..19..21..23..25..27..29..31..33..35..37..39..41..43..45..47..49..51..53..55..57..59..61..63..65..67..69..71..73..75..77..79..81..83..85..87..89..91..93..95..97..99..100
Numero di nodi: 270
Numero di primitive: 620
Numero di punti: 0
Numero di linee: 0
Numero di confini: 445
Numero di centroidi: 175
Numero di aree: 176
Numero di isole: 1
r.to.vect completo.
ATTENZIONE: The map contains islands. With the -c flag, islands will appear as filled areas, not holes in the output map.
Exporting 176 areas (may take some time)...
5..11..17..23..29..35..41..47..53..59..65..71..Segmentation fault
Esecuzione di '/home/paolo/Scrivania/analisi/config/processing/grass7_batch_job.sh' terminata.
Cleaning up temporary files...
Cleaning up temporary files...
Sto avviando GRASS GIS...
Sto eseguendo '/home/paolo/Scrivania/analisi/config/processing/grass7_batch_job.sh'...
ATTENZIONE: The map contains islands. With the -c flag, islands will appear as filled areas, not holes in the output map.
ERRORE: Il tematismo esiste già nell'origine dati OGR '/tmp/processingbb7ba8b2aa2042e4bdd2924383429d72/e13087a2923d4f8e81c545fffcd6f883'
Esecuzione di '/home/paolo/Scrivania/analisi/config/processing/grass7_batch_job.sh' terminata.
Cleaning up temporary files...

#9 Updated by Markus Neteler almost 5 years ago

Please post the output of your GRASS GIS version (g.version -g).

The "ERRORE: Il tematismo esiste già nell'origine dati OGR ..." looks like leftover file. You could try to set

export GRASS_OVERWRITE=1

to override that file.

#10 Updated by Paolo Cavallini almost 5 years ago

Thanks. Done, no change.

#11 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Open to Feedback

No issues whatsoever with any of the above datasets. QGIS master, GRASS 7.

#12 Updated by Paolo Cavallini almost 5 years ago

OK, got some more info:

  • same issue with other commands, in particular v.buffer
  • this might be due to issue with projections:

ATTENZIONE: Datum non riconosciuto da GRASS e nessun parametro trovato
Default region was updated to the new projection, but if you have multiple mapsets `g.region -d` should be run in each to update the region from the default
Informazioni sulla proiezione aggiornate

#13 Updated by Giovanni Manghi almost 5 years ago

Paolo Cavallini wrote:

OK, got some more info:

  • same issue with other commands, in particular v.buffer
  • this might be due to issue with projections:

ATTENZIONE: Datum non riconosciuto da GRASS e nessun parametro trovato
Default region was updated to the new projection, but if you have multiple mapsets `g.region -d` should be run in each to update the region from the default
Informazioni sulla proiezione aggiornate

no problems here also with v.buffer.

As for the r.to.vect issue, qgis master (processing too), G7, on both Windows and Linux.

#14 Updated by Paolo Cavallini almost 5 years ago

It seems a problem with projections (it happened before, probably resurfaced here).

#15 Updated by Paolo Cavallini almost 5 years ago

  • Status changed from Feedback to Open
Checked again, I can confirm it on a clean 2.12 install. Steps to reproduce:
  • open iterative/watersheds.shp from processing training data (link above)
  • rasterize it with Processing>GDAL
  • r.to.vect returns an empty vector, with unrecognised CRS (in Properties>General it shows "Selected CRS", in metadata +proj=utm +zone=30 +ellps=intl +units=m +no_defs)

#16 Updated by Giovanni Manghi almost 5 years ago

  • File lixo_.mp4 added
  • Status changed from Open to Feedback

I cannot confirm the issue, on a clean 2.12 install on both Linux and Windows. See attached screencast.

There are two known issues anyway:

1) Processing/GRASS tools strips towgs84 parameters from outputs CRSs, creating pratically custom CRSs

#13792

2) Custom CRSs are not recognized by QGIS the first time a layer is loaded in a project

#11884

#17 Updated by Giovanni Manghi almost 5 years ago

Giovanni Manghi wrote:

I cannot confirm the issue, on a clean 2.12 install on both Linux and Windows. See attached screencast.

tested on several other machines (both Windows and Linux) and no issues (no empty result).

#18 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Feedback to Closed
  • Resolution set to worksforme

closing for lack of feedback.

#19 Updated by Paolo Cavallini almost 5 years ago

  • Status changed from Closed to Reopened

Have you tested with the same data? The problem is still present, so it warrants deeper investigation. I'll test with master, please leave it open.

#20 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Reopened to Feedback
  • Resolution deleted (worksforme)

Paolo Cavallini wrote:

Have you tested with the same data?

I had, on both Linux and Windows, with different QGIS and Processing versions, and no issues whatsoever.

#21 Updated by Giovanni Manghi almost 5 years ago

Paolo Cavallini wrote:

Have you tested with the same data? The problem is still present

anyway if a ticket is in feedback state it is up to the reporter to leave further details and/or do more tests. We have a 15 days reply feedback, and I'm using it to clean a bit the tracker.

#22 Updated by Giovanni Manghi almost 5 years ago

Paolo Cavallini wrote:

Have you tested with the same data? The problem is still present, so it warrants deeper investigation. I'll test with master, please leave it open.

tested again and again no issues on two different OS on two different computers with different QGIS/Processing releases.

Please try again also on other systems to avoid local issues.

There are two issues anyway that are not related to the one described in #13592-16

please do more tests and leave feedback.

#23 Updated by Giovanni Manghi over 4 years ago

  • Status changed from Feedback to Closed
  • Resolution set to not reproducable

one last test, on qgis master, both modules on grass 6 and 7, on both linux and windows, no issues.

If you have data that is problematic (not the attached one or the training manual one, that is ok) and given that is not a GRASS problem, please reopen this ticket.

See also #11884 and #13792

that are two separate issues from the apparent described here (Processing/GRASS modules failing)

Also available in: Atom PDF