Python script to convert raster pixels to points
- Status: Closed
- Pris: $20
- Bidrag mottagna: 4
- Vinnare: siddhantrajsinha
Tävlingssammandrag
I need a python script to convert all the TIFF files present in a directory to shape files. This can be done in QGIS by using Vector Creation -> Raster pixels to points command. But I need it to run on my Linux machine where all the TIFF files are present.
I have attached the sample TIFF file. I want the script to convert this file into points. Each pixel of the TIFF must be converted into a point. These points are elevation levels of that particular location.
Sample points : check the attachments
1) screenshot of sample points after extraction.png
2) points from shape file.png
I have used the below commands in QGIS tool
```
from qgis import processing
processing.algorithmHelp("native:pixelstopoints")
processing.run("native:pixelstopoints", {
'FIELD_NAME' : 'elevation',
'INPUT_RASTER' : 'D:/Work/Lidar/NT60ne_DTM_2m.tif',
'OUTPUT' : 'D:/Work/Lidar/NT60NE_PROGRAMMATICAL_CONVERTED.shp', 'RASTER_BAND' : 1
})
```
Let me know if you have any questions
Rekommenderade kompetenser
Arbetsgivares feedback
“Good job. Will hire Siddhant again.”
abhisyc70, United States.
Topp bidrag från den här tävlingen
-
siddhantrajsinha India
-
charyan1267 India
-
charyan1267 India
-
mahmoudyusof27 Egypt
Klargörandetavla
Hur du kommer igång med tävlingar
-
Lägg upp din tävling Snabbt och enkelt
-
Få massvis med bidrag Från världens alla hörn
-
Utse det bästa bidraget Ladda ner filerna - enkelt!