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


Java CRS.getAuthorityFactory方法代码示例

本文整理汇总了Java中org.geotools.referencing.CRS.getAuthorityFactory方法的典型用法代码示例。如果您正苦于以下问题:Java CRS.getAuthorityFactory方法的具体用法?Java CRS.getAuthorityFactory怎么用?Java CRS.getAuthorityFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.geotools.referencing.CRS的用法示例。


在下文中一共展示了CRS.getAuthorityFactory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toShapeFile

import org.geotools.referencing.CRS; //导入方法依赖的package包/类
/**
 * write a shapefile representing the grid in a coordinate ref system ex :
 * "EPSG:2975" -> RGR92, "EPSG:2154" -> L93, "EPSG:4326" -> WGS84
 * 
 * @param fileName
 * @param epsg
 */
public void toShapeFile(String fileName, String epsg) {
    FT_FeatureCollection<IFeature> pop = new FT_FeatureCollection<>();
    System.out.println("writing..." + fileName);
    for (int i = 0; i < nbRows(); ++i)
        for (int j = 0; j < nbCols(); ++j)
            pop.add(new DefaultFeature(tiles[i][j]));

    CRSAuthorityFactory factory = CRS.getAuthorityFactory(true);
    CoordinateReferenceSystem crs = null;
    try {
        crs = factory.createCoordinateReferenceSystem(epsg);
    } catch (FactoryException e) {
        e.printStackTrace();
    }
    ShapefileWriter.write(pop, fileName, crs);
    System.out.println("writing done");
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:25,代码来源:Grid.java

示例2: selectCRS

import org.geotools.referencing.CRS; //导入方法依赖的package包/类
/**
 * search the CRS database and return any which include the string provided.
 *
 * @param value
 *          - a string to search for.
 * @return an ArrayList of CRS that match (may be empty, but not null).
 */
private ArrayList<CoordinateReferenceSystem> selectCRS(String value) {
	String lValue = value.toLowerCase();
	ArrayList<CoordinateReferenceSystem> ret = new ArrayList<CoordinateReferenceSystem>();
	ArrayList<CoordinateReferenceSystem> possibles = listCRS();
	CRSAuthorityFactory factory = CRS.getAuthorityFactory(false);

	for (CoordinateReferenceSystem crs : possibles) {
		if (crs.getName().getCode().toLowerCase().contains(lValue)) {
			ret.add(crs);
		} else if (crs.getName().getCodeSpace() != null
				&& crs.getName().getCodeSpace().toLowerCase().contains(lValue)) {
			ret.add(crs);
		} else if (crs.getRemarks() != null
				&& crs.getRemarks().toString().contains(lValue)) {
			ret.add(crs);
		} else if (crs.getCoordinateSystem().getRemarks() != null
				&& crs.getCoordinateSystem().getRemarks().toString().toLowerCase()
						.contains(lValue)) {
			ret.add(crs);
		}

	}
	return ret;
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:32,代码来源:QueryEPSG.java

示例3: listDb

import org.geotools.referencing.CRS; //导入方法依赖的package包/类
/**
 * ask the Authority Factory to provide a list of CRS codes and Descriptions.
 *
 * @return a list of strings, code\tdescription.
 */
private ArrayList<String> listDb() {
	ArrayList<String> ret = new ArrayList<String>();
	CRSAuthorityFactory authFac = CRS.getAuthorityFactory(false);
	try {

		Set<String> list = authFac
				.getAuthorityCodes(CoordinateReferenceSystem.class);

		for (String code : list) {
			ret.add(code + "\t" + authFac.getDescriptionText(code));
		}
	} catch (FactoryException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return ret;

}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:24,代码来源:QueryEPSG.java

示例4: testInvertQueryNorthEastAxisOrder

import org.geotools.referencing.CRS; //导入方法依赖的package包/类
@Test
public void testInvertQueryNorthEastAxisOrder() throws Exception {
    Filter filter = ff.bbox("geom", 0, 0, 0, 0, "EPSG:4326");
    CRSAuthorityFactory   factory = CRS.getAuthorityFactory(false);
    CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("EPSG:4326");
    ReferencedEnvelope env = new ReferencedEnvelope(2,3,0,1,crs);
    Query query = new Query();
    query.setFilter(filter);
    Query queryOut = process.invertQuery(env, query, null);
    assertEquals(ff.bbox("geom", 0, 2, 1, 3, "EPSG:4326"), queryOut.getFilter());
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:12,代码来源:GeoHashGridProcessTest.java


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