ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

ST_Aggr_Intersection

  • Definition
  • Syntax
  • Return type
  • Example
Note:

Oracle and SQLite only

Definition

ST_Aggr_Intersection returns a single geometry that is a union of the intersection of all input geometries.

Syntax

Oracle

sde.st_aggr_intersection (geometry1 sde.st_geometry)

SQLite

st_aggr_intersection (geometry1 geometryblob)

Return type

Oracle

ST_Geometry

SQLite

Geometryblob

Example

In this example, a biologist is trying to find the intersection of three wildlife habitats.

Oracle

First, create the table that stores the habitats.

CREATE TABLE habitats (
 id integer not null,
 shape sde.st_geometry
);

Next, insert the three polygons to the table.

INSERT INTO habitats (id, shape) VALUES (
 1,
 sde.st_polygon ('polygon ((5 5, 12 5, 12 10, 5 10, 5 5))', 4326)
);

INSERT INTO habitats (id, shape) VALUES (
 2,
 sde.st_polygon ('polygon ((10 8, 14 8, 14 15, 10 15, 10 8))', 4326)
);

INSERT INTO habitats (id, shape) VALUES (
 3,
 sde.st_polygon ('polygon ((6 8, 20 8, 20 20, 6 20, 6 8))', 4326)
);

Finally, select for the intersection of the habitats.

SELECT sde.st_astext(sde.st_aggr_intersection(shape)) AGGR_SHAPES 
 FROM habitats;

AGGR_SHAPES

POLYGON  (( 10.00000000 8.00000000, 12.00000000 8.00000000, 12.00000000 10.00000000, 
10.00000000 10.00000000, 10.00000000 8.00000000))

SQLite

First, create the table that stores the habitats.

CREATE TABLE habitats (
  id integer primary key autoincrement not null
);

SELECT AddGeometryColumn(
 NULL,
 'habitats',
 'shape',
 4326,
 'polygon',
 'xy',
 'null'
);

Next, insert the three polygons to the table.

INSERT INTO habitats (shape) VALUES (
 st_polygon ('polygon ((5 5, 12 5, 12 10, 5 10, 5 5))', 4326)
);

INSERT INTO habitats (shape) VALUES (
 st_polygon ('polygon ((10 8, 14 8, 14 15, 10 15, 10 8))', 4326)
);

INSERT INTO habitats (shape) VALUES (
 st_polygon ('polygon ((6 8, 20 8, 20 20, 6 20, 6 8))', 4326)
);

Finally, select the intersection of the habitats.

SELECT st_astext(st_aggr_intersection(shape)) 
  AS "AGGR_SHAPES" 
  FROM habitats;

AGGR_SHAPES

POLYGON  (( 10.00000000 8.00000000, 12.00000000 8.00000000, 12.00000000 10.00000000, 
10.00000000 10.00000000, 10.00000000 8.00000000))

Related topics

  • Load the SQLite ST_Geometry library

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal