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


Java TransformException类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:gdi-by,项目名称:downloadclient,代码行数:22,代码来源:WMSMapSwing.java

示例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;
	}
 
开发者ID:twak,项目名称:chordatlas,代码行数:17,代码来源:SatUtils.java

示例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;});
}
 
开发者ID:MapStory,项目名称:ms-gs-plugins,代码行数:21,代码来源:BoundsUpdateTransactionListener.java

示例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);
    }
}
 
开发者ID:gdi-by,项目名称:downloadclient,代码行数:19,代码来源:WMSMapSwing.java

示例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);
}
 
开发者ID:AURIN,项目名称:online-whatif,代码行数:44,代码来源:GeodataFilterer.java

示例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);
}
 
开发者ID:conveyal,项目名称:gtfs-lib,代码行数:20,代码来源:GeoUtils.java

示例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);
}
 
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:18,代码来源:MsiProductSignatureTest.java

示例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;
}
 
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:27,代码来源:MsiProductSignatureTest.java

示例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);
}
 
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:18,代码来源:Meris4ProductSignatureTest.java

示例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);
}
 
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:18,代码来源:OlciProductSignatureTest.java

示例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;
}
 
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:27,代码来源:ModisProductSignatureTest.java

示例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;
}
 
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:27,代码来源:SeawifsProductSignatureTest.java

示例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);
}
 
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:18,代码来源:Landsat8ProductSignatureTest.java

示例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);
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:18,代码来源:GeoHashGridProcessTest.java

示例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;
}
 
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:27,代码来源:ViirsProductSignatureTest.java


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