Java Code Examples for mil.nga.geopackage.GeoPackageConstants#GEOMETRY_EXTENSION_PREFIX

The following examples show how to use mil.nga.geopackage.GeoPackageConstants#GEOMETRY_EXTENSION_PREFIX . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GeometryExtensions.java    From geopackage-core-java with MIT License 6 votes vote down vote up
/**
 * Get the extension name of a GeoPackage extension Geometry
 * 
 * @param geometryType
 *            geometry type
 * @return extension name
 */
public static String getExtensionName(GeometryType geometryType) {

	if (!isExtension(geometryType)) {
		throw new GeoPackageException(GeometryType.class.getSimpleName()
				+ " is not an extension: " + geometryType.getName());
	}

	if (!isGeoPackageExtension(geometryType)) {
		throw new GeoPackageException(
				GeometryType.class.getSimpleName()
						+ " is not a GeoPackage extension, User-Defined requires an author: "
						+ geometryType.getName());
	}

	String extensionName = GeoPackageConstants.EXTENSION_AUTHOR
			+ Extensions.EXTENSION_NAME_DIVIDER
			+ GeoPackageConstants.GEOMETRY_EXTENSION_PREFIX
			+ Extensions.EXTENSION_NAME_DIVIDER + geometryType.getName();

	return extensionName;
}
 
Example 2
Source File: GeometryExtensions.java    From geopackage-core-java with MIT License 6 votes vote down vote up
/**
 * Get the extension name of a extension Geometry, either user-defined or
 * GeoPackage extension
 * 
 * @param author
 *            author
 * @param geometryType
 *            geometry type
 * @return extension name
 * @deprecated as of 1.2.1, On August 15, 2016 the GeoPackage SWG voted to
 *             remove this extension from the standard due to
 *             interoperability concerns. (GeoPackage version 1.2)
 */
public static String getExtensionName(String author,
		GeometryType geometryType) {

	if (!isExtension(geometryType)) {
		throw new GeoPackageException(GeometryType.class.getSimpleName()
				+ " is not an extension: " + geometryType.getName());
	}

	String extensionName = (isGeoPackageExtension(geometryType) ? GeoPackageConstants.EXTENSION_AUTHOR
			: author)
			+ Extensions.EXTENSION_NAME_DIVIDER
			+ GeoPackageConstants.GEOMETRY_EXTENSION_PREFIX
			+ Extensions.EXTENSION_NAME_DIVIDER + geometryType.getName();

	return extensionName;
}