Skip to content

PATTERNS

convert data

These methods change the models used to represent geographic data and include:

  • vector to raster
  • raster to vector

vector to raster

These methods typically convert feature collections to images.

more soon

🌎 any FC to boolean raster

This method converts a feature collection into a boolean raster.

var image_boolean = geo.fcConvert.toBooleanImage(fc);

🌎 nominal FC to integer raster

This method converts a feature collection with text attributes to a single-band image. It essentially creates a list of unique text attributes from a table column (defined by “column_name”) and matches each unique text attribute to a unique integer. The result is an image with integer pixel values. The method also prints a dictionary to the Console that reports the integer code for each unique attribute.

var image_nominal = geo.fcConvert.toNominalImage(fc, "column_name");

🌎 numeric FC to numeric raster

This method uses numeric attribute data in a feature collection to create a raster.

var image_numeric = geo.fcConvert.toNumericImage(fc, "column_name", "reducer");

The method takes three arguments that are defined in the table below.

ARGUMENTS DESCRIPTION
fc The feature collection to convert.
“column_name” The name of the column with the numeric data to populate the pixel values of the output raster.
“reducer” How you would like to handle cases where two of more features overlap. Essentially, what value do you want to populate a pixel with when there is more than one number? This must be a string and one of the following: “mean”, “first”, “max”, “min”.

raster to vector

These methods typically convert images to feature collections.

more soon

🌎 make objects with vectors

This method identifies objects from rasters based on two conditions:

(1) Pixels share the same value.
(2) Pixels form contiguous regions that can be represented with a polygon.

It returns a feature collection of distinct regions and includes the area as an attribute of each feature.

var objects_with_vectors = geo.iConvert.makeObjectsWithVectors(image, "property", scale, extent, "unit");
ARGUMENTS DESCRIPTION
image Input image with a band that represent boolean or nominal (class) raster to clump.
“property” A description (as a string) of the boolean or class data used to clump. Flr example, “class”.
scale Scale of analysis to help troubleshoot TIME OUT errors. Often good practice to start relatively coarse and then increase resolution in later runs.
extent The area of interest or study region to constrain analysis.
“unit” Choose between “acres”, “sq_m”, and “sq_km”

This work is licensed under CC BY-NC-SA 4.0