code
stringlengths
1
2.08M
language
stringclasses
1 value
// Copyright 2010 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
var console = {}; var JSON = {}; var ContentMap = {}; var cmdIndex = 0; /** * For selenium-atoms-lib : events.js. Define createTouch for document which * refers to a touch pad device I believe. */ var doc = {}; doc.createTouch = function(a, b, c, d, e, f, g) {}; doc.createTouchList = function(a, b) {};
JavaScript
/* * Copyright 2009 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
JavaScript
/** @interface */ var AceSession = function() {}; /** @interface */ var AceSessionDoc = function() {}; /** @interface */ var AceRenderer = function() {}; /** @interface */ var AceEditor = function() {}; /** @type {AceSessionDoc} */ AceSession.prototype.doc; /** @interface */ var RequireOutput = function() {}; /**...
JavaScript
// Copyright 2010 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
// Copyright 2010 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
// Copyright 2011 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
// Copyright 2010 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
// Copyright 2011 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
// Copyright 2011 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-20998404-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';...
JavaScript
// Copyright 2011 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
// Copyright 2011 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
// Copyright 2011 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
// Copyright 2011 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
// Copyright 2010 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
JavaScript
/** * @fileoverview A deserializer that decodes EE object trees from JSON DAGs. * */ goog.provide('ee.Deserializer'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); goog.require('ee.CustomFunction'); goog.require('ee.Date'); goog.require('ee.Encodable'); goog.require('ee.Function'); goog.requir...
JavaScript
/** * @fileoverview Singleton for all of the library's communcation * with the Earth Engine API. */ goog.provide('ee.data'); goog.provide('ee.data.AlgorithmArgument'); goog.provide('ee.data.AlgorithmSignature'); goog.provide('ee.data.AlgorithmsRegistry'); goog.provide('ee.data.AssetDescription'); goog.provide('ee.d...
JavaScript
/** * @fileoverview Manages a pool of ImageLoaders. This handles all the details of * dealing with ImageLoaders and provides a simple interface for sending * requests and managing events. * * This class supports queueing of requests (by putting tokens into TokenPool) * and retrying of requests. An image request i...
JavaScript
/** * @fileoverview A serializer that encodes EE object trees as JSON DAGs. * */ goog.provide('ee.Serializer'); goog.require('ee.Encodable'); goog.require('goog.array'); goog.require('goog.crypt.Md5'); goog.require('goog.json.Serializer'); goog.require('goog.object'); /** * A serializer for EE object trees. *...
JavaScript
/** * @fileoverview A set of utilities to work with EE types. */ goog.provide('ee.Types'); goog.require('ee.ComputedObject'); /** * A dictionary of the ee classes. * Not technically needed in the JavaScript library, but it matches what * we have to do in the Python library. * The keys are the names of the ee ...
JavaScript
/** * @fileoverview A wrapper for strings. */ goog.provide('ee.String'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); /** * Constructs a new String. * * @param {string|Object} string A string or a computed object. * * @constructor * @extends {ee.ComputedObject} * @export */ ee.Strin...
JavaScript
/** * @fileoverview An object representing EE Geometries. */ goog.provide('ee.Geometry'); goog.provide('ee.Geometry.LineString'); goog.provide('ee.Geometry.LinearRing'); goog.provide('ee.Geometry.MultiLineString'); goog.provide('ee.Geometry.MultiPoint'); goog.provide('ee.Geometry.MultiPolygon'); goog.provide('ee.Geo...
JavaScript
/** * @fileoverview Collection filters. * * new Filter('time', low, high) * .bounds(ring) * .eq('time', value) * .lt('time', value) */ goog.provide('ee.Filter'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); goog.require('goog.array'); goog.require('goog.string'); /** * Constr...
JavaScript
/** * @fileoverview An interface implemented by serializable objects. */ goog.provide('ee.Encodable'); /** * An interface implemented by objects that know how to serialize themselves. * Not an actual Closure interface because we need instanceof to work. * @constructor */ ee.Encodable = function() {}; /** *...
JavaScript
/** * @fileoverview An object representing a saved function. * */ goog.provide('ee.SavedFunction'); goog.require('ee.ApiFunction'); goog.require('ee.Function'); /** * Creates a function representing a saved function. * * @param {string} path The function's full path. * @param {ee.Function.Signature} signatu...
JavaScript
/** * @fileoverview An object representing EE Features. */ goog.provide('ee.Feature'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); goog.require('ee.Element'); goog.require('ee.Geometry'); goog.require('goog.object'); /** * Features can be constructed from one of the following arguments pl...
JavaScript
/** * Packages are a set of saved algorithms. * * The contents of a package are stored as individual assets in a folder. * A package is intialized by synchronously retrieving the folder's contents. * The folder will contain 1 signature for each saved algorithm. A * SavedFunction object is created for each saved ...
JavaScript
/** * @fileoverview A wrapper for Lists. */ goog.provide('ee.List'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); goog.require('ee.CustomFunction'); goog.require('goog.array'); /** * Constructs a new list. * * @param {goog.array.ArrayLike|Object} list A list or a computed object. * * @...
JavaScript
/** * @fileoverview Base class for ImageCollection and FeatureCollection. * This class is never intended to be instantiated by the user. * */ goog.provide('ee.Collection'); goog.require('ee.ApiFunction'); goog.require('ee.Element'); goog.require('ee.Filter'); /** * Constructs a base collection by passing the ...
JavaScript
/** * @fileoverview A wrapper for dicts. */ goog.provide('ee.Dictionary'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); goog.require('ee.Types'); /** * Constructs a new Dictionary. * * @param {Object|ee.ComputedObject} dict A dictionary or a computed object. * * @constructor * @extend...
JavaScript
// Copyright 2011 Google Inc. All Rights Reserved. /** * @fileoverview Class implementing the google.maps.MapType interface * for display of a layer of rendered Earth Engine tiles. This class * behaves much like an ImageMapType, but adds events for knowing when * the tiles have finished loading. * * @ignore */ ...
JavaScript
/** * @fileoverview A wrapper for numbers. */ goog.provide('ee.Number'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); /** * Constructs a new Number. * * @param {number|Object} number A number or a computed object. * * @constructor * @extends {ee.ComputedObject} * @export */ ee.Numbe...
JavaScript
// Set a custom basemap style and default to the satellite map type. var styles = { 'Soft Blue': [ { featureType: 'all', stylers: [ { saturation: -80 } ] },{ featureType: 'road.arterial', elementType: 'geometry', stylers: [ { hue: '#00ffee' }, { satu...
JavaScript
// Simple regression of year versus NDVI. // Define the start date and position to get images covering Montezuma Castle, // Arizona, from 2000-2010. var start = '2000-01-01'; var end = '2010-01-01'; var lng = -111.83533; var lat = 34.57499; var region = ee.Feature.Point(lng, lat); // Filter to Landsat 7 images in the...
JavaScript
// Array-based spectral unmixing. // Create a mosaic of Landsat 5 images from June through September, 2007. var allBandMosaic = ee.ImageCollection('LT5_L1T') .filterDate('2007-06-01', '2007-09-30') .median(); // Create some representative endmembers computed previously by sampling // the Landsat 5 mosaic. var urb...
JavaScript
// Array-based quality mosaic. // Returns a mosaic built by sorting each stack of pixels by the first band // in descending order, and taking the highest quality pixel. function qualityMosaic(bands) { // Convert to an array, and declare names for the axes and indices along the // band axis. var array = bands.toA...
JavaScript
// Decorrelation Stretch function dcs(image, region, scale) { var bandNames = image.bandNames(); // The axes are numbered, so to make the following code more // readable, give the axes names. var imageAxis = 0; var bandAxis = 1; // Compute the mean of each band in the region. var means = image.reduceRe...
JavaScript
// Plot the most extreme recorded temperatures in U.S. states. var extremeTemps = ee.FeatureCollection('ft:1dZ78QI6P_HrZ6oabSKitytOhWM__fI9O1ayP4AoI'); var COLOR = { HIGH: 'ff0000', LOW: '0000ff' }; // Get the cities with the highest highs. var hottestStates = extremeTemps.limit(6, 'high_record', false); var ...
JavaScript
// Plot a histogram of elevation in Colorado. var elevation = ee.Image('srtm90_v4'); var colorado = ee.Geometry.Rectangle(-109.05, 41, -102.05, 37); // Generate the histogram data. Use minBucketWidth for nice sized buckets. var coloradoElevationHistogram = Chart.image.histogram(elevation, colorado, 200, null, 30...
JavaScript
// Plot histogram of plant species counts in the world's deserts. var ecoregions = ee.FeatureCollection('ft:1Vzl5xYdsbL2GkUhf8w5FhQ8ucGjp4V-Qevigwnd6'); // Select desert ecoregions. var deserts = ecoregions.filter(ee.Filter.contains('ECO_NAME', 'desert')) .distinct('ECO_NAME'); // Prepare the chart. Specify...
JavaScript
// Plot a time series of a band's value in regions of the American West. var COLOR = { CITY: 'ff0000', DESERT: '0000ff', FOREST: '00ff00' }; var city = ee.Feature( // San Francisco. ee.Geometry.Rectangle(-122.45, 37.74, -122.4, 37.8), {label: 'City'}); var forest = ee.Feature( // Tahoe National Fore...
JavaScript
// Plot band values at points in an image. var landsat8Toa = ee.ImageCollection('LANDSAT/LC8_L1T_32DAY_TOA'); var COLOR = { PARK: 'ff0000', FARM: '0000ff', URBAN: '00ff00' }; // Three known locations. var park = ee.Feature( ee.Geometry.Point(-99.25260, 19.32235), {'label': 'park'}); var farm = ee.Feature( ...
JavaScript
// Plot average seasonal temperatures in U.S. cities. var seasonalTemps = ee.FeatureCollection('ft:1G3RZbWoTiCiYv_LEwc7xKZq8aYoPZlL5_KuVhyDM'); // Compute the annual temperature delta. seasonalTemps = seasonalTemps.map(function(city) { var julyTemp = ee.Number(city.get('avg_temp_jul')); var janTemp = ee.Numbe...
JavaScript
// Plot elevation at waypoints along the Mt. Rainier summit trail. var elevation = ee.Image('srtm90_v4'); var rainierWaypoints = ee.FeatureCollection('ft:14q5k1isVmMMBepZAm4YIExnI7y5hE8P3Mi33WwO0'); var waypointElevations = Chart.image.byRegion( elevation, rainierWaypoints, null, 200, 'name'); Chart.print(way...
JavaScript
// SimpleCloudScore, an example of computing a cloud-free composite with L8 // by selecting the least-cloudy pixel from the collection. // A mapping from a common name to the sensor-specific bands. var LC8_BANDS = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B10']; var STD_NAMES = ['blue', 'green', 'red', 'nir',...
JavaScript
// Modis Cloud Masking example. // // Calculate how frequently a location is labeled as clear (i.e. non-cloudy) // according to the "internal cloud algorithm flag" of the MODIS "state 1km" // QA band. /* * A function that returns an image containing just the specified QA bits. * * Args: * image - The QA Image to...
JavaScript
// Map an expression over a collection. // // Computes the mean NDVI and SAVI by mapping an expression over a collection // and taking the mean. This intentionally exercises both variants of // Image.expression. // Filter the L7 collection to a single month. var collection = ee.ImageCollection('LE7_L1T_TOA') .fil...
JavaScript
// Compute the trend of nighttime lights from DMSP. // Add a band containing image date as years since 1991. function createTimeBand(img) { var year = ee.Date(img.get('system:time_start')).get('year').subtract(1991); return ee.Image(year).byte().addBands(img); } // Fit a linear trend to the nighttime lights colle...
JavaScript
// Composite an image collection and clip it to a boundary. // See also: FilteredComposite, which filters the collection by bounds instead. // Create a Landsat 7, median-pixel composite for Spring of 2000. var collection = ee.ImageCollection('LE7_L1T') .filterDate('2000-04-01', '2000-07-01'); var median = collecti...
JavaScript
// Filter an image collection by date and region to make a // median pixel composite. // // See also: ClippedComposite, which crops the output image // instead of filtering the input collection. // Filter to only include images within the colorado and utah boundaries. var polygon = ee.Geometry.Polygon([[ [-109.05, 3...
JavaScript
// Mark pixels where the elevation crosses 1000m value and compare // that to pixels that are exactly equal to 1000m. var elev = ee.Image('srtm90_v4'); var image = elev.subtract(1000).zeroCrossing(); Map.setCenter(-121.68148, 37.50877, 13); Map.addLayer(image, {min: 0, max: 1, opacity: 0.5}, 'Crossing 1000m'); var e...
JavaScript
// Compute Enhanced Vegetation Index over the MODIS MOD09GA product using // an expression. var img = ee.Image('MOD09GA/MOD09GA_005_2012_03_09').multiply(0.0001); var evi = img.expression( '2.5 * (nir - red) / (nir + 6 * red - 7.5 * blue + 1)', { red: img.select('sur_refl_b01'), // 620-670nm, RED ...
JavaScript
// Landcover cleanup. // // Display the MODIS land cover classification image with appropriate colors. // Force projection of 500 meters/pixel, which is the native MODIS resolution. var SCALE = 500; var image1 = ee.Image('MCD12Q1/MCD12Q1_005_2001_01_01'); var image2 = image1.select(['Land_Cover_Type_1']); var image3 ...
JavaScript
// HDR Landsat. // // Display portions of an image with different dynamic ranges. // The land areas are displayed normally, but the water areas // are streched to show more details. // Filter the L7 collection to a single date. var collection = ee.ImageCollection('LE7_L1T') .filterDate(new Date('11/8/2002'), n...
JavaScript
// Draws 60 lat/long lines per degree using the pixelLonLat() function. var img = ee.Image.pixelLonLat().multiply(60.0); img = img.subtract(img.floor()).lt(0.05); var grid = img.select('latitude').or(img.select('longitude')); Map.setCenter(-122.09228, 37.42330, 12); Map.addLayer(grid.mask(grid), {min: 0, max:...
JavaScript
// Display an image given its ID. var image = ee.Image('srtm90_v4'); Map.setCenter(-110, 40, 5); Map.addLayer(image, {min: 0, max: 3000});
JavaScript
// Displays the decreasing area covered by a single pixel at // higher lattitudes using the Image.pixelArea() function. var img = ee.Image.pixelArea(); Map.setCenter(0, 0, 3); Map.addLayer(img, {min: 2e8, max: 4e8, opacity: 0.85});
JavaScript
// Center-pivot Irrigation Detector. // // Finds circles that are 500m in radius. Map.setCenter(-106.06, 37.71, 12); // A nice EVI palette. var palette = [ 'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901', '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01', '012E01', '011D01...
JavaScript
// HSV-based Pan-Sharpening. // Grab a sample L7 image and pull out the RGB and pan bands // in the range (0, 1). (The range of the pan band values was // chosen to roughly match the other bands.) var image1 = ee.Image('LANDSAT/LE7/LE72300681999227EDC00'); var rgb = image1.select('B3', 'B2', 'B1').unitScale(0, 255);...
JavaScript
// NormalizedDifference example. // // Compute Normalized Difference Vegetation Index over MOD09GA product. // NDVI = (NIR - RED) / (NIR + RED), where // RED is sur_refl_b01, 620-670nm // NIR is sur_refl_b02, 841-876nm var img = ee.Image('MOD09GA/MOD09GA_005_2012_03_09'); var ndvi = img.normalizedDifference(['sur_refl...
JavaScript
// Display a Landsat 8 image given its ID. // 2013-06-03 Landsat 8 scene. var image = ee.Image('LC8_L1T/LC80440342013154LGN00'); // Define visualization parameters for a true color image. var vizParams = {'bands': 'B4,B3,B2', 'min': 5000, 'max': 30000, 'gamma': 1.6}; ...
JavaScript
// Image.reduceRegion example // // Computes a simple reduction over a region of an image. A reduction // is any process that takes an arbitrary number of inputs (such as // all the pixels of an image in a given region) and computes one or // more fixed outputs. The result is a dictionary that contains the // compute...
JavaScript
// Image.clamp example. // // Clamp the values of all bands in an image to lie within the specified range. // Values below the low value of that range are set to low value, values above // the high value of that range are set to the high value. // // Usage: image.clamp(low, high) // var image = ee.Image('srtm90_v4'); ...
JavaScript
// Download example. // // This displays a link containing the URL of the image to download. var image = ee.Image('srtm90_v4'); var path = image.getDownloadURL({ 'scale': 30, 'crs': 'EPSG:4326', 'region': '[[-120, 35], [-119, 35], [-119, 34], [-120, 34]]' }); print(path);
JavaScript
// Applies a non-linear contrast enhancement to a MODIS image using // function -1.2x^2 + 2.4x - 0.2. var img = ee.Image('MOD09GA/MOD09GA_005_2012_03_09') .select(['sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03']) .multiply(0.0001); var adj = img.polynomial([-0.2, 2.4, -1.2]); Map.setCenter...
JavaScript
// Tests for BitwiseAnd. // // Extracts quality bits from MOD09GQ QC band, and masks pixels // where the quality value is not "ideal". // Lowest two bits contain quality value: // 00: "produced at ideal quality all bands" // 01: "produced at less than ideal quality some or all bands" // 10: "not produced due to cloud e...
JavaScript
// An example finding linear features using the HoughTransform. var image = ee.Image('LT5_L1T_8DAY_NDVI/19850720'); var canny = ee.Algorithms.CannyEdgeDetector(image, 0.4, 1).multiply(255); var h = ee.Algorithms.HoughTransform(canny, 256, 50, 100); Map.setCenter(-103.80140, 40.21729, 13); Map.addLayer(image, {min: 0,...
JavaScript
// Image.ConnectedPixelCount example. // // Split pixels of band 01 into "bright" (arbitrarily defined as // reflectance > 0.3) and "dim". Highlight small (<30 pixels) // standalone islands of "bright" or "dim" type. var img = ee.Image('MOD09GA/MOD09GA_005_2012_03_09') .select('sur_refl_b01') ...
JavaScript
// Canny Edge Detector example. var image = ee.Image('LT5_L1T_8DAY_EVI/20110618'); var canny = ee.Algorithms.CannyEdgeDetector(image, 0.7); // Mask the image with itself to get rid of 0 pixels. canny = canny.mask(canny); Map.setCenter(-101.05259, 37.93418, 13); Map.addLayer(image, {min: 0, max: 1}, 'Landsat EVI'); Ma...
JavaScript
// Where operator. // // Select the forest classes from the MODIS land cover image and intersect them // with elevations above 1000m. var elev = ee.Image('srtm90_v4'); var cover = ee.Image('MCD12Q1/MCD12Q1_005_2001_01_01') .select('Land_Cover_Type_1'); var blank = ee.Image(0); // Where (1 <= cover <= 4) and (ele...
JavaScript
// Ledaps Surface Reflectance. // The main scene. var scene = ee.Image('LE7_L1T/LE70230391999217GNC00'); // The LEDAPS precomputed image products for our scene of interest. var precomputed = ee.Image('LEDAPS/L7_PRE/LE70230391999217GNC00'); // Ancillary data. var surfaceWv = [ee.Image('NCEP_RE/surface_wv/pr_wtr_eatm_...
JavaScript
// Hillshade example. function radians(img) { return img.toFloat().multiply(Math.PI).divide(180); } // Compute hillshade for the given illumination az, el. function hillshade(az, ze, slope, aspect) { var azimuth = radians(ee.Image(az)); var zenith = radians(ee.Image(ze)); // Hillshade = cos(Azimuth - Aspect) ...
JavaScript
// Extract MODIS QA information from the "state_1km" QA band // // QA Band information is available at: // https://lpdaac.usgs.gov/products/modis_products_table/mod09ga // Table 1: 1-kilometer State QA Descriptions (16-bit) /** * Returns an image containing just the specified QA bits. * * Args: * image - The QA...
JavaScript
// Extract values from a dictionary returned by reduceRegion. // // This example computes the mean and standard deviation of an image // and then stretches the image with those values. var img = ee.Image('srtm90_v4'); var meanReducer = ee.Reducer.mean(); var sigmaReducer = ee.Reducer.stdDev(); var region = ee.Geometry...
JavaScript
// Collection.distance example. // // Computes the distance to the nearest feature in a collection. var fc = ee.FeatureCollection([ ee.Geometry.Point(-72.94411, 41.32902), ee.Geometry.Point(-72.94411, 41.33402), ee.Geometry.Point(-72.94411, 41.33902), ee.Geometry.LineString( -72.93411, 41.30902, -72.9341...
JavaScript
// Computed area filter. // // Find US counties smaller than 3k square kilometers in area. var counties = ee.FeatureCollection( 'ft:1pjtcfSKIbYbj4wRcBjc0Bb6NB-sQRI-L2nIzHiU'); var countiesWithArea = counties.map(function(f) { return f.set({area: f.area()}); }); var smallCounties = countiesWithArea.filterMetadata...
JavaScript
// Simple Join example. // // Show parks in San Francisco within 2 kilometers of a BART station. var bart = ee.FeatureCollection('ft:1xCCZkVn8DIkB7i7RVkvsYWxAxsdsQZ6SbD9PCXw'); var parks = ee.FeatureCollection('ft:10KC6VfBWMUvNcuxU7mbSEg__F_4UVe9uDkCldBw'); // Join the two collection on their geometries if they're wi...
JavaScript
// Create and render a feature collection from polygons. var fc = new ee.FeatureCollection([ ee.Feature( ee.Geometry.Polygon( [[-109.05, 41], [-109.05, 37], [-102.05, 37], [-102.05, 41]]), {name: 'Colorado', fill: 1}), ee.Feature( ee.Geometry.Polygon( [[-114.05, ...
JavaScript
// Reverse mask a region. // // Create an image that masks everything except for the specified polygon. var fc = ee.FeatureCollection('ft:1Ec8IWsP8asxN-ywSqgXWMuBaxI6pPaeh6hC64lA') .filter(ee.Filter().eq('ECO_NAME', 'Great Basin shrub steppe')); // Fill and outline the polygons in two colors var region = ee.Image...
JavaScript
// Count Features. // // Count Panoramio photos near SF that mention bridges. var photosNearSF = ee.FeatureCollection( 'ft:1qpKIcYQMBsXLA9RLWCaV9D0Hus2cMQHhI-ViKHo'); var bridgePhotos = photosNearSF.filter(ee.Filter.or( ee.Filter.contains('title', 'Bridge'), ee.Filter.contains('title', 'bridge'))); Map.ad...
JavaScript
// Feature buffer example. // // Display the area within 2 kilometers of any San Francisco BART station. var bartStations = ee.FeatureCollection( 'ft:1xCCZkVn8DIkB7i7RVkvsYWxAxsdsQZ6SbD9PCXw'); var buffered = bartStations.map(function(f) { return f.buffer(2000); }); var unioned = buffered.union(); Map.addLayer(un...
JavaScript
// Create a feature collection from a Fusion Table. // // Select "desert" features from the TNC Ecoregions fusion table. var fc = ee.FeatureCollection('ft:1Ec8IWsP8asxN-ywSqgXWMuBaxI6pPaeh6hC64lA') .filter(ee.Filter.contains('ECO_NAME', 'desert')); // Paint into a blank image. Cast to byte() so we can use more than...
JavaScript
/** * @fileoverview Javascript representation for an Earth Engine ImageCollection. */ goog.provide('ee.ImageCollection'); goog.require('ee.ApiFunction'); goog.require('ee.Collection'); goog.require('ee.ComputedObject'); goog.require('ee.Image'); goog.require('ee.Types'); goog.require('goog.array'); /** * ImageC...
JavaScript
/** * @fileoverview Representation of an Earth Engine FeatureCollection. */ goog.provide('ee.FeatureCollection'); goog.require('ee.ApiFunction'); goog.require('ee.Collection'); goog.require('ee.ComputedObject'); goog.require('ee.Feature'); goog.require('ee.Geometry'); goog.require('ee.List'); goog.require('ee.Types...
JavaScript
/** * @fileoverview A representation of an earth engine image. * See: https://sites.google.com/site/earthengineapidocs for more details. */ goog.provide('ee.Image'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); goog.require('ee.Element'); goog.require('ee.Function'); goog.require('ee.Geometry...
JavaScript
/** * @fileoverview A wrapper for Date. * * We don't autogenerate this class because we want the constructor * to promote by pushing things through the server-side Date() function. * */ goog.provide('ee.Date'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); goog.require('ee.Types'); /** ...
JavaScript
/** * @fileoverview A representation of a computed earthengine object. * */ goog.provide('ee.ComputedObject'); goog.require('ee.Encodable'); goog.require('ee.Serializer'); goog.require('ee.data'); /** * An object to represent a computed Earth Engine object, a base for most * API objects. * * This is used to...
JavaScript
/** * @fileoverview Initialization and convenience functions for the EE library. */ goog.provide('ee'); goog.provide('ee.Algorithms'); goog.provide('ee.InitState'); goog.require('ee.ApiFunction'); goog.require('ee.Collection'); goog.require('ee.ComputedObject'); goog.require('ee.CustomFunction'); goog.require('ee.D...
JavaScript
/** * @fileoverview A class for representing built-in EE API Function. * * Earth Engine can dynamically produce a JSON array listing the * algorithms available to the user. Each item in the dictionary identifies * the name and return type of the algorithm, the name and type of its * arguments, whether they're re...
JavaScript
/** * @fileoverview Base class for Image, Feature and Collection. * This class is never intended to be instantiated by the user. * */ goog.provide('ee.Element'); goog.require('ee.ApiFunction'); goog.require('ee.ComputedObject'); goog.require('ee.Types'); goog.require('goog.array'); goog.require('goog.object'); ...
JavaScript
/** * @fileoverview A base class for EE Functions. */ goog.provide('ee.Function'); goog.provide('ee.Function.Signature'); goog.require('ee.ComputedObject'); goog.require('ee.Encodable'); goog.require('ee.Serializer'); goog.require('goog.array'); goog.require('goog.functions'); /** * An abstract base class for f...
JavaScript
/** * @fileoverview An object representing a custom EE Function. */ goog.provide('ee.CustomFunction'); goog.require('ee.ComputedObject'); goog.require('ee.Function'); goog.require('ee.Number'); goog.require('ee.Serializer'); goog.require('ee.String'); goog.require('ee.Types'); goog.require('goog.array'); goog.requi...
JavaScript
/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * iScroll Lite Edition based on iScroll v4.0 Beta 4 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2010 Matteo Spinelli, http://cubiq.org/ * Released under MIT license * http://cubiq.org/dropbox/mit-license.txt * * Last...
JavaScript
/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * iScroll v4.0 Beta 4 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (c) 2010 Matteo Spinelli, http://cubiq.org/ * Released under MIT license * http://cubiq.org/dropbox/mit-license.txt * * Last updated: 2011.03.10 * * * ...
JavaScript
var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'locale': {} }; // Allow other JavaScript libraries to use $. jQuery.noConflict(); (function ($) { /** * Override jQuery.fn.init to guard against XSS attacks. * * See http://bugs.jquery.com/ticket/9521 */ var jquery_init = $.fn.init; $.fn.init = function...
JavaScript
(function ($) { /** * Drag and drop table rows with field manipulation. * * Using the drupal_add_tabledrag() function, any table with weights or parent * relationships may be made into draggable tables. Columns containing a field * may optionally be hidden, providing a better user experience. * * Created tableD...
JavaScript
(function ($) { /** * A progressbar object. Initialized with the given id. Must be inserted into * the DOM afterwards through progressBar.element. * * method is the function which will perform the HTTP request to get the * progress bar state. Either "GET" or "POST". * * e.g. pb = new progressBar('myProgressBar'...
JavaScript
(function ($) { /** * Attach the machine-readable name form element behavior. */ Drupal.behaviors.machineName = { /** * Attaches the behavior. * * @param settings.machineName * A list of elements to process, keyed by the HTML ID of the form element * containing the human-readable value. Each ele...
JavaScript
(function ($) { Drupal.behaviors.tableSelect = { attach: function (context, settings) { // Select the inner-most table in case of nested tables. $('th.select-all', context).closest('table').once('table-select', Drupal.tableSelect); } }; Drupal.tableSelect = function () { // Do not add a "Select all" che...
JavaScript