Class GeometryCoordinateDimension


  • public class GeometryCoordinateDimension
    extends Object
    This class is used to force the coordinate dimension of a geometry
    Author:
    Erwan Bocher, CNRS, 2020
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.locationtech.jts.geom.GeometryCollection convert​(org.locationtech.jts.geom.GeometryCollection gc, int dimension)
      Force the dimension of the GeometryCollection and update correctly the coordinate dimension
      static org.locationtech.jts.geom.LinearRing convert​(org.locationtech.jts.geom.LinearRing linearRing, int dimension)
      Force the dimension of the LinearRing and update correctly the coordinate dimension
      static org.locationtech.jts.geom.LineString convert​(org.locationtech.jts.geom.LineString lineString, int dimension)
      Force the dimension of the LineString and update correctly the coordinate dimension
      static org.locationtech.jts.geom.MultiLineString convert​(org.locationtech.jts.geom.MultiLineString multiLineString, int dimension)
      Force the dimension of the MultiLineString and update correctly the coordinate dimension
      static org.locationtech.jts.geom.MultiPoint convert​(org.locationtech.jts.geom.MultiPoint mp, int dimension)
      Force the dimension of the MultiPoint and update correctly the coordinate dimension
      static org.locationtech.jts.geom.MultiPolygon convert​(org.locationtech.jts.geom.MultiPolygon multiPolygon, int dimension)
      Force the dimension of the MultiPolygon and update correctly the coordinate dimension
      static org.locationtech.jts.geom.Polygon convert​(org.locationtech.jts.geom.Polygon polygon, int dimension)
      Force the dimension of the Polygon and update correctly the coordinate dimension
      static org.locationtech.jts.geom.Geometry force​(org.locationtech.jts.geom.Geometry geom, int dimension)
      Force the dimension of the geometry and update correctly the coordinate dimension
    • Constructor Detail

      • GeometryCoordinateDimension

        public GeometryCoordinateDimension()
    • Method Detail

      • force

        public static org.locationtech.jts.geom.Geometry force​(org.locationtech.jts.geom.Geometry geom,
                                                               int dimension)
        Force the dimension of the geometry and update correctly the coordinate dimension
        Parameters:
        geom - the input geometry
        dimension - supported dimension is 2, 3 if the dimension is set to 3 the z measure are set to 0
        Returns:
        Geometry
      • convert

        public static org.locationtech.jts.geom.MultiPoint convert​(org.locationtech.jts.geom.MultiPoint mp,
                                                                   int dimension)
        Force the dimension of the MultiPoint and update correctly the coordinate dimension
        Parameters:
        mp - MultiPoint
        dimension - coordinate dimension
        Returns:
        geometry with reduced dimension
      • convert

        public static org.locationtech.jts.geom.GeometryCollection convert​(org.locationtech.jts.geom.GeometryCollection gc,
                                                                           int dimension)
        Force the dimension of the GeometryCollection and update correctly the coordinate dimension
        Parameters:
        gc - GeometryCollection
        dimension - dimension to extract
        Returns:
        Geometry
      • convert

        public static org.locationtech.jts.geom.MultiPolygon convert​(org.locationtech.jts.geom.MultiPolygon multiPolygon,
                                                                     int dimension)
        Force the dimension of the MultiPolygon and update correctly the coordinate dimension
        Parameters:
        multiPolygon - MultiPolygon
        dimension - dimension to extract
        Returns:
        Geometry
      • convert

        public static org.locationtech.jts.geom.MultiLineString convert​(org.locationtech.jts.geom.MultiLineString multiLineString,
                                                                        int dimension)
        Force the dimension of the MultiLineString and update correctly the coordinate dimension
        Parameters:
        multiLineString - MultiLineString
        dimension - dimension to extract
        Returns:
        Geometry
      • convert

        public static org.locationtech.jts.geom.Polygon convert​(org.locationtech.jts.geom.Polygon polygon,
                                                                int dimension)
        Force the dimension of the Polygon and update correctly the coordinate dimension
        Parameters:
        polygon - Polygon
        dimension - dimension to extract
        Returns:
        Geometry
      • convert

        public static org.locationtech.jts.geom.LineString convert​(org.locationtech.jts.geom.LineString lineString,
                                                                   int dimension)
        Force the dimension of the LineString and update correctly the coordinate dimension
        Parameters:
        lineString - LineString
        dimension - dimension to extract
        Returns:
        Geometry
      • convert

        public static org.locationtech.jts.geom.LinearRing convert​(org.locationtech.jts.geom.LinearRing linearRing,
                                                                   int dimension)
        Force the dimension of the LinearRing and update correctly the coordinate dimension
        Parameters:
        linearRing - LinearRing
        dimension - dimension to extract
        Returns:
        LinearRing