[GRASS-dev] [GRASS GIS] #3387: r.to.vect fails on a properly thinned tif via r.thin/r.null

GRASS GIS trac at osgeo.org
Thu Aug 3 11:39:29 PDT 2017


#3387: r.to.vect fails on a properly thinned tif via r.thin/r.null
---------------------+-------------------------
 Reporter:  hbgdal   |      Owner:  grass-dev@…
     Type:  defect   |     Status:  new
 Priority:  normal   |  Milestone:
Component:  Default  |    Version:  7.2.0
 Keywords:           |        CPU:  Unspecified
 Platform:  Linux    |
---------------------+-------------------------
 Hi, This happens only on a small number of tif files. Most of the tif
 files are processed successfully. Commands to reproduce problem with 7.2.0
 are pasted below. I would appreciate any workaround/patch(for 7.2.0 or any
 other version)  for this fix.

 Problem:
 For some tifs, the r.to.vect fails complaining that the image needs to be
 thinned, and then hangs with a message about busy SQLite DB.

 Expected behavior:
 Either r.to.vect should extract lines from thinned image, or r.thin should
 thin the image further.

 Env:
 Ubuntu 14.04. 7.2.0 compiled

 Commands to run:
 #This is "binary" image with two colors black and white
 r.in.gdal input=/tmp/grass_problem.tif output=grass_problem
 location=grass_problem

 #Replace "white" color with null for r.thin.
 r.null --verbose map=grass_problem at PERMANENT setnull=255

 #r.thin succeeds in less than 10 iterations.(See output below)
 r.thin --verbose input=grass_problem at PERMANENT output=grass_thin

 #r.to.vect complains.
 r.to.vect --verbose input=grass_thin at PERMANENT output=vec_lines type=line


 ===== r.thin output showing success ====
 Raster map <grass_problem at PERMANENT> - 4028 rows X 3288 columns
 Bounding box:  l = 3, r = 3284, t = 7, b = 4028
 Pass number 1
 Deleted 240415 pixels
 Pass number 2
 Deleted 5154 pixels
 Pass number 3
 Deleted 115 pixels
 Pass number 4
 Deleted 5 pixels
 Pass number 5
 Deleted 0 pixels
 Thinning completed successfully.
 Output map 4028 rows X 3288 columns
 Window 4028 rows X 3288 columns
 (Thu Aug  3 11:17:10 2017) Command finished (2 sec)

 === r.to.vect output showing failure ===

 r.to.vect --verbose input=grass_thin at PERMANENT output=vec_lines type=line
 Using native format
 Extracting lines...
 Crowded cell at (362.125000, 12883.540000): row 424, col 1721, count 7
 ERROR: Raster map is not thinned properly.
 Please run r.thin.
 WARNING: Busy SQLITE db, already waiting for 10 seconds.
 ....

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3387>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list