Module geom

To get more information about Geometry methods see Geometry javadoc

Commons geometries methods

Interface Geometry

Geometry types

Point

  • getX(): Returns the X coordinate
  • getY(): Returns the Y coordinate
  • getCoordinateAt(dimension): Gets the coordinate in a concrete dimension
    • param dimension: Dimension coordinate to get
    • type dimension: integer
    • allowed values: 0=X, 1=Y, 2=Z
  • setX(value): Sets the X coordinate
    • param value: Value of the dimension X
    • type value: double
  • setY(value): Sets the Y coordinate
    • param value: Value of the dimension Y
    • type value: double
  • setCoordinateAt(dimension, value): Sets a ordinate in a concrete dimension
    • param dimension: Dimension coordinate to set
    • type dimension: integer
    • param value: Value of the dimension
    • type value: double

Line


  • addVertex(point): Adds a vertex to the curve
    • param point: Point to addLayer
    • type: Point
  • getNumVertices(): Gets the number of vertex of the curve
  • getVertex(index): Gets a vertex
    • param index: Geometry vertex index
    • type index: integer

Polygon


  • addVertex(point): Adds a vertex to the curve
    • param point: Point to addLayer
    • type: Point
  • getNumVertices(): Gets the number of vertex of the curve
  • getVertex(index): Gets a vertex
    • param index: Geometry vertex index
    • type index: integer
  • getSurfaceAppearance(): Gets surface appearance
  • setSurfaceAppearance(appearance): Sets surface appearance

Multigeometry

  • getPrimitiveAt(int i): Returns one of the Primitive's that is in a concrete position. - param i: geometry position - type i: integer
  • getPrimitivesNumber(): Returns the number of Primitive's that composes this multi geometry.

Geometry util functions

  • createGeometry(type[, subtype]): Create a new geometry with a concrete type and subtype
    • param type: geometry type
      • type type: integer
    • param subtype: (Optional) geometry subtype
      • type type: integer
    • return: geometry


  • createPoint([x][, y][, subtype]): Create a new point with a subtype dimensions and sets the value for 'X' and 'Y' coordinates. If is used without parameters will return new Point2D with (0,0) coordinates
    • param x:(Optional) X coordinate value
      • type x: double
    • param y:(Optional) Y coordinate value
      • type y: double
    • param subtype: (Optional) geometry dimensions
      • type: integer
    • return: Point


  • createMultiPoint(points[, subtype]): Create a new multipoint with a subtype from a list values of X and Y like ([x1, y1], [x2, y2], ...., [xn, yn])
    • param points: list of tuples with X and Y values
      • type points: list
    • param subtype: (Optional) geometry dimensions
      • type: integer
    • return: multipoint