I'm trying to extract poligons with pixel values from a raster using the function: rsgislib.vectorutils.polygoniseRaster2VecLyr()
But entering the required parameters does not start by returning the following message:
outvec="C:\Users\output.shp"
outlyr="test"
vecdrv="ESRI Shapefile"
inputImg='C:\\Users\rsgislib_seg\input.tif'
#(raster with 5 bands)
I threw:
rsgislib.vectorutils.polygoniseRaster2VecLyr(outlyr,outvec,vecdrv,inputImg,imgBandNo=5,pxl_val_fieldname = 'VAL')
Showing the following error:
Warning 6: dataset C:\Users\input.shp does not support layer creation option OVERWRITE
Polygonising...
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Anaconda3\envs\rsgislib\lib\site-packages\rsgislib\vectorutils_init_.py",
line 373, in polygoniseRaster2VecLyr
gdal.Polygonize(imgBand, imgMaskBand, outLayer, dstFieldIdx, [], callback=gdal.TermProgress)
File "C:\Users\Anaconda3\envs\rsgislib\lib\site-packages\osgeo\gdal.py", line 3130, in Polygonize
return _gdal.Polygonize(*args, **kwargs)
RuntimeError: Object given is not a Python function
How can I do?
Thank's, Vincenzo
--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rsgislib-support/3729e5be-d290-4336-8ed5-7bf824136a25%40googlegroups.com.
from rsgislib import zonalstats
inputImage = '/home/ubuntu/input.tif' inputVector = '/home/ubuntu/input_vector.shp' outputVector = '/home/ubuntu/zonal_stats.shp' zonalattributes = zonalstats.ZonalAttributes(calcMean=True, calcStdDev=True) zonalstats.pixelStats2SHP(inputImage, inputVector, outputVector, zonalattributes, False, True, True, zonalstats.METHOD_POLYCONTAINSPIXELCENTER)
Receiving:
Segmentation error (core dump created)
How can I do that?
Pete
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib...@googlegroups.com.