Trouble using gdal utilities in python

المشرف العام

Administrator
طاقم الإدارة
I am trying to use gdal utilities like gdal_polygonize in python to polygonize my raster image but I'm having trouble understanding the commands. What I mean is in some places the command is of the given form say:

gdal.Polygonize( srcband, None, dst_layer, -1, [], callback=None )I found it here

And the command is also called in python with os.system().

I read and tried to implement commands from Gdal_polygonize: How to filter pixels above a given value (elevation)?

gdal_polygonize.py result.tif result.shpand python gdal_polygonize error

os.system('gdal_polygonize.py ' + filename + ' -f "ESRI Shapefile" ' + shapefile)but no shapefile is created although there was no error while running the code.

I am stuck and having great trouble learning to use gdal with python as I don't understand the need or difference between the two types of command. Please address my question.

What is the proper systax for using (lets say) gdal_calc.py when called with os.system() and also when used as gdal_calc() ?

P.s I use python 2.7 on win 8.1 platform.



أكثر...
 
أعلى