Package org.bremersee.geojson.utils
Class ConvertHelper
- java.lang.Object
-
- org.bremersee.geojson.utils.ConvertHelper
-
- All Implemented Interfaces:
Serializable
public class ConvertHelper extends Object implements Serializable
The convert helper.- Author:
- Christian Bremer
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConvertHelper()Instantiates a new convert helper.ConvertHelper(org.locationtech.jts.geom.GeometryFactory geometryFactory)Instantiates a new convert helper.ConvertHelper(org.locationtech.jts.geom.GeometryFactory geometryFactory, boolean useBigDecimal)Instantiates a new convert helper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>create(org.locationtech.jts.geom.Geometry geometry)Create json map.org.locationtech.jts.geom.GeometryCollectioncreateGeometryCollection(List<org.locationtech.jts.geom.Geometry> geometries)Create geometry collection.org.locationtech.jts.geom.LineStringcreateLineString(List<Object> coordinates)Create line string.org.locationtech.jts.geom.MultiLineStringcreateMultiLineString(List<Object> coordinates)Create multi line string.org.locationtech.jts.geom.MultiPointcreateMultiPoint(List<Object> coordinates)Create multi point.org.locationtech.jts.geom.MultiPolygoncreateMultiPolygon(List<Object> coordinates)Create multi polygon.org.locationtech.jts.geom.PointcreatePoint(List<Object> coordinates)Create point.org.locationtech.jts.geom.PolygoncreatePolygon(List<Object> coordinates)Create polygon.org.locationtech.jts.geom.GeometryFactorygetGeometryFactory()Gets geometry factory.
-
-
-
Constructor Detail
-
ConvertHelper
public ConvertHelper()
Instantiates a new convert helper.
-
ConvertHelper
public ConvertHelper(org.locationtech.jts.geom.GeometryFactory geometryFactory)
Instantiates a new convert helper.- Parameters:
geometryFactory- the geometry factory
-
ConvertHelper
public ConvertHelper(org.locationtech.jts.geom.GeometryFactory geometryFactory, boolean useBigDecimal)Instantiates a new convert helper.- Parameters:
geometryFactory- the geometry factoryuseBigDecimal- useBigDecimal(recommended for JSON, set to false for MongoDB)
-
-
Method Detail
-
getGeometryFactory
public org.locationtech.jts.geom.GeometryFactory getGeometryFactory()
Gets geometry factory.- Returns:
- the geometry factory
-
createPoint
public org.locationtech.jts.geom.Point createPoint(List<Object> coordinates)
Create point.- Parameters:
coordinates- the coordinates- Returns:
- the point
-
createLineString
public org.locationtech.jts.geom.LineString createLineString(List<Object> coordinates)
Create line string.- Parameters:
coordinates- the coordinates- Returns:
- the line string
-
createPolygon
public org.locationtech.jts.geom.Polygon createPolygon(List<Object> coordinates)
Create polygon.- Parameters:
coordinates- the coordinates- Returns:
- the polygon
-
createMultiPoint
public org.locationtech.jts.geom.MultiPoint createMultiPoint(List<Object> coordinates)
Create multi point.- Parameters:
coordinates- the coordinates- Returns:
- the multi point
-
createMultiLineString
public org.locationtech.jts.geom.MultiLineString createMultiLineString(List<Object> coordinates)
Create multi line string.- Parameters:
coordinates- the coordinates- Returns:
- the multi line string
-
createMultiPolygon
public org.locationtech.jts.geom.MultiPolygon createMultiPolygon(List<Object> coordinates)
Create multi polygon.- Parameters:
coordinates- the coordinates- Returns:
- the multi polygon
-
createGeometryCollection
public org.locationtech.jts.geom.GeometryCollection createGeometryCollection(List<org.locationtech.jts.geom.Geometry> geometries)
Create geometry collection.- Parameters:
geometries- the geometries- Returns:
- the geometry collection
-
-