Java Code Examples for mil.nga.geopackage.core.contents.ContentsDataType#TILES

The following examples show how to use mil.nga.geopackage.core.contents.ContentsDataType#TILES . 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: TileMatrix.java    From geopackage-core-java with MIT License 6 votes vote down vote up
public void setContents(Contents contents) {
	this.contents = contents;
	if (contents != null) {
		// Verify the Contents have a tiles data type (Spec Requirement 42)
		ContentsDataType dataType = contents.getDataType();
		if (dataType == null
				|| (dataType != ContentsDataType.TILES && dataType != ContentsDataType.GRIDDED_COVERAGE)) {
			throw new GeoPackageException("The "
					+ Contents.class.getSimpleName() + " of a "
					+ TileMatrix.class.getSimpleName()
					+ " must have a data type of "
					+ ContentsDataType.TILES.getName() + " or "
					+ ContentsDataType.GRIDDED_COVERAGE.getName());
		}
		tableName = contents.getId();
	} else {
		tableName = null;
	}
}
 
Example 2
Source File: TileMatrixSet.java    From geopackage-core-java with MIT License 6 votes vote down vote up
public void setContents(Contents contents) {
	this.contents = contents;
	if (contents != null) {
		// Verify the Contents have a tiles data type (Spec Requirement 33)
		ContentsDataType dataType = contents.getDataType();
		if (dataType == null
				|| (dataType != ContentsDataType.TILES && dataType != ContentsDataType.GRIDDED_COVERAGE)) {
			throw new GeoPackageException("The "
					+ Contents.class.getSimpleName() + " of a "
					+ TileMatrixSet.class.getSimpleName()
					+ " must have a data type of "
					+ ContentsDataType.TILES.getName() + " or "
					+ ContentsDataType.GRIDDED_COVERAGE.getName());
		}
		tableName = contents.getId();
	} else {
		tableName = null;
	}
}
 
Example 3
Source File: GeoPackageCoreImpl.java    From geopackage-core-java with MIT License 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public boolean isFeatureOrTileTable(String table) {
	boolean isType = false;
	Contents contents = getTableContents(table);
	if (contents != null) {
		ContentsDataType dataType = contents.getDataType();
		isType = dataType != null && (dataType == ContentsDataType.FEATURES
				|| dataType == ContentsDataType.TILES);
	}
	return isType;
}
 
Example 4
Source File: TileTable.java    From geopackage-core-java with MIT License 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void validateContents(Contents contents) {
	// Verify the Contents have a tiles data type
	ContentsDataType dataType = contents.getDataType();
	if (dataType == null || (dataType != ContentsDataType.TILES
			&& dataType != ContentsDataType.GRIDDED_COVERAGE)) {
		throw new GeoPackageException(
				"The " + Contents.class.getSimpleName() + " of a "
						+ TileTable.class.getSimpleName()
						+ " must have a data type of "
						+ ContentsDataType.TILES.getName() + " or "
						+ ContentsDataType.GRIDDED_COVERAGE.getName());
	}
}