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


Java FactoryException.printStackTrace方法代码示例

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


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

示例1: toShapeFile

import org.opengis.referencing.FactoryException; //导入方法依赖的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: MrGeoReader

import org.opengis.referencing.FactoryException; //导入方法依赖的package包/类
MrGeoReader(Properties config) throws IOException
{
  this.config = config;

  String epsg = "EPSG:4326";
  try
  {
    epsg4326 = CRS.decode(epsg);
  }
  catch (FactoryException e)
  {
    e.printStackTrace();
  }


  providerProperties = new ProviderProperties(config.getProperty(USERNAME, ""), config.getProperty(USER_ROLES, ""));

  loadLayers();

}
 
开发者ID:ngageoint,项目名称:mrgeo-geoserver-plugin,代码行数:21,代码来源:MrGeoReader.java

示例3: CRSTransform

import org.opengis.referencing.FactoryException; //导入方法依赖的package包/类
/**
 * CRS transform.
 *
 * @param sourceEpsgCRSCode the source epsg CRS code
 * @param targetEpsgCRSCode the target epsg CRS code
 * @return true, if successful
 */
public boolean CRSTransform(String sourceEpsgCRSCode, String targetEpsgCRSCode)
{
	try {
   	CoordinateReferenceSystem sourceCRS = CRS.decode(sourceEpsgCRSCode);
	CoordinateReferenceSystem targetCRS = CRS.decode(targetEpsgCRSCode);
	final MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, false);
	this.CRStransformation=true;
	this.sourceEpsgCode=sourceEpsgCRSCode;
	this.targetEpgsgCode=targetEpsgCRSCode;
	this.rawSpatialRDD = this.rawSpatialRDD.map(new Function<T,T>()
	{
		@Override
		public T call(T originalObject) throws Exception {
			return (T) JTS.transform(originalObject,transform);
		}
	});
	return true;
	} catch (FactoryException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		return false;
	}
}
 
开发者ID:DataSystemsLab,项目名称:GeoSpark,代码行数:31,代码来源:SpatialRDD.java

示例4: computeProjection

import org.opengis.referencing.FactoryException; //导入方法依赖的package包/类
MathTransform computeProjection(final IScope scope) {
	MathTransform crsTransformation = null;
	// ProjectionFactory.computeTargetCRS(longitude, latitude);
	try {
		crsTransformation = CRS.findMathTransform(initialCRS, getTargetCRS(scope), true);
	} catch (final FactoryException e) {
		e.printStackTrace();
		return null;
	}
	return crsTransformation;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:12,代码来源:Projection.java


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