public class GmlUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GmlUtils.GmlNamespaceContext
A NamespaceContext that only recognizes the conventional "gml" namespace
prefix.
|
static class |
GmlUtils.NodeNamespaceContext
A NamespaceContext that provides the in-scope namespace bindings for a
given DOM Node.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
GML_NS |
static String |
SRS_NAME |
(package private) static int |
TOTAL_ARC_POINTS
Total number of arc points to be computed (including end points).
|
| Constructor and Description |
|---|
GmlUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.vividsolutions.jts.geom.LineString |
buildLineString(org.geotoolkit.gml.xml.Curve gmlCurve)
Creates a JTS LineString geometry from a GML Curve geometry.
|
static com.vividsolutions.jts.geom.Geometry |
computeConvexHull(org.geotoolkit.gml.xml.AbstractGeometry gmlGeom)
Calculates the planar convex hull of the given GML geometry element.
|
static Element |
convertToMultiType(Node geomNode)
Convert Surface or Curve geometry to MultiSurface or MultiCurve.
|
static void |
extractCoordinatesFromPosList(List<Double> tupleList,
int crsDim,
List<com.vividsolutions.jts.geom.Coordinate> coords)
Extracts (2D) coordinates from a sequence of coordinate tuples and adds
them to a list.
|
static String |
findCRSReference(Element geom)
Returns the value of the srsName attribute for the given geometry
element.
|
static TemporalGeometricPrimitive |
gmlToTemporalGeometricPrimitive(Element gmlTime)
Creates a TemporalGeometricPrimitive instance from a GML temporal value
representation.
|
static boolean |
hasChildElement(Element elem,
String namespace,
String localName)
Checks if a DOM Element has a child element with the given qualified
name.
|
static void |
inferPointsOnArc(org.geotoolkit.gml.xml.AbstractCurveSegment segment,
CoordinateReferenceSystem crs,
List<com.vividsolutions.jts.geom.Coordinate> coordList)
Computes the positions of at least three points on a curve segment
representing an arc: the two end points and one or more intermediate
points.
|
static double |
lengthInMeters(org.geotoolkit.gml.xml.v321.LengthType length)
Converts the given length measurement to meters.
|
static int |
minCurveSegmentLength(String segmentTypeName)
Indicates the minimum number of direct positions required to specify a
GML curve segment.
|
static void |
setSrsNameOnCollectionMembers(Node... geometryNodes)
Sets the srsName attribute on all members of a GML geometry collection if
it is specified for the collection.
|
static org.geotoolkit.gml.xml.AbstractGeometry |
unmarshalGMLGeometry(Source source)
Deserializes an XML source into a GML geometry representation.
|
static org.geotoolkit.gml.xml.AbstractGeometry |
unmarshalGMLGeometry(URI uriRef)
Deserializes an XML resource into a GML geometry representation.
|
public static final String SRS_NAME
public static final String GML_NS
static final int TOTAL_ARC_POINTS
public static void inferPointsOnArc(org.geotoolkit.gml.xml.AbstractCurveSegment segment,
CoordinateReferenceSystem crs,
List<com.vividsolutions.jts.geom.Coordinate> coordList)
TOTAL_ARC_POINTS; the approximation improves as the number of
points increases. The calculated positions are added to the given list as
JTS Coordinate objects.segment - A curve segment representing an arc (gml:ArcByCenterPoint or
an allowable substitution).crs - The CRS used by the curve to which this segment belongs.coordList - The collection to which the coordinates will be added.public static com.vividsolutions.jts.geom.Geometry computeConvexHull(org.geotoolkit.gml.xml.AbstractGeometry gmlGeom)
gmlGeom - A GML geometry element.Polygon if the hull
contains 3 or more points; fewer points will produce a
LineString or a Point.public static void setSrsNameOnCollectionMembers(Node... geometryNodes)
geometryNodes - A sequence of GML geometry elements.public static double lengthInMeters(org.geotoolkit.gml.xml.v321.LengthType length)
| Unit | Symbol(s) | Length /m |
|---|---|---|
| meter | m | 1 |
| mile | mi | 1609.34 |
| nautical mile | M, NM, [nmi_i] | 1852 |
length - A length measurement.public static void extractCoordinatesFromPosList(List<Double> tupleList, int crsDim, List<com.vividsolutions.jts.geom.Coordinate> coords)
tupleList - A sequence of coordinate tuples within the same coordinate
reference system (CRS).crsDim - The dimension of the CRS.coords - The list to which the coordinates will be added.public static int minCurveSegmentLength(String segmentTypeName)
segmentTypeName - The local name of element representing a the curve segment.public static String findCRSReference(Element geom)
As a side effect, an implicit CRS reference will be added to the element using the inherited srsName value.
geom - An Element representing a GML geometry object.public static boolean hasChildElement(Element elem, String namespace, String localName)
elem - A DOM Element.namespace - A namespace name (absolute URI).localName - A String representing the local name of an element.true if one or more matching child elements are present;
false otherwise.public static org.geotoolkit.gml.xml.AbstractGeometry unmarshalGMLGeometry(URI uriRef) throws JAXBException
uriRef - An absolute URI that specifies the location of the resource.JAXBException - If any unexpected errors occur while unmarshalling.public static org.geotoolkit.gml.xml.AbstractGeometry unmarshalGMLGeometry(Source source) throws JAXBException
source - The source to read from (providers are only required to
support SAXSource, DOMSource, and StreamSource).JAXBException - If any unexpected errors occur while unmarshalling.public static com.vividsolutions.jts.geom.LineString buildLineString(org.geotoolkit.gml.xml.Curve gmlCurve)
gmlCurve - A GML curve.public static TemporalGeometricPrimitive gmlToTemporalGeometricPrimitive(Element gmlTime)
gmlTime - A gml:TimeInstant or gml:TimePeriod element.Copyright © 2020 Open Geospatial Consortium. All rights reserved.