From the Google Engine scripts,

Is it available any Segmentation tool like the ArcMap "Segmentation Mean Shift" from ArcMap? I´m looking for crop-fields limit detection. I tried the SNIC one explained by Gorelick at the 2018 Google Engine Summit (video, slides), but it needs the "Crop Data Layer" as an input, and I am located at Argentina. Maybe a SNIC workaround?

1 Answer 1


SNIC is just an algorithm, so it can be applied to the layer you want to segment. The "Crop Data Layer" is just an example layer.

I give you a simple example:

// site
var p = ee.Geometry.Point([-62.44, -38.40])
var site = p.buffer(10000)
// Sentinel 2 collection filtered
var s2 = ee.ImageCollection('COPERNICUS/S2')
           .filterMetadata('CLOUD_COVERAGE_ASSESSMENT', 'less_than', 20)
// get the first image
var image = ee.Image(s2.first()).clip(site)    
// visualize the image
var vis = {bands:['B8', 'B11', 'B4'], min:0, max:5000}
Map.addLayer(image, vis, 'Image Sentinel 2')    
// segmentation with size 30
var snic = ee.Algorithms.Image.Segmentation.SNIC(image, 30)
// watch results of segmentation
Map.addLayer(snic.randomVisualizer(), null, 'SNIC')
  • 1
    This is why I love StackExchange! I think my problem was starting to use this algorithm by Gorelick´s complex example. Thanks Rodrigo! Apr 16, 2019 at 19:57
  • Your welcome @AlfonsodeLara! Greetings from la Patagonia Argentina =) Apr 16, 2019 at 20:52

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.