ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • 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 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_InteriorRingN

  • Definition
  • Syntax
  • Return type
  • Example

Definition

ST_InteriorRingN returns the nth interior ring of a polygon as an ST_LineString.

The order of the rings cannot be predefined since the rings are organized according to the rules defined by the internal geometry verification routines and not by geometric orientation. If the index exceeds the number of interior rings possessed by a polygon, a null value is returned.

Syntax

Oracle

sde.st_interiorringn (polygon1 sde.st_polygon, INDEX integer)

PostgreSQL

sde.st_interiorringn (polygon1 sde.st_polygon, ring_number integer)

SQLite

st_interiorringn (polygon1 sde.st_polygon, ring_number int32)

Return type

ST_LineString

Example

Create a table, sample_polys, and add a record, then select the ID and the geometry of the interior ring.

Oracle

CREATE TABLE sample_polys (
 id integer,
 geometry sde.st_geometry
);

INSERT INTO sample_polys VALUES (
 1,
 sde.st_polygon ('polygon ((40 120, 90 120, 90 150, 40 150, 40 120), (50 130, 60 130, 60 140, 50 140, 50 130), 
(70 130, 80 130, 80 140, 70 140, 70 130))', 4326)
);
SELECT id, sde.st_astext (sde.st_interiorringn (geometry, 2)) Interior_Ring
 FROM SAMPLE_POLYS; 

ID INTERIOR_RING 

1  LINESTRING (70.00000000 130.00000000, 70.00000000 140.00000000, 80.00000000 140.00000000, 80.00000000 130.00000000, 70.00000000 130.00000000)

PostgreSQL

CREATE TABLE sample_polys (
 id serial,
 geometry sde.st_geometry
);

INSERT INTO sample_polys (geometry) VALUES (
 sde.st_polygon ('polygon ((40 120, 90 120, 90 150, 40 150, 40 120), (50 130, 60 130, 60 140, 50 140, 50 130), 
(70 130, 80 130, 80 140, 70 140, 70 130))', 4326)
);
SELECT id, sde.st_astext (st_interiorringn (geometry, 2)) 
 AS Interior_Ring
 FROM sample_polys; 

id interior_ring

1  LINESTRING (70 130, 70 140, 80 140, 80 130, 70 130)

SQLite

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

SELECT AddGeometryColumn (
 NULL,
 'sample_polys',
 'geometry',
 4326,
 'polygon',
 'xy',
 'null'
);

INSERT INTO sample_polys (geometry) VALUES (
 st_polygon ('polygon ((40 120, 90 120, 90 150, 40 150, 40 120), (50 130, 60 130, 60 140, 50 140, 50 130), 
(70 130, 80 130, 80 140, 70 140, 70 130))', 4326)
);
SELECT id, st_astext (st_interiorringn (geometry, 2)) 
 AS "Interior_Ring"
 FROM sample_polys; 

id Interior_Ring

1  LINESTRING (70.00000000 130.00000000, 70.00000000 140.00000000, 80.00000000 140.00000000, 80.00000000 130.00000000, 70.00000000 130.00000000)

Related topics

  • Load the SQLite ST_Geometry library

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal