當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。