Package org.goplanit.io.geo
Class PlanitGmlUtils
- java.lang.Object
-
- org.goplanit.io.geo.PlanitGmlUtils
-
public class PlanitGmlUtils extends Object
Utilities specific to GML- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description PlanitGmlUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static net.opengis.gml.CoordinatesType
createGmlCoordinatesType(org.locationtech.jts.geom.Coordinate[] coordinates, Character commaSeparator, Character decimalSeparator, DecimalFormat decimalFormat, Character tupleSeparator)
Takes a list of JTS coordinates and converts it to GML coordinates value, i.e., converts all coordinates to a string based on provided comma, decimal, tuple separators in 2D format.static List<net.opengis.gml.CoordType>
createGmlCoordList(org.locationtech.jts.geom.Coordinate[] coordinates)
Create a list of coordType instances based on provided JTS coordinatesstatic net.opengis.gml.CoordType
createGmlCoordType(org.locationtech.jts.geom.Coordinate coordinate)
Create a coordType instance based on provided JTS coordinatestatic net.opengis.gml.DirectPositionType
createGmlDirectPositionType(org.locationtech.jts.geom.Coordinate coordinate)
Convert coordinate to DirectPositionTypestatic net.opengis.gml.LineStringType
createGmlLineStringType(net.opengis.gml.CoordinatesType coordsType)
Takes a JTS line string and converts it to GML LineStringType.static net.opengis.gml.LineStringType
createGmlLineStringType(org.locationtech.jts.geom.LineString lineString, Character commaSeparator, Character decimalSeparator, DecimalFormat decimalFormat, Character tupleSeparator)
Takes a JTS line string and converts it to GML LineStringType.static net.opengis.gml.PointType
createGmlPointType(org.locationtech.jts.geom.Coordinate coordinate)
Convert coordinate to PointTypestatic net.opengis.gml.PolygonType
createGmlPolygonType(org.locationtech.jts.geom.Coordinate[] outerBoundaryCoordinates)
Create a GML PolygonType from a JTS Polygon
-
-
-
Method Detail
-
createGmlCoordinatesType
public static net.opengis.gml.CoordinatesType createGmlCoordinatesType(org.locationtech.jts.geom.Coordinate[] coordinates, Character commaSeparator, Character decimalSeparator, DecimalFormat decimalFormat, Character tupleSeparator)
Takes a list of JTS coordinates and converts it to GML coordinates value, i.e., converts all coordinates to a string based on provided comma, decimal, tuple separators in 2D format. The result is a GML CoordinatesType- Parameters:
coordinates
- array of coordinatescommaSeparator
- to usedecimalSeparator
- to usedecimalFormat
- to usetupleSeparator
- to use- Returns:
- created GML coordinates type instance
-
createGmlCoordType
public static net.opengis.gml.CoordType createGmlCoordType(org.locationtech.jts.geom.Coordinate coordinate)
Create a coordType instance based on provided JTS coordinate- Parameters:
coordinate
- to convert- Returns:
- coordType created
-
createGmlCoordList
public static List<net.opengis.gml.CoordType> createGmlCoordList(org.locationtech.jts.geom.Coordinate[] coordinates)
Create a list of coordType instances based on provided JTS coordinates- Parameters:
coordinates
- to convert- Returns:
- coordtype list
-
createGmlDirectPositionType
public static net.opengis.gml.DirectPositionType createGmlDirectPositionType(org.locationtech.jts.geom.Coordinate coordinate)
Convert coordinate to DirectPositionType- Parameters:
coordinate
- to convert to GML direct position- Returns:
- created GML pos
-
createGmlPointType
public static net.opengis.gml.PointType createGmlPointType(org.locationtech.jts.geom.Coordinate coordinate)
Convert coordinate to PointType- Parameters:
coordinate
- to convert- Returns:
- created GML point type
-
createGmlLineStringType
public static net.opengis.gml.LineStringType createGmlLineStringType(org.locationtech.jts.geom.LineString lineString, Character commaSeparator, Character decimalSeparator, DecimalFormat decimalFormat, Character tupleSeparator)
Takes a JTS line string and converts it to GML LineStringType.- Parameters:
lineString
- to extract fromcommaSeparator
- to usedecimalSeparator
- to usedecimalFormat
- to usetupleSeparator
- to use- Returns:
- created GML LineStringType instance
-
createGmlLineStringType
public static net.opengis.gml.LineStringType createGmlLineStringType(net.opengis.gml.CoordinatesType coordsType)
Takes a JTS line string and converts it to GML LineStringType.- Parameters:
coordsType
- to use- Returns:
- created GML LineStringType instance
-
createGmlPolygonType
public static net.opengis.gml.PolygonType createGmlPolygonType(org.locationtech.jts.geom.Coordinate[] outerBoundaryCoordinates)
Create a GML PolygonType from a JTS Polygon- Parameters:
outerBoundaryCoordinates
- of the JTS polygon, e.g. last coordinate is equal to first and at least three coordinates- Returns:
- created PolygonType
-
-