protected static class PgSphereTranslator.PgSphereGeometryParser
extends java.lang.Object
Let parse a geometry serialized with the PgSphere syntax.
There is one function parseXxx(String) for each supported geometry.
These functions always return a STCS.Region
object,
which is the object representation of an STC region.
Only the following geometries are supported:
This parser supports all the known PgSphere representations of an angle. However, it always returns angle (coordinates, radius, width and height) in degrees.
Constructor and Description |
---|
PgSphereGeometryParser()
Build the PgSphere parser.
|
Modifier and Type | Method and Description |
---|---|
STCS.Region |
parseBox(java.lang.String pgsphereExpr)
Parse the given PgSphere geometry as a box.
|
STCS.Region |
parseCircle(java.lang.String pgsphereExpr)
Parse the given PgSphere geometry as a circle.
|
STCS.Region |
parsePoint(java.lang.String pgsphereExpr)
Parse the given PgSphere geometry as a point.
|
STCS.Region |
parsePolygon(java.lang.String pgsphereExpr)
Parse the given PgSphere geometry as a point.
|
public PgSphereGeometryParser()
public STCS.Region parsePoint(java.lang.String pgsphereExpr) throws ParseException
pgsphereExpr
- The PgSphere expression to parse as a point.STCS.Region
implementing a STC Position region.ParseException
- If the PgSphere syntax of the given expression is wrong or does not correspond to a point.public STCS.Region parseCircle(java.lang.String pgsphereExpr) throws ParseException
pgsphereExpr
- The PgSphere expression to parse as a circle.STCS.Region
implementing a STC Circle region.ParseException
- If the PgSphere syntax of the given expression is wrong or does not correspond to a circle.public STCS.Region parseBox(java.lang.String pgsphereExpr) throws ParseException
pgsphereExpr
- The PgSphere expression to parse as a box.STCS.Region
implementing a STC Box region.ParseException
- If the PgSphere syntax of the given expression is wrong or does not correspond to a box.public STCS.Region parsePolygon(java.lang.String pgsphereExpr) throws ParseException
pgsphereExpr
- The PgSphere expression to parse as a point.STCS.Region
implementing a STC Position region.ParseException
- If the PgSphere syntax of the given expression is wrong or does not correspond to a point.