ArcGIS Server Banner

ST_IsSimple

ST_IsSimple

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback

Definition

ST_IsSimple returns 1 (Oracle) or t (PostgreSQL) if the geometry object is simple; otherwise, it returns 0 (Oracle) or f (PostgreSQL).

Syntax

Oracle

sde.st_issimple (g1 sde.st_geometry)

PostgreSQL

st_issimple (g1 st_geometry)

Return type

Boolean

Example

The table issimple_test is created with two columns. The pid column is a smallint data type containing the unique identifier for each row. The g1 ST_Geometry column stores the simple and nonsimple geometry samples.

CREATE TABLE ISSIMPLE_TEST (pid smallint, g1 sde.st_geometry);

The INSERT statements insert two records into the issimple_test table. The first is a simple linestring because it doesn't intersect its interior. The second is nonsimple because it does intersect its interior.

Oracle

INSERT INTO issimple_test VALUES (
1,
sde.st_linefromtext ('linestring (10 10, 20 20, 30 30)', 0)
);

INSERT INTO issimple_test VALUES (
2,
sde.st_linefromtext ('linestring (10 10, 20 20, 20 30, 10 30, 10 20,
20 10)', 0)
);

PostgreSQL

INSERT INTO issimple_test VALUES (
1,
st_linestring ('linestring (10 10, 20 20, 30 30)', 0)
);

INSERT INTO issimple_test VALUES (
2,
st_linestring  ('linestring (10 10, 20 20, 20 30, 10 30, 10 20,
20 10)', 0)
);

The query returns the results of the ST_IsSimple function. The first record returns 1 because the linestring is simple, while the second record returns 0 because the linestring is not simple.

Oracle

SELECT pid, sde.st_issimple (g1) Is_it_simple
FROM issimple_test;

PID 		Is_it_simple

1		1
2		0

PostgreSQL

SELECT pid, st_issimple (g1) AS Is_it_simple
FROM issimple_test;

pid		is_it_simple

1		t
2		f

See Also

  • An overview of SQL functions used with ST_Geometry types