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

The following examples show how to use mil.nga.geopackage.core.contents.ContentsDataType#FEATURES . 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: GeometryColumns.java    From geopackage-core-java with MIT License 6 votes vote down vote up
/**
 * Set the contents
 * 
 * @param contents
 *            contents
 */
public void setContents(Contents contents) {
	this.contents = contents;
	if (contents != null) {
		// Verify the Contents have a features data type (Spec Requirement
		// 23)
		ContentsDataType dataType = contents.getDataType();
		if (dataType == null || dataType != ContentsDataType.FEATURES) {
			throw new GeoPackageException(
					"The " + Contents.class.getSimpleName() + " of a "
							+ GeometryColumns.class.getSimpleName()
							+ " must have a data type of "
							+ ContentsDataType.FEATURES.getName());
		}
		tableName = contents.getId();
	} else {
		tableName = null;
	}
}
 
Example 2
Source File: GeometryColumnsSqlMm.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 features data type (Spec Requirement
		// 23)
		ContentsDataType dataType = contents.getDataType();
		if (dataType == null || dataType != ContentsDataType.FEATURES) {
			throw new GeoPackageException("The "
					+ Contents.class.getSimpleName() + " of a "
					+ GeometryColumnsSqlMm.class.getSimpleName()
					+ " must have a data type of "
					+ ContentsDataType.FEATURES.getName());
		}
		tableName = contents.getId();
	}
}
 
Example 3
Source File: GeometryColumnsSfSql.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 features data type (Spec Requirement
		// 23)
		ContentsDataType dataType = contents.getDataType();
		if (dataType == null || dataType != ContentsDataType.FEATURES) {
			throw new GeoPackageException("The "
					+ Contents.class.getSimpleName() + " of a "
					+ GeometryColumnsSfSql.class.getSimpleName()
					+ " must have a data type of "
					+ ContentsDataType.FEATURES.getName());
		}
		fTableName = contents.getId();
	}
}
 
Example 4
Source File: FeatureTable.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 features data type
	ContentsDataType dataType = contents.getDataType();
	if (dataType == null || dataType != ContentsDataType.FEATURES) {
		throw new GeoPackageException(
				"The " + Contents.class.getSimpleName() + " of a "
						+ FeatureTable.class.getSimpleName()
						+ " must have a data type of "
						+ ContentsDataType.FEATURES.getName());
	}
}
 
Example 5
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;
}