当前位置: 首页>>代码示例>>Java>>正文


Java SpatialReferenceSystemSfSql类代码示例

本文整理汇总了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;
}
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:12,代码来源:GeoPackageCoreImpl.java

示例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);

	}
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:55,代码来源:SpatialReferenceSystemUtils.java


注:本文中的mil.nga.geopackage.core.srs.SpatialReferenceSystemSfSql类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。