Computing buffers in Google Earth Engine.

Google Earth Engine supports a wide variety of geometric operations. These include operations on individual geometries such as computing buffers, centroid, bounding box, perimeter, convex hull, etc. A buffer is a zone that is drawn around a point, line or polygon that includes all the area within a specified distance of the geometric feature. For example, to determine the number of settlements adjacent to a major road, a buffer of 10 meters may be carried out. Buffers are important and have applications. They are meant to protect conservation areas such as parks, wetlands, lakes and other surrounding habitats.

This article outlines the process of computing buffers around a feature collection using the Google Earth Engine.

Select an Area of Interest

In the Google Earth Engine, select the area of interest. It can be a point, line or polygon using the geometry tool.

Computing buffer geometry import

Instantiate a Feature Collection

Derive a feature collection from the geometry points imported along the area of interest.

var centerlinePoints = [
  ee.Feature(
      ee.Geometry.Point(37.00898626137325,-0.30111640543307067) ),
  ee.Feature(
      ee.Geometry.Point(37.0092381077034,-0.2999334836841344)),
  ee.Feature(
      ee.Geometry.Point(37.0047624524643,-0.32056462998244917)),
      ee.Feature(
      ee.Geometry.Point(37.00596408210297,-0.33137912169070616)),
      ee.Feature(
      ee.Geometry.Point(37.00356082282563,-0.3420219432761783)),
      ee.Feature(
      ee.Geometry.Point(37.0047624524643,-0.32056462998244917)),
      ee.Feature(
      ee.Geometry.Point(36.999612611155705,-0.35094817165057857))
];
var rdPoints = ee.FeatureCollection(centerlinePoints);


Compute the Buffer Around the Feature Collection

Calculate the buffer by mapping a function over the feature collection to buffer each point. The buffer in this case is 1km from the centerline of the road and an error margin is set to 100. The buffer is set in meters.

var buffered = rdPoints.map(function(f) {
  return f.buffer(1000, 100); 
});

Display the Final Result

Map.addLayer(buffered, {color: ‘800080’}, ‘buffer’);

Map.setCenter( 36.9, -0.35, 11);

Area of Interest

Computing buffers

Buffer Outputs

Computing buffers

Link to the full code:

https://code.earthengine.google.com/3c5758d60be31265cc0d1b2119887d49

Leave a Reply

Your email address will not be published. Required fields are marked *

Risper Mutinda

Hello. I am Risper Mutinda. I am a passionate Web and GIS Developer but more importantly, I am passionate about Technology.

More Reading

Post navigation