# Minimum and maximum coordinates of a polygon in Earth engine

I have a Fusion table having shape-files of various districts of India and I am using this fusion table in Earth Engine code.

``````var district = ee.FeatureCollection('ft:1PA2zwArj8EsplrX9eMxJ2H_TICyyx855KPnbJhC1','geometry')
.filter(ee.Filter.eq('name','Begusarai'));

var district_image = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
.filterBounds(district)
.filterDate('2018-03-01','2018-05-01')
.filter(ee.Filter.lt('CLOUD_COVER',5))
.sort('CLOUD_COVER')
.median();
``````

Then I perform some classification on the given image and export the classified image to my drive 'input' variable is having that classified image..

``````Export.image.toDrive({
image: input.clip(district),
description: 'begusarai2018',
scale: 30,
region: district
});
``````

I now want to get the maximum and minimum coordinates (Latitude and Longitude) of these districts. How can I achieve this?

I have got the answer for my question today as:

``````var district = ee.FeatureCollection('ft:1PA2zwArj8EsplrX9eMxJ2H_TICyyx855KPnbJhC1','geometry')
.filter(ee.Filter.eq('name','Begusarai'));

var boundbox = district.geometry().bounds();
print(district);

// return the list of coordinates
var listCoords = ee.Array.cat(boundbox.coordinates(), 1);

// get the X and Y -coordinates
var xCoords = listCoords.slice(1, 0, 1);
var yCoords = listCoords.slice(1, 1, 2);

// reduce the arrays to find the max (or min) value
var xMin = xCoords.reduce('min', ).get([0,0]); print('xMin',xMin);
var xMax = xCoords.reduce('max', ).get([0,0]); print('xMax',xMax);
var yMin = yCoords.reduce('min', ).get([0,0]); print('yMin',yMin);
var yMax = yCoords.reduce('max', ).get([0,0]); print('yMax',yMax);
``````

and it works well for my problem

• can I get those min max values in different coordinate systems. what If i'd like the min and max value in meter using ESPG:3857? Jul 21, 2020 at 17:31