本文整理汇总了Java中mil.nga.geopackage.core.srs.SpatialReferenceSystemSfSql类的典型用法代码示例。如果您正苦于以下问题:Java SpatialReferenceSystemSfSql类的具体用法?Java SpatialReferenceSystemSfSql怎么用?Java SpatialReferenceSystemSfSql使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpatialReferenceSystemSfSql类属于mil.nga.geopackage.core.srs包,在下文中一共展示了SpatialReferenceSystemSfSql类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSpatialReferenceSystemSfSqlDao
import mil.nga.geopackage.core.srs.SpatialReferenceSystemSfSql; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public SpatialReferenceSystemSfSqlDao getSpatialReferenceSystemSfSqlDao() {
SpatialReferenceSystemSfSqlDao dao = createDao(SpatialReferenceSystemSfSql.class);
verifyTableExists(dao);
return dao;
}
示例2: testSfSqlRead
import mil.nga.geopackage.core.srs.SpatialReferenceSystemSfSql; //导入依赖的package包/类
/**
* Test SF/SQL read
*
* @param geoPackage
* @param expectedResults
* @throws SQLException
*/
public static void testSfSqlRead(GeoPackage geoPackage, int expectedResults)
throws SQLException {
SpatialReferenceSystemSfSqlDao dao = geoPackage
.getSpatialReferenceSystemSfSqlDao();
List<SpatialReferenceSystemSfSql> results = dao.queryForAll();
TestCase.assertEquals(
"Unexpected number of spatial reference system rows",
expectedResults, results.size());
if (!results.isEmpty()) {
// Verify non nulls
for (SpatialReferenceSystemSfSql result : results) {
TestCase.assertNotNull(result.getSrid());
TestCase.assertNotNull(result.getAuthName());
TestCase.assertNotNull(result.getAuthSrid());
}
// Choose random srs
int random = (int) (Math.random() * results.size());
SpatialReferenceSystemSfSql srs = results.get(random);
// Query by id
SpatialReferenceSystemSfSql querySrs = dao
.queryForId(srs.getSrid());
TestCase.assertNotNull(querySrs);
TestCase.assertEquals(srs.getSrid(), querySrs.getSrid());
// Query for equal
List<SpatialReferenceSystemSfSql> querySrsList = dao.queryForEq(
SpatialReferenceSystemSfSql.COLUMN_AUTH_NAME,
srs.getAuthName());
TestCase.assertNotNull(querySrsList);
TestCase.assertTrue(querySrsList.size() >= 1);
boolean found = false;
for (SpatialReferenceSystemSfSql querySrsValue : querySrsList) {
TestCase.assertEquals(srs.getAuthName(),
querySrsValue.getAuthName());
if (!found) {
found = srs.getSrid() == querySrsValue.getSrid();
}
}
TestCase.assertTrue(found);
}
}