0

I was trying to clean by removing sliver lines between set of polygons in my KML file. But unfortunately I am getting following error:

QGIS version: 3.14.15-Pi
QGIS code revision: d5114d2cfa
Qt version: 5.11.2
GDAL version: 3.0.4
GEOS version: 3.8.1-CAPI-1.13.3
PROJ version: Rel. 6.3.2, May 1st, 2020
Processing algorithm…
Algorithm 'v.clean' starting…
Input parameters:
{ '-b' : False, '-c' : False, 'GRASS_MIN_AREA_PARAMETER' : 0.0001, 'GRASS_OUTPUT_TYPE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'GRASS_SNAP_TOLERANCE_PARAMETER' : 1, 'GRASS_VECTOR_DSCO' : '', 'GRASS_VECTOR_EXPORT_NOCAT' : False, 'GRASS_VECTOR_LCO' : '', 'error' : 'TEMPORARY_OUTPUT', 'input' : 'memory://MultiPolygonZ?crs=EPSG:4326&field=Name:string(0,0)&field=description:string(0,0)&field=timestamp:datetime(0,0)&field=begin:datetime(0,0)&field=end:datetime(0,0)&field=altitudeMode:string(0,0)&field=tessellate:integer(0,0)&field=extrude:integer(0,0)&field=visibility:integer(0,0)&field=drawOrder:integer(0,0)&field=icon:string(0,0)&uid={b42a2f19-1fa1-47f8-b165-7ca7dd6fd651}', 'output' : 'TEMPORARY_OUTPUT', 'threshold' : '', 'tool' : [0], 'type' : [0,1,2,3,4,5,6] }

g.proj -c proj4="+proj=longlat +datum=WGS84 +no_defs"
v.in.ogr min_area=0.0001 snap=1.0 input="C:\Users\Administrator\AppData\Local\Temp\processing_oQspqW\d760590c414246c889fbe8b2e6cb1909\input.shp" output="vector_5f941a888fecf5" --overwrite -o
g.region n=11.33889471711012 s=11.13167449885797 e=76.17858259071603 w=75.95686615763981
v.clean input=vector_5f941a888fecf5 type="point,line,boundary,centroid,area,face,kernel" tool="break" output=output4520ba735e2844949715fdd7de593a69 error=error4520ba735e2844949715fdd7de593a69 --overwrite
v.out.ogr type="auto" input="output4520ba735e2844949715fdd7de593a69" output="C:\Users\Administrator\AppData\Local\Temp\processing_oQspqW\fe8e3a7a942f4771a7c8f7c208ddd4e0\output.gpkg" format="GPKG" --overwrite
v.out.ogr type="auto" input="error4520ba735e2844949715fdd7de593a69" output="C:\Users\Administrator\AppData\Local\Temp\processing_oQspqW\cd3d13f42e84401eb6f7d9533948c72d\error.gpkg" format="GPKG" --overwrite
Starting GRASS GIS...
WARNING: Concurrent mapset locking is not supported on Windows
Cleaning up temporary files...
Executing <C:\Users\Administrator\AppData\Local\Temp\processing_oQspqW\grassdata\grass_batch_job.cmd> ...
C:\Users\Administrator\Documents>chcp 1252 1>NUL
C:\Users\Administrator\Documents>g.proj -c proj4="+proj=longlat +datum=WGS84 +no_defs"
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
Projection information updated
C:\Users\Administrator\Documents>v.in.ogr min_area=0.0001 snap=1.0 input="C:\Users\Administrator\AppData\Local\Temp\processing_oQspqW\d760590c414246c889fbe8b2e6cb1909\input.shp" output="vector_5f941a888fecf5" --overwrite -o
Over-riding projection check
Check if OGR layer <input> contains polygons...
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
Creating attribute table for layer <input>...
Importing 151 features (OGR layer <input>)...
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
-----------------------------------------------------
Registering primitives...
-----------------------------------------------------
Cleaning polygons
-----------------------------------------------------
Snapping boundaries (threshold = 1.000e+000)...
Reading features...
Snap vertices Pass 1: select points
0..3..6..9..12..15..18..21..24..27..30..33..36..39..42..45..48..51..54..57..60..63..66..69..72..75..78..81..84..87..90..93..96..99..100
Snap vertices Pass 2: assign anchor vertices
4..9..14..19..24..29..34..39..44..49..54..59..64..69..74..79..84..89..94..99..100
Snap vertices Pass 3: snap to assigned points
0..3..6..9..12..15..18..21..24..27..30..33..36..39..42..45..48..51..54..57..60..63..66..69..72..75..78..81..84..87..90..93..96..99..100
-----------------------------------------------------
Breaking polygons...
Breaking polygons (pass 1: select break points)...
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
Breaking polygons (pass 2: break at selected points)...
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
-----------------------------------------------------
Removing duplicates...
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
-----------------------------------------------------
Breaking boundaries...
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
-----------------------------------------------------
Removing duplicates...
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
-----------------------------------------------------
Cleaning boundaries at nodes...
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
-----------------------------------------------------
Merging boundaries...
2..5..8..11..14..17..20..23..26..29..32..35..38..41..44..47..50..53..56..59..62..65..68..71..74..77..80..83..86..89..92..95..98..100
-----------------------------------------------------
Removing dangles...
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
-----------------------------------------------------
Building areas...
0..-----------------------------------------------------
Removing bridges...
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
-----------------------------------------------------
Registering primitives...
-----------------------------------------------------
Finding centroids for OGR layer <input>...
0..3..6..9..12..15..18..21..24..27..30..33..36..39..42..45..48..51..54..57..60..63..66..69..72..75..78..81..84..87..90..93..96..99..100
-----------------------------------------------------
Writing centroids...
-----------------------------------------------------
227 input polygons
Total area: 0 (0 areas)
-----------------------------------------------------
Copying features...
Building topology for vector map <vector_5f941a888fecf5@PERMANENT>...
Registering primitives...
-----------------------------------------------------
227 input polygons got lost during import.
The snapping threshold 1 might be too large.
Estimated range of snapping threshold: [0, 0]
Try to reduce the snapping threshold or clean the output manually.
C:\Users\Administrator\Documents>g.region n=11.33889471711012 s=11.13167449885797 e=76.17858259071603 w=75.95686615763981
C:\Users\Administrator\Documents>v.clean input=vector_5f941a888fecf5 type="point,line,boundary,centroid,area,face,kernel" tool="break" output=output4520ba735e2844949715fdd7de593a69 error=error4520ba735e2844949715fdd7de593a69 --overwrite
Note: In latitude-longitude coordinate system specify threshold in degree unit
--------------------------------------------------
Tool: Threshold
Break: 0
--------------------------------------------------
Copying features...
Rebuilding parts of topology...
Building topology for vector map <output4520ba735e2844949715fdd7de593a69@PERMANENT>...
Registering primitives...
--------------------------------------------------
Tool: Break lines at intersections
100
--------------------------------------------------
Rebuilding topology for output vector map...
Building topology for vector map <output4520ba735e2844949715fdd7de593a69@PERMANENT>...
Registering primitives...
--------------------------------------------------
Building topology for error vector map...
Building topology for vector map <error4520ba735e2844949715fdd7de593a69@PERMANENT>...
Registering primitives...
C:\Users\Administrator\Documents>v.out.ogr type="auto" input="output4520ba735e2844949715fdd7de593a69" output="C:\Users\Administrator\AppData\Local\Temp\processing_oQspqW\fe8e3a7a942f4771a7c8f7c208ddd4e0\output.gpkg" format="GPKG" --overwrite
WARNING: Unable to determine input map's vector feature type(s).
WARNING: Vector map <output4520ba735e2844949715fdd7de593a69> is 3D. Use format specific layer creation options (parameter 'lco') to export <in 3D rather than 2D (default).
WARNING: Output layer is empty, no features written
v.out.ogr complete. 0 features (Unknown (any) type) written to <output4520ba735e2844949715fdd7de593a69> (GPKG format).
C:\Users\Administrator\Documents>v.out.ogr type="auto" input="error4520ba735e2844949715fdd7de593a69" output="C:\Users\Administrator\AppData\Local\Temp\processing_oQspqW\cd3d13f42e84401eb6f7d9533948c72d\error.gpkg" format="GPKG" --overwrite
WARNING: Unable to determine input map's vector feature type(s).
WARNING: Vector map <error4520ba735e2844949715fdd7de593a69> is 3D. Use format specific layer creation options (parameter 'lco') to export <in 3D rather than 2D (default).
WARNING: No attribute table found -> using only category numbers as attributes
WARNING: Output layer is empty, no features written
v.out.ogr complete. 0 features (Unknown (any) type) written to <error4520ba735e2844949715fdd7de593a69> (GPKG format).
C:\Users\Administrator\Documents>exit
Execution of <C:\Users\Administrator\AppData\Local\Temp\processing_oQspqW\grassdata\grass_batch_job.cmd> finished.
Cleaning up default sqlite database ...
Cleaning up temporary files...
Execution completed in 122.02 seconds
Results:
{'error': 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\processing_oQspqW\\cd3d13f42e84401eb6f7d9533948c72d\\error.gpkg',
'output': 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\processing_oQspqW\\fe8e3a7a942f4771a7c8f7c208ddd4e0\\output.gpkg'}

Loading resulting layers
Algorithm 'v.clean' finished
  • "I'm getting following error." - which one actually? Note that v.clean creates two maps: one with the clean vectors, on with the error vectors. See grass.osgeo.org/grass-stable/manuals/v.clean.html – markusN Oct 24 at 12:45
  • Welcome to GIS:SE @Manoj K E Manoj. analyzing the log from v.clean I saw these lines of information: g.proj -c proj4="+proj=longlat +datum=WGS84 +no_defs" and g.region n=11.33889471711012 s=11.13167449885797 e=76.17858259071603 w=75.95686615763981, this way, I suposed that your kml data is in an geographic coordinate system, it's right? – Francisco Camello Oct 24 at 17:01
  • So, moving along, I've found another interesting line in your log: 227 input polygons got lost during import. The snapping threshold 1 might be too large. This message means that your data was snapping/cleaning with 1 degree of distance (111.32 km +-), in other words, it's ripping out all of your data. I suggest you convert your data to UTM coordinate system or try to put a little tiny value in the threshold field (0.0001° = 11.1 m e.g.) to see if it produces any results. – Francisco Camello Oct 24 at 17:09
  • @FranciscoCamello Yes, this is a geographic system with multiple polygon. I tried by giving threshold as .001. But no result. – Manoj K E Manoj Oct 25 at 4:39
  • I'm not sure what you mean by "removing sliver line". The v.clean tool has a method called rmsa = remove small angles between lines at nodes. In your v.clean command above you are asking for only one clean command break. I doubt that is what you want here. And, as Francisco Camello pointed out, you will definitely need to add the threshold parameter to v.clean with some very small value, appropriate to the features in your layer. – Micha Oct 25 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.