Package adql.translator
Class PgSphereTranslator.PgSphereGeometryParser
java.lang.Object
adql.translator.PgSphereTranslator.PgSphereGeometryParser
- Enclosing class:
- PgSphereTranslator
Let parse a geometry serialized with the PgSphere syntax.
There is one function parseXxx(String) for each supported geometry.
These functions always return a Region
object,
which is the object representation of an STC region.
Only the following geometries are supported:
- spoint => Position
- scircle => Circle
- sbox => Box
- spoly => Polygon
This parser supports all the known PgSphere representations of an angle. However, it always returns angle (coordinates, radius, width and height) in degrees.
- Since:
- 1.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionParse the given PgSphere geometry as a box.parseCircle
(String pgsphereExpr) Parse the given PgSphere geometry as a circle.parsePoint
(String pgsphereExpr) Parse the given PgSphere geometry as a point.parsePolygon
(String pgsphereExpr) Parse the given PgSphere geometry as a point.
-
Constructor Details
-
PgSphereGeometryParser
public PgSphereGeometryParser()Build the PgSphere parser.
-
-
Method Details
-
parsePoint
Parse the given PgSphere geometry as a point.- Parameters:
pgsphereExpr
- The PgSphere expression to parse as a point.- Returns:
- A
Region
implementing a STC Position region. - Throws:
ParseException
- If the PgSphere syntax of the given expression is wrong or does not correspond to a point.
-
parseCircle
Parse the given PgSphere geometry as a circle.- Parameters:
pgsphereExpr
- The PgSphere expression to parse as a circle.- Returns:
- A
Region
implementing a STC Circle region. - Throws:
ParseException
- If the PgSphere syntax of the given expression is wrong or does not correspond to a circle.
-
parseBox
Parse the given PgSphere geometry as a box.- Parameters:
pgsphereExpr
- The PgSphere expression to parse as a box.- Returns:
- A
Region
implementing a STC Box region. - Throws:
ParseException
- If the PgSphere syntax of the given expression is wrong or does not correspond to a box.
-
parsePolygon
Parse the given PgSphere geometry as a point.- Parameters:
pgsphereExpr
- The PgSphere expression to parse as a point.- Returns:
- A
Region
implementing a STC Position region. - Throws:
ParseException
- If the PgSphere syntax of the given expression is wrong or does not correspond to a point.
-