Hello,
I just ran into a strange problem, which surely has a logical explanation and an easy workaround, but I just can't seem to find it.
Let's assume I have a raster "raster1.tif" (Pixel type: unsigned integer, Pixel depth: 8 bit, 6 bands) and a point shapefile "points.shp". Both layers have the same projection.
I now want to extract point values of raster1 at locations specified by "points". I can do this in the GUI with the Extract Multi Values to Point-Tool and the result is as expected. For example, band 1 of "raster1.tif" has values in a range between 60 and 100, and points.shp has a column called "b1_raster1" with a range of 70-90.
However, I need to do this in Python. I write the corresponding code and execute it. No errors are given. However, when I check the values in points.shp, the column "b1_raster1" has values in a range between 9-12.
Here's the python code:
I'd be grateful for any input. :)
I just ran into a strange problem, which surely has a logical explanation and an easy workaround, but I just can't seem to find it.
Let's assume I have a raster "raster1.tif" (Pixel type: unsigned integer, Pixel depth: 8 bit, 6 bands) and a point shapefile "points.shp". Both layers have the same projection.
I now want to extract point values of raster1 at locations specified by "points". I can do this in the GUI with the Extract Multi Values to Point-Tool and the result is as expected. For example, band 1 of "raster1.tif" has values in a range between 60 and 100, and points.shp has a column called "b1_raster1" with a range of 70-90.
However, I need to do this in Python. I write the corresponding code and execute it. No errors are given. However, when I check the values in points.shp, the column "b1_raster1" has values in a range between 9-12.
Here's the python code:
Code:
in_shp = "points.shp"
in_raster = "raster1.tif"
ExtractMultiValuesToPoints(in_shp, in_raster, "NONE")