Class PgSphereTranslator.PgSphereGeometryParser

java.lang.Object
adql.translator.PgSphereTranslator.PgSphereGeometryParser
Enclosing class:
PgSphereTranslator

protected static class PgSphereTranslator.PgSphereGeometryParser extends 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:

  • 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
Version:
1.3 (11/2014)
Author:
Grégory Mantelet (ARI)
  • Constructor Details

    • PgSphereGeometryParser

      public PgSphereGeometryParser()
      Build the PgSphere parser.
  • Method Details

    • parsePoint

      public STCS.Region parsePoint(String pgsphereExpr) throws ParseException
      Parse the given PgSphere geometry as a point.
      Parameters:
      pgsphereExpr - The PgSphere expression to parse as a point.
      Returns:
      A STCS.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

      public STCS.Region parseCircle(String pgsphereExpr) throws ParseException
      Parse the given PgSphere geometry as a circle.
      Parameters:
      pgsphereExpr - The PgSphere expression to parse as a circle.
      Returns:
      A STCS.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

      public STCS.Region parseBox(String pgsphereExpr) throws ParseException
      Parse the given PgSphere geometry as a box.
      Parameters:
      pgsphereExpr - The PgSphere expression to parse as a box.
      Returns:
      A STCS.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

      public STCS.Region parsePolygon(String pgsphereExpr) throws ParseException
      Parse the given PgSphere geometry as a point.
      Parameters:
      pgsphereExpr - The PgSphere expression to parse as a point.
      Returns:
      A STCS.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.