Class: Polygon

OM.geometry. Polygon

new Polygon(ordinates, srid, (int))

This class defines a simple 2-d polygon.

Name Type Description
ordinates Array

A 2-d array. The first element in the array represents the
exterior ring. Any subsequent elements represent interior rings (or holes).

srid int

An integer that specifies the spatial reference identifier (coordinate system),
such as 8307 for the standard longitude/latitude (WGS 84) coordinate system.


dim geometry dimension. If not defined 2 will be assumed


An instance of OM.geometry.Polygon.





Densify a simple geodetic or projected linestring or polygon.

MapViewer renders geodetic shapes as if they are in a two-dimentional cartesian coordinate
system, in which longitude is the X axis and latitude is the Y axis. Oracle Spatial treats
such shapes differently and always takes the spherical shape of the Earth into consideration.
A straight line with two end points is straight when being rendered by MapViewer, while it
is an arc on the Earth surface when being processed by Spatial. As the result, the result
of a spatial query with a geodetic geometry as the filter might not match the geometry shape
rendered by MapViewer. The discrepency becomes prominent when the geodetic geometry spans
across a large area. Similar discrepency can be seen when the filtering geometry of the
spatial query is in a projected system and the data been queried is geodetic.

This method can be used to address this problem. It densifies a simple linestring
or polygon by linearly interpolating additional points into line segments that expand more
than 1 longitude degree. The densified geometry will result in minimal discrepency when being
rendered on the map and used in spatial queries.

You only need to call this method explicitly to get the densified geometry when the filter
geometry is used in a dynamic JDBC theme based vector layer. There is no need to call this method
for geometry query paremeters used with a predefined theme based vecotor layer.

Inherited From:

The densified geoemtry.



Returns the signed area of this geometry. The result is in the
square unit of the geometry's coordinates.

Note that if the geometry is clockwise then the result is a positive area,
if it is counter clockwise then a negative result is returned.

Inherited From:


Returns the total length of this geometry's segments. The result is in
the same unit as the geometry's coordinates.

Inherited From:


Get the minimum bounding rectangle (MBR) of the geometry object.

Inherited From:

The MBR of the geometry as a Rectangle object.



Get the coordinates of the geometry object.

Inherited From:

the coordinates.



Get the SRID of the geometry object.

Inherited From:




Get the type of the geometry object.
The type string is one of the constants defined in OM.GeomTypes. e.g. "Point", "LineString", or "Polygon".

Inherited From:

geometry type.



Returns the GML string of this geometry.


This method is used to convert geometry object to a geoJSON compliant string.

Inherited From:


Returns the WKT string of this geometry.

transform(toSrid, callBack, mcsURL, dataSource, optObj)

Transform a geometry from one coordinate system to another.
If the original SRID and destination SRID are one of following
values: 8307, 4326, 54004, 53004, 3785, and 3857, then the transformation will be
done at the client side.
Otherwise the map client sends a request to the map tile server, which invokes Oracle
Spatial utilities to perform coordinate system transformation and returns the
result to the client.

Name Type Description
toSrid int

The toSrid specifies the SRID of the destination coordinate system.

callBack function

The call back function that is executed after the
coordinate system transformation is finished.

mcsURL string

An optional parameter that specifies the URL of the map tile
server to be used to perform the coordinate system transformation.
If this parameter is omitted, the map tile server associated
with the first map tile layer is used.

dataSource String

An optional parameter. It's the name of the MapViewer
data source inside which the server side length calculation is to be performed.
If omitted, the data source associated with the first map tile layer added is used.

optObj Object

An optional parameter, for example, {bdutil: bdutil}.

Inherited From:

The resulting Geometry object when transformation in client. Null when
transformation in server side.