本文整理匯總了Java中org.opengis.referencing.operation.TransformException類的典型用法代碼示例。如果您正苦於以下問題:Java TransformException類的具體用法?Java TransformException怎麽用?Java TransformException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TransformException類屬於org.opengis.referencing.operation包,在下文中一共展示了TransformException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setExtend
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
/**
* sets the viewport of the map to the given extend.
*
* @param envelope the extend
*/
public void setExtend(ReferencedEnvelope envelope) {
try {
envelope = envelope.transform(this.mapContent.getViewport()
.getCoordinateReferenceSystem(), true);
double xLength = envelope.getSpan(0);
xLength = xLength * TEN_PERCENT;
double yLength = envelope.getSpan(1);
yLength = yLength * TEN_PERCENT;
envelope.expandBy(xLength, yLength);
bboxAction.resetCoordinates();
mapPane.deleteGraphics();
mapPane.setDisplayArea(envelope);
} catch (FactoryException | TransformException e) {
log.log(Level.SEVERE, e.getMessage(), e);
}
}
示例2: worldToLLong
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
public static Point2d worldToLLong( Tweed tweed, Point3d cen ) {
Point3d out = new Point3d( cen );
TweedSettings.settings.fromOrigin.transform( out );
try {
double[] latLong = new double[3];
toLatLong.transform( new double[] { out.x, out.y, out.z }, 0, latLong, 0, 1 );
return new Point2d( latLong[ 0 ], latLong[ 1 ] );
} catch ( TransformException e ) {
e.printStackTrace();
}
return null;
}
示例3: merge
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
private Optional<ReferencedEnvelope> merge(final ReferencedEnvelope oldEnv,
final Collection<ReferencedEnvelope> dirtyList) {
final CoordinateReferenceSystem declaredCrs = oldEnv.getCoordinateReferenceSystem();
return dirtyList.stream()
.map(env->{
if(env instanceof ReferencedEnvelope3D) {
return new ReferencedEnvelope(env, CRS.getHorizontalCRS(env.getCoordinateReferenceSystem()));
} else {
return env;
}
})
.map(env->{
try {
return env.transform(declaredCrs, true, 1000);
} catch (TransformException | FactoryException e) {
throw new RuntimeException("Error while merging bounding boxes",e);
}
})
.reduce((env1, env2)->{ReferencedEnvelope x = new ReferencedEnvelope(env1); x.expandToInclude(env2); return x;});
}
示例4: setDisplayCoordinates
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
private void setDisplayCoordinates(
Double x1,
Double y1,
Double x2,
Double y2
) {
try {
convertAndDisplayBoundingBox(x1,
x2,
y1,
y2,
this.mapCRS,
this.displayCRS);
} catch (FactoryException | TransformException e) {
clearCoordinateDisplay();
log.log(Level.SEVERE, e.getMessage(), e);
}
}
示例5: getFilterFromParameters
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
/**
* Gets the filter from parameters.
*
* @param wifParameters
* the wif parameters
* @return the filter from parameters
* @throws MismatchedDimensionException
* the mismatched dimension exception
* @throws TransformException
* the transform exception
* @throws NoSuchAuthorityCodeException
* the no such authority code exception
* @throws FactoryException
* the factory exception
* @throws ParseException
* the parse exception
* @throws CQLException
* the cQL exception
*/
public Filter getFilterFromParameters(final Map<String, Object> wifParameters)
throws MismatchedDimensionException, TransformException,
NoSuchAuthorityCodeException, FactoryException, ParseException,
CQLException {
LOGGER.debug("getFilterFromParameters...");
String queryTxt = "";
final String polyTxt = getIntersectionPolygon(wifParameters);
if (polyTxt == null) {
LOGGER
.info("no polygon query filter received, defaulting to including all the unified area zone!");
queryTxt = "include";
} else if (polyTxt.equals("")) {
LOGGER
.info("no polygon query filter received, defaulting to including all the unified area zone!");
queryTxt = "include";
} else {
queryTxt = polyTxt;
}
LOGGER.debug("query filter: {}", queryTxt);
return getFilter(queryTxt);
}
示例6: convertLonLatToEuclidean
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
@Deprecated
public static ProjectedCoordinate convertLonLatToEuclidean(
Coordinate lonlat) {
final MathTransform transform = getTransform(lonlat);
final Coordinate to = new Coordinate();
// the transform seems to swap the lat lon pairs
Coordinate latlon = new Coordinate(lonlat.y, lonlat.x);
try {
JTS.transform(latlon, to,
transform);
} catch (final TransformException e) {
e.printStackTrace();
}
return new ProjectedCoordinate(transform, new Coordinate(to.y, to.x), lonlat);
}
示例7: testProductSignature_DefaultWithOthers
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
@Test
public void testProductSignature_DefaultWithOthers() throws FactoryException, TransformException {
C2rccMsiOperator operator = createDefaultOperator();
operator.setOutputRpath(true);
operator.setOutputTdown(true);
operator.setOutputTup(true);
operator.setOutputOos(true);
Product targetProduct = operator.getTargetProduct();
assertDefaults(targetProduct, false);
assertBands(targetProduct, EXPECTED_RPATH_BANDS);
assertBands(targetProduct, EXPECTED_TDOWN_BANDS);
assertBands(targetProduct, EXPECTED_TUP_BANDS);
assertBands(targetProduct, EXPECTED_OOS_RTOSA);
assertBands(targetProduct, EXPECTED_OOS_RHOW);
}
示例8: createMsiTestProduct
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
private Product createMsiTestProduct() throws FactoryException, TransformException {
Product product = new Product("test-msi", "t", 1, 1);
for (String reflBandName : C2rccMsiAlgorithm.SOURCE_BAND_REFL_NAMES) {
product.addBand(reflBandName, "3863");
}
product.addBand(C2rccMsiOperator.RASTER_NAME_SUN_AZIMUTH, "42");
product.addBand(C2rccMsiOperator.RASTER_NAME_SUN_ZENITH, "42");
product.addBand(C2rccMsiOperator.RASTER_NAME_VIEW_AZIMUTH, "42");
product.addBand(C2rccMsiOperator.RASTER_NAME_VIEW_ZENITH, "42");
product.setSceneGeoCoding(new CrsGeoCoding(DefaultGeographicCRS.WGS84, 1, 1, 10, 50, 1, 1));
MetadataElement l1cUserProduct = new MetadataElement("Level-1C_User_Product");
MetadataElement generalInfo = new MetadataElement("General_Info");
MetadataElement productInfo = new MetadataElement("Product_Info");
productInfo.addAttribute(new MetadataAttribute("PRODUCT_START_TIME", ProductData.createInstance("2015-08-12T10:40:21.459Z"), true));
productInfo.addAttribute(new MetadataAttribute("PRODUCT_STOP_TIME", ProductData.createInstance("2015-08-12T10:40:21.459Z"), true));
MetadataElement imageCharacteristics = new MetadataElement("Product_Image_Characteristics");
imageCharacteristics.addAttribute(new MetadataAttribute("QUANTIFICATION_VALUE", ProductData.createInstance("1000"), true));
l1cUserProduct.addElement(generalInfo);
generalInfo.addElement(productInfo);
generalInfo.addElement(imageCharacteristics);
product.getMetadataRoot().addElement(l1cUserProduct);
return product;
}
示例9: testProductSignature_DefaultWithOthers
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
@Test
public void testProductSignature_DefaultWithOthers() throws FactoryException, TransformException {
C2rccMeris4Operator operator = createDefaultOperator();
operator.setOutputRpath(true);
operator.setOutputTdown(true);
operator.setOutputTup(true);
operator.setOutputOos(true);
Product targetProduct = operator.getTargetProduct();
assertDefaults(targetProduct, false);
assertBands(targetProduct, EXPECTED_RPATH_BANDS);
assertBands(targetProduct, EXPECTED_TDOWN_BANDS);
assertBands(targetProduct, EXPECTED_TUP_BANDS);
assertBands(targetProduct, EXPECTED_OOS_RTOSA);
assertBands(targetProduct, EXPECTED_OOS_RHOW);
}
示例10: testProductSignature_DefaultWithOthers
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
@Test
public void testProductSignature_DefaultWithOthers() throws FactoryException, TransformException {
C2rccOlciOperator operator = createDefaultOperator();
operator.setOutputRpath(true);
operator.setOutputTdown(true);
operator.setOutputTup(true);
operator.setOutputOos(true);
Product targetProduct = operator.getTargetProduct();
assertDefaults(targetProduct, false);
assertBands(targetProduct, EXPECTED_RPATH_BANDS);
assertBands(targetProduct, EXPECTED_TDOWN_BANDS);
assertBands(targetProduct, EXPECTED_TUP_BANDS);
assertBands(targetProduct, EXPECTED_OOS_RTOSA);
assertBands(targetProduct, EXPECTED_OOS_RHOW);
}
示例11: createModisTestProduct
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
private Product createModisTestProduct() throws FactoryException, TransformException {
Product product = new Product("test-modis", "t", 1, 1);
int[] reflecWavelengths = C2rccModisAlgorithm.ALL_REFLEC_WAVELENGTHS;
for (int reflec_wavelength : reflecWavelengths) {
String expression = String.valueOf(reflec_wavelength);
product.addBand(C2rccModisOperator.SOURCE_RADIANCE_NAME_PREFIX + reflec_wavelength, expression);
}
Date time = new Date();
product.setStartTime(ProductData.UTC.create(time, 0));
product.setEndTime(ProductData.UTC.create(time, 500));
for (String angleName : C2rccModisOperator.GEOMETRY_ANGLE_NAMES) {
product.addBand(angleName, "42");
}
Band flagBand = product.addBand(C2rccModisOperator.RASTER_NAME_L2_FLAGS, ProductData.TYPE_INT8);
FlagCoding l2FlagsCoding = new FlagCoding(C2rccModisOperator.RASTER_NAME_L2_FLAGS);
l2FlagsCoding.addFlag("LAND", 0x01, "");
product.getFlagCodingGroup().add(l2FlagsCoding);
flagBand.setSampleCoding(l2FlagsCoding);
product.setSceneGeoCoding(new CrsGeoCoding(DefaultGeographicCRS.WGS84, 1, 1, 10, 50, 1, 1));
return product;
}
示例12: createSeawifsTestProduct
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
private Product createSeawifsTestProduct() throws FactoryException, TransformException {
Product product = new Product("test-seawifs", "t", 1, 1);
int[] reflecWavelengths = C2rccSeaWiFSAlgorithm.seawifsWavelengths;
for (int reflec_wavelength : reflecWavelengths) {
String expression = String.valueOf(reflec_wavelength);
product.addBand(C2rccSeaWiFSOperator.SOURCE_RADIANCE_NAME_PREFIX + reflec_wavelength, expression);
}
Date time = new Date();
product.setStartTime(ProductData.UTC.create(time, 0));
product.setEndTime(ProductData.UTC.create(time, 500));
for (String angleName : C2rccSeaWiFSOperator.GEOMETRY_ANGLE_NAMES) {
product.addBand(angleName, "42");
}
Band flagBand = product.addBand(C2rccSeaWiFSOperator.RASTER_NAME_L2_FLAGS, ProductData.TYPE_INT8);
FlagCoding l2FlagsCoding = new FlagCoding(C2rccSeaWiFSOperator.RASTER_NAME_L2_FLAGS);
l2FlagsCoding.addFlag("LAND", 0x01, "");
product.getFlagCodingGroup().add(l2FlagsCoding);
flagBand.setSampleCoding(l2FlagsCoding);
product.setSceneGeoCoding(new CrsGeoCoding(DefaultGeographicCRS.WGS84, 1, 1, 10, 50, 1, 1));
return product;
}
示例13: testProductSignature_DefaultWithOthers
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
@Test
public void testProductSignature_DefaultWithOthers() throws FactoryException, TransformException {
C2rccLandsat8Operator operator = createDefaultOperator();
operator.setOutputRpath(true);
operator.setOutputTdown(true);
operator.setOutputTup(true);
operator.setOutputOos(true);
Product targetProduct = operator.getTargetProduct();
assertDefaults(targetProduct, false);
assertBands(targetProduct, EXPECTED_RPATH_BANDS);
assertBands(targetProduct, EXPECTED_TDOWN_BANDS);
assertBands(targetProduct, EXPECTED_TUP_BANDS);
assertBands(targetProduct, EXPECTED_OOS_RTOSA);
assertBands(targetProduct, EXPECTED_OOS_RHOW);
}
示例14: testSubCellCrop
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
@Test
public void testSubCellCrop() throws NoSuchAuthorityCodeException, TransformException, FactoryException {
ReferencedEnvelope envelope = new ReferencedEnvelope(-168.75,168.75,-78.75,78.75,DefaultGeographicCRS.WGS84);
int width = 16;
int height = 8;
int pixelsPerCell = 1;
String strategy = "Basic";
List<String> strategyArgs = null;
Float emptyCellValue = null;
Float scaleMin = 0f;
Float scaleMax = null;
boolean useLog = false;
GridCoverage2D coverage = process.execute(features, pixelsPerCell, strategy, strategyArgs, emptyCellValue, scaleMin, scaleMax, useLog, envelope, width, height, null);
checkInternal(coverage, fineDelta);
checkEdge(coverage, envelope, fineDelta);
}
示例15: createSeawifsTestProduct
import org.opengis.referencing.operation.TransformException; //導入依賴的package包/類
private Product createSeawifsTestProduct() throws FactoryException, TransformException {
Product product = new Product("test-seawifs", "t", 1, 1);
int[] reflecWavelengths = C2rccViirsAlgorithm.viirsWavelengths;
for (int reflec_wavelength : reflecWavelengths) {
String expression = String.valueOf(reflec_wavelength);
product.addBand(C2rccViirsOperator.SOURCE_RADIANCE_NAME_PREFIX + reflec_wavelength, expression);
}
Date time = new Date();
product.setStartTime(ProductData.UTC.create(time, 0));
product.setEndTime(ProductData.UTC.create(time, 500));
for (String angleName : C2rccViirsOperator.GEOMETRY_ANGLE_NAMES) {
product.addBand(angleName, "42");
}
Band flagBand = product.addBand(C2rccViirsOperator.RASTER_NAME_L2_FLAGS, ProductData.TYPE_INT8);
FlagCoding l2FlagsCoding = new FlagCoding(C2rccViirsOperator.RASTER_NAME_L2_FLAGS);
l2FlagsCoding.addFlag("LAND", 0x01, "");
product.getFlagCodingGroup().add(l2FlagsCoding);
flagBand.setSampleCoding(l2FlagsCoding);
product.setSceneGeoCoding(new CrsGeoCoding(DefaultGeographicCRS.WGS84, 1, 1, 10, 50, 1, 1));
return product;
}