本文整理汇总了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");
}
示例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();
}
示例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;
}
}
示例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;
}