Skip to content

Output vector layers of LargeScaleMeanShift have not a correct geometry according to GEOS

Description

Output vector layers of LargeScaleMeanShift have not a correct geometry according to GEOS, as implemented in rgeos. The layer can be fixed using geos tools. Same problem is found if -mode raster is used, followed by gdal_polygonize

Steps to reproduce

otbcli_LargeScaleMeanShift.bat -in QB_1_ortho.tif -spatialr 4 -ranger 80 -minsize 16 -tilesizex 256 -tilesizey 256 -cleanup 1 -mode.vector.out regions.shp

in R:

> require(rgeos)
> require(rgdal)
> v1 <- readOGR(dsn="D:/FLUXPYRetal/Navarra/SegNavarra", layer="regions")
> gIsValid(v2)
[1] FALSE
Warning message:
In RGEOSUnaryPredFunc(spgeom, byid, "rgeos_isvalid") :
  Ring Self-intersection at or near point 370624.65625896002 4831278.72278025
> v1f <- gSimplify(v1, tol = 0.00001)
> gIsValid(v1f)
[1] TRUE

Configuration information

OS, OTB version or tag, information related to build (binaries, superbuild, system libs ...)