Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 426 characters in body
Source Link

I'm completely new to python usage in GIS. I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.

var training = image.select(bands).sampleRegions({
  collection: points,
  properties: [class],
  scale: 30
});

image.select(bands) - is my raster data,

Collection- is my shapefile

Trying to find my output as the below image. Source : https://miro.medium.com/max/1050/1*WrtLqr49lbpf24K3Pb6ViQ.png enter image description here[![enter image description here][1]][1]

https://www.earthdatascience.org/courses/use-data-open-source-python/intro-raster-data-python/raster-data-processing/classify-plot-raster-data-in-python/

I wanted to do some sampling like in the above link, it has clustering and sampling of trees based on their heights but I want to sample and cluster pixels only in the locations based on the geometries of my shapefile i.e, wanted to acheive supervised classification.

I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.

var training = image.select(bands).sampleRegions({
  collection: points,
  properties: [class],
  scale: 30
});

image.select(bands) - is my raster data,

Collection- is my shapefile

Trying to find my output as the below image. Source : https://miro.medium.com/max/1050/1*WrtLqr49lbpf24K3Pb6ViQ.png enter image description here

I'm completely new to python usage in GIS. I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.

var training = image.select(bands).sampleRegions({
  collection: points,
  properties: [class],
  scale: 30
});

image.select(bands) - is my raster data,

Collection- is my shapefile

Trying to find my output as the below image. Source : https://miro.medium.com/max/1050/1*WrtLqr49lbpf24K3Pb6ViQ.png [![enter image description here][1]][1]

https://www.earthdatascience.org/courses/use-data-open-source-python/intro-raster-data-python/raster-data-processing/classify-plot-raster-data-in-python/

I wanted to do some sampling like in the above link, it has clustering and sampling of trees based on their heights but I want to sample and cluster pixels only in the locations based on the geometries of my shapefile i.e, wanted to acheive supervised classification.

added 209 characters in body
Source Link

I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.

var training = image.select(bands).sampleRegions({
  collection: points,
  properties: [class],
  scale: 30
});

image.select(bands) - is my raster data,

Collection- is my shapefile

Trying to find my output as the below image. Source : https://miro.medium.com/max/1050/1*WrtLqr49lbpf24K3Pb6ViQ.png enter image description here

I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.

var training = image.select(bands).sampleRegions({
  collection: points,
  properties: [class],
  scale: 30
});

image.select(bands) - is my raster data,

Collection- is my shapefile

I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.

var training = image.select(bands).sampleRegions({
  collection: points,
  properties: [class],
  scale: 30
});

image.select(bands) - is my raster data,

Collection- is my shapefile

Trying to find my output as the below image. Source : https://miro.medium.com/max/1050/1*WrtLqr49lbpf24K3Pb6ViQ.png enter image description here

edited tags
Source Link

I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.

var training = image.select(bands).sampleRegions({
  collection: points,
  properties: [class],
  scale: 30
});

image.select(bands) - is my raster data, Collection

Collection- is my shapefile

I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.

var training = image.select(bands).sampleRegions({
  collection: points,
  properties: [class],
  scale: 30
});

image.select(bands) - is my raster data, Collection- is my shapefile

I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.

var training = image.select(bands).sampleRegions({
  collection: points,
  properties: [class],
  scale: 30
});

image.select(bands) - is my raster data,

Collection- is my shapefile

Code display edit.
Source Link
TomazicM
  • 27k
  • 24
  • 31
  • 42
Loading
Source Link
Loading