Java Code Examples for mil.nga.geopackage.features.user.FeatureColumn#createColumn()

The following examples show how to use mil.nga.geopackage.features.user.FeatureColumn#createColumn() . 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: GeoPackageTestUtils.java    From geopackage-java with MIT License 5 votes vote down vote up
/**
 * Get additional feature columns to create
 * 
 * @return
 */
public static List<FeatureColumn> getFeatureColumns() {
	List<FeatureColumn> columns = new ArrayList<FeatureColumn>();

	columns.add(FeatureColumn.createColumn(7, "test_text_limited",
			GeoPackageDataType.TEXT, 5L));
	columns.add(FeatureColumn.createColumn(8, "test_blob_limited",
			GeoPackageDataType.BLOB, 7L));
	columns.add(FeatureColumn.createColumn(9, "test_date",
			GeoPackageDataType.DATE));
	columns.add(FeatureColumn.createColumn(10, "test_datetime",
			GeoPackageDataType.DATETIME));
	columns.add(FeatureColumn.createColumn(2, "test_text",
			GeoPackageDataType.TEXT, false, ""));
	columns.add(FeatureColumn.createColumn(3, "test_real",
			GeoPackageDataType.REAL));
	columns.add(FeatureColumn.createColumn(4, "test_boolean",
			GeoPackageDataType.BOOLEAN));

	FeatureColumn blobColumn = FeatureColumn.createColumn("test_blob",
			GeoPackageDataType.BLOB);
	columns.add(blobColumn);
	// Let the index for this column be automatically set to 5
	// blobColumn.setIndex(5);

	// Test setting an index after column creation but before table creation
	FeatureColumn integerColumn = FeatureColumn.createColumn("test_integer",
			GeoPackageDataType.INTEGER);
	columns.add(integerColumn);
	integerColumn.setIndex(6);

	return columns;
}
 
Example 2
Source File: FeatureCoreGenerator.java    From geopackage-core-java with MIT License 2 votes vote down vote up
/**
 * Create a feature column
 * 
 * @param name
 *            column name
 * @param value
 *            value
 * @return feature column
 */
protected FeatureColumn createColumn(String name, Object value) {
	GeoPackageDataType type = getType(value);
	return FeatureColumn.createColumn(name, type);
}