本文整理匯總了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;
}