1

I am quite new in remote sensing and trying to get boundaries of fields to build a prediction model in R. I tried Canny and Hough algorithms but the results are not satisfying. Lastly, I tried the model in 'Segmentation Session EEUS18' by Noel Gorelick. Here is my problem:

Suppose that I got perimeter pixels after the snic algorithm as [PerimeterZoomOut]. I want to extract the lines as vectors in a shapefile.

I tried reduceToVector but it needs at least 2 bands whereas perimeter image has only 1 band.

I also want to add a constraint so that it would not extract unnecessary lines as [PerimeterZoomIn].

The difference is also as between [NDVIZoomIn] and [NDVIZoomOut]. I don't want the noise in the fields.

Are there any way of extraction NDVI and perimeter lines images as vectors? They both have only 1 band.

1 Answer 1

0

Here is my solution to the problem:

I first extract the image as raster with the following code:

//grouped lines

Export.image.toDrive({
  image: perimeterPixels,
  description: "Perimeters_scale20",
  folder: "Perimeters",
  region: geometry,
  scale: 20,
  maxPixels: 50000000000

});

//or more precise lines

Export.image.toDrive({
  image: perimeterPixels,
  description: "Perimeters_scale20",
  folder: "Perimeters",
  region: geometry,
  scale: 5,
  maxPixels: 50000000000

});

You need to adjust your 'image', 'description', 'region', and most importantly 'scale' as to your preference.

As you increase the scale, you get a raster more like ZoomOut image. Then you can convert it to a vector image with programs like QGIS. If you know to extract vector image directly from GEE Code Editor, please illuminate me!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.