Home    |    Concepts   |   API   |   Samples
Concepts > Geometry > Representations of Geometry
Text

Each geometry type has a well-known text representation from which new instances can be constructed or existing instances can be converted to textual form for alphanumeric display or use in systems where binary representations of geometry are not supported.

The ISO/OGC specification of the well-known text representation for geometry is limited to 2D geometric objects. ESRI has extended this specification to support elevations and measures. If you are using this format to exchange data with other systems, they may not know how to interpret elevation and measure tags.

The text representation is an ASCII text-formatted string that allows geometry to be exchanged in ASCII text form. This text representation of geometry can be incorporated into a C or Java program.

The following points must be noted about the structure for implementation of text representation:

  • The notation {}* denotes zero or more repetitions of the tokens within the braces. The braces do not appear in the output token list.
  • The <text description> is made up of three basic components enclosed in single quotes:
    - '<geometry type> [coordinate type] [coordinate list]'
    - The geometrytype is defined as one of the following: point, linestring, polygon, multipoint, multilinestring, or multipolygon.
    - The coordinate type specifies whether or not the geometry has z coordinates and/or measures. Leave this argument blank if the geometry has neither; otherwise, set the coordinate type to z for geometries containing z coordinates, m for geometries with measures, and zm for geometries that have both.
    - The coordinate list defines the double-precision vertices of the geometry. Coordinate lists are comma-delimited and enclosed by parentheses. Geometries having multiple components require sets of parentheses to enclose each component part. If the geometry is empty, the EMPTY keyword replaces the coordinates

Structure for implementation of text representation
 

<Geometry Tagged Text> := <Point Tagged Text> | <LineString Tagged Text> | <Polygon Tagged Text> | <MultiPoint Tagged Text> | <MultiLineString Tagged Text> | <MultiPolygon Tagged Text>
<Point Tagged Text> := POINT <Point Text>
<LineString Tagged Text> := LINESTRING <LineString Text>
<Polygon Tagged Text> := POLYGON <Polygon Text>
<MultiPoint Tagged Text> := MULTIPOINT <Multipoint Text>
<MultiLineString Tagged Text> := MULTILINESTRING <MultiLineString Text>
<MultiPolygon Tagged Text> := MULTIPOLYGON <MultiPolygon Text>

<Point Text> := EMPTY | <Point> | Z <PointZ> | M <PointM> | ZM <PointZM>
<Point> := <x><y>
<x> := double precision literal
<y> := double precision literal
<PointZ> := <x> <y> <z>
<x> := double precision literal
<y> := double precision literal
<z> := double precision literal
<PointM> := <x> <y> <m>
<x> := double precision literal
<y> := double precision literal
<m> := double precision literal
<PointZM> := ?<x> ?<y> ?<z> ?<m>
<x> := double precision literal
<y> := double precision literal
<z> := double precision literal
<m> := double precision literal
<LineString Text> := EMPTY | (<Point Text > {, <Point Text> }*) | Z ( <PointZ Text > {, <PointZ Text> }* ) | M ( <PointM Text > {, <PointM Text> }* ) | ZM ( <PointZM Text > {, <PointZM Text> }* )
<Polygon Text> := EMPTY | ( <LineString Text > {,< LineString Text > }*)
<Multipoint Text> := EMPTY | ( <Point Text > {, <Point Text > }* )
<MultiLineString Text> := EMPTY | ( <LineString Text > {,< LineString Text>}* )
<MultiPolygon Text> := EMPTY | ( < Polygon Text > {, < Polygon Text > }* )

For a complete list of all possible permutations of the text description portion of the text representation, click here.

feedback | privacy | legal