MI_Polygon

Description

Creates a new Feature Geometry object which represents a Polygon.

Syntax

MI_Polygon ( rings, csys )

Arguments

rings is a string containing comma delimited coordinate pairs and uses parentheses to separate the rings from one another, and

csys is a coordinate system specification.

Example

Creates a new Feature Geometry object which represents a polygon.

select MI_Polygon('-79.376,43.648,-79.375,43.647,-79.374,43.646,-79.376,43.648','epsg:4326') as mi_polygon  from countries where country='Canada'

Example

Creates a new Feature Geometry object which represents a multi polygon with two rings.

select MI_Polygon('(-63.670492,52.449781,-64.2521,50.191888,-59.91817,49.194292,-59.532218,51.900433)(-82.705428,40.435358,-75.537582,34.761834,-70.333416,38.613649,-74.29993,41.367863)','epsg:4326') as mi_polygon  from countries where country='Canada'

Example

Creates a new Feature Geometry object which represents a multi polygon and uses it to select the countries it intersects.

select Country  from countries where obj Intersects MI_Polygon('(-63.670492,52.449781,-64.2521,50.191888,-59.91817,49.194292,-59.532218,51.900433)(-82.705428,40.435358,-75.537582,34.761834,-70.333416,38.613649,-74.29993,41.367863)','epsg:4326')

Remarks

When specifying the coordinates that represent the nodes of the polygon, you can provide the end node coordinate pair that would close the polygon or you can omit them and they will be added for you.

The csys parameter may be a reference to a bound coordinate system object or a string representation of a coordinate system using the codespace:code notation.