Python script to convert raster pixels to points
- Tila: Closed
- Palkinto: $20
- Vastaanotetut työt: 4
- Voittaja: siddhantrajsinha
Kilpailun tehtävänanto
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
Suositellut taidot
Työnantajan palaute
“Good job. Will hire Siddhant again.”
abhisyc70, United States.
Kilpailun parhaat työt
-
siddhantrajsinha India
-
charyan1267 India
-
charyan1267 India
-
mahmoudyusof27 Egypt
Julkinen selvennystaulu
Kuinka päästä alkuun kilpailuiden kanssa
-
Ilmoita kilpailusi Nopeaa ja helppoa
-
Vastaanota tonnikaupalla osallistumisia Ympäri maailmaa
-
Myönnä palkinto parhaalle työlle Lataa tiedostot - Helppoa!