string func
The text form of a graphic primitive suitable for insertion into an Oracle database SDO_GEOMETRY column.
In addition to the entity name (see the examples below) the function takes 3 optional numeric parameters, which provide formatting information:
entity.sdogeom2(<entity> {,<srid> {,<precision> {,<multiple>}}})
<srid>
The projection system (aka the SRID number) in which the entity co-ordinates are valid.
If <srid> has a positive value, then this will appear in the output.
If <srid> has a -1 value (the default), then any srid attached to the entity
in entity.att[1] is used or NULL.
<precision>
The required decimal precision to be used when outputting ordinate values as text. Vales are rounded to this
number of decimal places. A value of -1 (the default) implies that the current value of
dec_places should be used.
<multiple>
A boolean value (default false) specifying whether the output should define a single or multiple
Oracle type.
Not all graphic primitives have Oracle equivalents.
For those that do have, the Oracle graphic type is derived from the entity type using the following rules:
Fire Type
Multiple Parameter
Oracle Type
polygon false 2003 polygon true 2007 polyline false 2002 (or 2006 for polyline with line breaks) polyline true 2006 vector false 2002 vector true 2006 node false 2001 node true 2005 arc - 2002 circle - 2002
To cater for a limitation in Oracle parsing where there is a limit (currently 1000) on the number of vertices allowed in an SDO_GEOMETRY statement, there is also an sdogeom2 entity function available which enables a workaround.
Create a polyline entity:
entity myent = lines { (0,0), e:100, n:100, e:100 }
The function may be called in one of two ways:
tell entity.sdogeom(myent)or
tell myent.sdogeom()
The resulting output would be as follows:
SDO_GEOMETRY(2002,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(0,0,100,0,100,100,200,100))
Functions: