Class GML2EncodingUtils


  • public class GML2EncodingUtils
    extends Object
    Utility methods used by gml2 bindigns when encodding.
    Author:
    Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org, Ben Caradoc-Davies, CSIRO Exploration and Mining
    • Constructor Detail

      • GML2EncodingUtils

        public GML2EncodingUtils()
    • Method Detail

      • toURI

        public static String toURI​(CoordinateReferenceSystem crs,
                                   boolean forceOldStyle)
        Encodes the crs object as a uri.

        The axis order of the crs determines which form of uri is used.

      • toURI

        public static String toURI​(CoordinateReferenceSystem crs,
                                   SrsSyntax srsSyntax,
                                   boolean switchCode)
        Encodes the crs object as a uri using the specified syntax.
        Parameters:
        crs - The CRS to be evaluated
        srsSyntax - The syntax to use
        switchCode - If true, the authority and code will be switched to HTTP URI automatically if the CRS axis order is east/north or inapplicable
      • getID

        public static String getID​(Geometry g)
        Determines the identifier (gml:id) of the geometry by checking Geometry.getUserData().

        This method returns null when no id can be found.

      • setID

        public static void setID​(Geometry g,
                                 String id)
        Set the identifier (gml:id) of the geometry as a key in the user data map Geometry.getUserData() (creating it withGeometry.getUserData() if it does not already exist). If the user data exists and is not a Map, this method has no effect.
        Parameters:
        g - the geometry
        id - the gml:id to be set
      • getName

        public static String getName​(Geometry g)
        Determines the description (gml:description) of the geometry by checking Geometry.getUserData().

        This method returns null when no name can be found.

      • setName

        public static void setName​(Geometry g,
                                   String name)
        Set the name (gml:name) of the geometry as a key in the user data map Geometry.getUserData() (creating it withGeometry.getUserData() if it does not already exist). If the user data exists and is not a Map, this method has no effect.
        Parameters:
        g - the geometry
        name - the gml:name to be set
      • getDescription

        public static String getDescription​(Geometry g)
        Determines the name (gml:name) of the geometry by checking Geometry.getUserData().

        This method returns null when no description can be found.

      • setDescription

        public static void setDescription​(Geometry g,
                                          String description)
        Set the description (gml:description) of the geometry as a key in the user data map Geometry.getUserData() (creating it withGeometry.getUserData() if it does not already exist). If the user data exists and is not a Map, this method has no effect.
        Parameters:
        g - the geometry
        description - the gml:description to be set
      • AbstractFeatureType_encode

        public static Element AbstractFeatureType_encode​(Object object,
                                                         Document document,
                                                         Element value)
      • AbstractFeatureType_getProperties

        public static List<Object[]> AbstractFeatureType_getProperties​(Object object,
                                                                       XSDElementDeclaration element,
                                                                       SchemaIndex schemaIndex,
                                                                       Set<String> toFilter,
                                                                       Configuration configuration)
      • createXmlTypeFromFeatureType

        public static XSDTypeDefinition createXmlTypeFromFeatureType​(SimpleFeatureType featureType,
                                                                     SchemaIndex schemaIndex,
                                                                     Set<String> toFilter)
      • GeometryPropertyType_getProperty

        public static Object GeometryPropertyType_getProperty​(Geometry geometry,
                                                              QName name)
      • GeometryPropertyType_getProperty

        public static Object GeometryPropertyType_getProperty​(Geometry geometry,
                                                              QName name,
                                                              boolean includeAbstractGeometry)
      • GeometryPropertyType_getProperties

        public static List<Object[]> GeometryPropertyType_getProperties​(Geometry geometry)
      • getGeometryDimension

        public static Integer getGeometryDimension​(Geometry geometry,
                                                   Configuration config)
        Returns the geometry dimension, either as forced in the configuration, or the geometry natural one