string func
The text form of a graphic primitive suitable for insertion into an Oracle database SDO_GEOMETRY column via PL/SQL. This function is available as a workaround for early Oracle systems which had restrictions on the number of co-ordinates allowed in an SDO_GEOMETRY statement.
If the point count for the entity exceeds a supplied limit, a placeholder name is used to pre-store the co-ordinates, and a reference to the placeholder then used in the output. The output consequently comprises 2 string values:
A list of co-ordinates, to be assigned however the application wishes.
An SDO_GEOMETRY statement referencing the placeholder name for the co-ordinates.
If the point count for the entity is less than the supplied limit, then the output is 1 string value comprising a normal SDO_GEOMETRY statement. Refer to the .sdogeom entity function for full details.
In addition to the entity name (see the examples below) the function takes 1 string parameter followed by 4 optional numeric parameters, which provide formatting information:
entity.sdogeom2(<entity>, <name> {,<limit> {,<srid> {,<precision> {,<multiple>}}}})
<name>
A string to be used as a placeholder for the co-ordinates.
This name will appear in the SDO_GEOMETRY output if the vertex length of the entity exceeds <limit>.
<limit>
A limit on the co-ordinate count. If this limit is exceeded then output will be 2 strings,
as outlined above. If the limit is not execeeded, this function behaves as the
sdogeom entity function.
The default value is 999.
<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
Consider a polygon entity named myentwith 200 vertices.
This function may be called in one of two ways:
tell entity.sdogeom2(myent,'vertices',100)or
tell myent.sdogeom2('vertices',100)
The resulting output would be as follows:
0,0,10,0,10,10,20,10,20,20,30,20,30,30,40,30,40,40, etc.
SDO_GEOMETRY(2003,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(vertices))
Functions: