# Arcgis Imagery

> Work with raster and imagery data using ImageryLayer, ImageryTileLayer, pixel filtering, raster functions, multidimensional data, and oriented imagery. Use for satellite imagery, elevation data, and scientific raster datasets.

- **Type:** Skill
- **Install:** `agentstack add skill-saschabrunnerch-arcgis-maps-sdk-js-ai-context-arcgis-imagery`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [SaschaBrunnerCH](https://agentstack.voostack.com/s/saschabrunnerch)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [SaschaBrunnerCH](https://github.com/SaschaBrunnerCH)
- **Source:** https://github.com/SaschaBrunnerCH/arcgis-maps-sdk-js-ai-context/tree/master/skills/arcgis-imagery

## Install

```sh
agentstack add skill-saschabrunnerch-arcgis-maps-sdk-js-ai-context-arcgis-imagery
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# ArcGIS Imagery

Use this skill for raster imagery, pixel-level operations, raster functions, multidimensional data, and oriented imagery viewers.

## Import Patterns

### ESM (npm)

```javascript
import ImageryLayer from "@arcgis/core/layers/ImageryLayer.js";
import ImageryTileLayer from "@arcgis/core/layers/ImageryTileLayer.js";
import OrientedImageryLayer from "@arcgis/core/layers/OrientedImageryLayer.js";
import RasterFunction from "@arcgis/core/layers/support/RasterFunction.js";
import MosaicRule from "@arcgis/core/layers/support/MosaicRule.js";
import DimensionalDefinition from "@arcgis/core/layers/support/DimensionalDefinition.js";
import MultidimensionalSubset from "@arcgis/core/layers/support/MultidimensionalSubset.js";
```

### CDN (dynamic import)

```javascript
const ImageryLayer = await $arcgis.import(
  "@arcgis/core/layers/ImageryLayer.js",
);
const ImageryTileLayer = await $arcgis.import(
  "@arcgis/core/layers/ImageryTileLayer.js",
);
const RasterFunction = await $arcgis.import(
  "@arcgis/core/layers/support/RasterFunction.js",
);
```

## ImageryLayer

ImageryLayer connects to ArcGIS Image Services for dynamic raster data.

### Basic ImageryLayer

```javascript
const imageryLayer = new ImageryLayer({
  url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/ScientificData/SeaTemperature/ImageServer",
});

map.add(imageryLayer);
```

### ImageryLayer with Popup

```javascript
const imageryLayer = new ImageryLayer({
  url: "...",
  popupTemplate: {
    title: "Raster Value",
    content: "{Raster.ServicePixelValue}",
  },
});
```

### Key ImageryLayer Properties

| Property         | Type           | Description                                |
| ---------------- | -------------- | ------------------------------------------ |
| `url`            | string         | ImageServer REST endpoint                  |
| `format`         | string         | Output format (`"jpgpng"`, `"tiff"`, etc.) |
| `bandIds`        | number[]       | Which bands to display                     |
| `rasterFunction` | RasterFunction | Server-side processing                     |
| `mosaicRule`     | MosaicRule     | Raster combination rules                   |
| `pixelFilter`    | Function       | Client-side pixel processing               |
| `renderingRule`  | object         | Client-side rendering rules (JSON)         |

## ImageryTileLayer

ImageryTileLayer provides fast tiled access to imagery, including Cloud-Optimized GeoTIFF (COG).

### Basic ImageryTileLayer

```javascript
const imageryTileLayer = new ImageryTileLayer({
  url: "https://tiledimageservices.arcgis.com/...",
});

map.add(imageryTileLayer);
```

### Cloud Optimized GeoTIFF (COG)

```javascript
const imageryTileLayer = new ImageryTileLayer({
  url: "https://example.com/image.tif",
  title: "COG Layer",
});
```

## Raster Functions

### Apply Raster Function

```javascript
// Hillshade
const hillshadeFunction = new RasterFunction({
  functionName: "Hillshade",
  functionArguments: {
    azimuth: 315,
    altitude: 45,
    zFactor: 1,
  },
});

imageryLayer.rasterFunction = hillshadeFunction;
```

### Common Raster Functions

```javascript
// Stretch
const stretchFunction = new RasterFunction({
  functionName: "Stretch",
  functionArguments: {
    stretchType: 3,
    numberOfStandardDeviations: 2,
  },
});

// Colormap
const colormapFunction = new RasterFunction({
  functionName: "Colormap",
  functionArguments: {
    colormap: [
      [1, 255, 0, 0],
      [2, 0, 255, 0],
      [3, 0, 0, 255],
    ],
  },
});

// NDVI
const ndviFunction = new RasterFunction({
  functionName: "NDVI",
  functionArguments: {
    visibleBandID: 3,
    infraredBandID: 4,
  },
});
```

### RasterFunction Properties

| Property            | Type   | Description                 |
| ------------------- | ------ | --------------------------- |
| `functionName`      | string | Name of the raster function |
| `functionArguments` | object | Parameters for the function |
| `outputType`        | string | Output pixel type           |

**Common function names:** `Hillshade`, `Stretch`, `Colormap`, `NDVI`, `GVITINDEX`, `SAVI`, `Pansharpening`, `Convolution`, `MLClassify`

## Mosaic Rules

```javascript
const mosaicRule = new MosaicRule({
  mosaicMethod: "center", // "center", "northwest", "nadir", "lock-raster", "by-attribute"
  mosaicOperator: "first", // "first", "last", "min", "max", "mean", "sum", "blend"
  lockRasterIds: [1, 2, 3], // Lock to specific rasters
  multidimensionalDefinition: [], // For multidimensional data
});

imageryLayer.mosaicRule = mosaicRule;
```

## Multidimensional Data

### DimensionalDefinition

```javascript
// Define dimensions (depth, time, etc.)
const dimInfo = [];

// Depth dimension
dimInfo.push(
  new DimensionalDefinition({
    dimensionName: "StdZ",
    values: [0],
    isSlice: true,
  }),
);

// Time dimension
dimInfo.push(
  new DimensionalDefinition({
    dimensionName: "StdTime",
    values: [1396828800000],
    isSlice: true,
  }),
);

const mosaicRule = new MosaicRule({
  multidimensionalDefinition: dimInfo,
});

const layer = new ImageryLayer({
  url: "...",
  mosaicRule: mosaicRule,
});
```

### Accessing Multidimensional Info

```javascript
await imageryLayer.load();

const dimensions = imageryLayer.multidimensionalInfo.dimensions;
dimensions.forEach((dim) => {
  console.log("Dimension:", dim.name);
  console.log("Values:", dim.values);
  console.log("Unit:", dim.unit);
});
```

### ImageryTileLayer Multidimensional

```javascript
const layer = new ImageryTileLayer({
  url: "...",
  multidimensionalSubset: {
    dimensions: [
      {
        name: "StdTime",
        values: [
          /* epoch ms */
        ],
      },
      {
        name: "StdZ",
        values: [
          /* depth values */
        ],
      },
    ],
  },
  multidimensionalDefinition: [
    new DimensionalDefinition({
      dimensionName: "StdTime",
      values: [1609459200000],
    }),
  ],
});
```

**Common dimension names:** `StdTime`, `StdZ`, `StdPlev`, `StdDepth`

## Pixel Filtering

### Custom Pixel Filter

```javascript
const imageryLayer = new ImageryLayer({
  url: "...",
  pixelFilter: processPixels,
});

function processPixels(pixelData) {
  if (!pixelData || !pixelData.pixelBlock) return;

  const pixelBlock = pixelData.pixelBlock;
  const pixels = pixelBlock.pixels;
  let mask = pixelBlock.mask;
  const numPixels = pixelBlock.width * pixelBlock.height;

  const minVal = pixelBlock.statistics[0].minValue;
  const maxVal = pixelBlock.statistics[0].maxValue;
  const factor = 255 / (maxVal - minVal);

  const band = pixels[0];
  const rBand = new Uint8Array(numPixels);
  const gBand = new Uint8Array(numPixels);
  const bBand = new Uint8Array(numPixels);

  if (!mask) {
    mask = new Uint8Array(numPixels);
    mask.fill(1);
    pixelBlock.mask = mask;
  }

  for (let i = 0; i = minThreshold && pixels[i]  {
  const result = await imageryLayer.identify({
    geometry: event.mapPoint,
    returnGeometry: false,
    returnCatalogItems: true,
  });

  console.log("Pixel value:", result.value);
  console.log("Catalog items:", result.catalogItems);
});
```

## Raster Statistics

```javascript
await imageryLayer.load();

const stats = imageryLayer.serviceRasterInfo.statistics;
console.log("Min:", stats[0].min);
console.log("Max:", stats[0].max);
console.log("Mean:", stats[0].avg);
console.log("StdDev:", stats[0].stddev);
```

## Oriented Imagery

### OrientedImageryLayer

```javascript
const oiLayer = new OrientedImageryLayer({
  url: "https://services.arcgis.com/.../FeatureServer/0",
});

map.add(oiLayer);
```

### OrientedImageryViewer Widget

```javascript
import OrientedImageryViewer from "@arcgis/core/widgets/OrientedImageryViewer.js";

const oiViewer = new OrientedImageryViewer({
  view: view,
});

view.ui.add(oiViewer, "top-right");
```

### Imagery Components

| Component                        | Purpose                              |
| -------------------------------- | ------------------------------------ |
| `arcgis-oriented-imagery-viewer` | View and navigate oriented imagery   |
| `arcgis-video-player`            | Play video feeds from video services |

## Common Pitfalls

1. **Pixel filter performance**: Complex pixel filters run on every render — optimize loops and minimize allocations.

2. **Band array indices**: Band IDs are 1-based in services but 0-based in `bandIds` arrays.

3. **Coordinate systems**: Imagery may need reprojection to match the view's spatial reference.

4. **Memory with large images**: Use `ImageryTileLayer` for large datasets; it tiles automatically.

5. **Pixel type conversion**: Be careful when changing `pixelType` in pixel filters — mismatches cause artifacts.

6. **Redraw after filter changes**: Call `imageryLayer.redraw()` after modifying external variables used in `pixelFilter`.

## Reference Samples

- `layers-imagerylayer` — Basic ImageryLayer
- `layers-imagery-pixelvalues` — Querying pixel values
- `layers-imagery-rasterfunction` — Raster function processing
- `layers-imagery-multidimensional` — Multidimensional imagery
- `layers-imagerytilelayer` — ImageryTileLayer
- `layers-imagerytilelayer-cog` — Cloud-Optimized GeoTIFF
- `layers-imagery-renderer` — Imagery renderers
- `layers-imagery-clientside` — Client-side imagery processing
- `layers-orientedimagerylayer` — Oriented imagery

## Related Skills

- `arcgis-time-animation` — Time-aware imagery animation
- `arcgis-layers` — Common layer patterns
- `arcgis-smart-mapping` — Auto-generated renderers
- `arcgis-custom-rendering` — Custom tile layer rendering

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [SaschaBrunnerCH](https://github.com/SaschaBrunnerCH)
- **Source:** [SaschaBrunnerCH/arcgis-maps-sdk-js-ai-context](https://github.com/SaschaBrunnerCH/arcgis-maps-sdk-js-ai-context)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-saschabrunnerch-arcgis-maps-sdk-js-ai-context-arcgis-imagery
- Seller: https://agentstack.voostack.com/s/saschabrunnerch
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
