Class GeometryCodes


  • public class GeometryCodes
    extends Object
    Geometry Code utilities to convert between geometry attributes and geometry codes
    Author:
    osbornb
    • Constructor Detail

      • GeometryCodes

        public GeometryCodes()
    • Method Detail

      • getCode

        public static int getCode​(Geometry geometry)
        Get the geometry code from the geometry
        Parameters:
        geometry - geometry
        Returns:
        geometry code
      • getCode

        public static int getCode​(GeometryType geometryType,
                                  boolean hasZ,
                                  boolean hasM)
        Get the geometry code from the geometry type
        Parameters:
        geometryType - geometry type
        hasZ - has z
        hasM - mas m
        Returns:
        geometry code
        Since:
        2.0.3
      • getCode

        public static int getCode​(GeometryType geometryType)
        Get the geometry code from the geometry type
        Parameters:
        geometryType - geometry type
        Returns:
        geometry code
      • getWKBCode

        public static int getWKBCode​(Geometry geometry)
        Get the well-known binary writable geometry code from the geometry
        Parameters:
        geometry - geometry
        Returns:
        geometry code
        Since:
        2.2.1
      • getWKBGeometryType

        public static GeometryType getWKBGeometryType​(Geometry geometry)
        Get the well-known binary writable geometry type from the geometry
        Parameters:
        geometry - geometry
        Returns:
        geometry type
        Since:
        2.2.1
      • getGeometryType

        public static GeometryType getGeometryType​(int code)
        Get the Geometry Type from the code
        Parameters:
        code - geometry type code
        Returns:
        geometry type
      • hasZ

        public static boolean hasZ​(int code)
        Determine if the geometry code has a Z (3D) value
        Parameters:
        code - geometry code
        Returns:
        true is has Z
      • hasM

        public static boolean hasM​(int code)
        Determine if the geometry code has a M (linear referencing system) value
        Parameters:
        code - geometry code
        Returns:
        true is has M
      • getGeometryMode

        public static int getGeometryMode​(int code)
        Get the geometry mode from the geometry code. Returns the digit in the thousands place. (z is enabled when 1 or 3, m is enabled when 2 or 3)
        Parameters:
        code - geometry code
        Returns:
        geometry mode