Examples of MathTransform


Examples of org.opengis.referencing.operation.MathTransform

    this.binding = binding;
  }

  @Override
  public void draw(Graphics2D graphics, MapContent map, MapViewport viewport) {
    MathTransform worldtoScreen = createAffineTransform(viewport);
    for (Geometry geometry : geometries) {
      LiteShape2 shape;
      try {
        Geometry screenGeom = JTS.transform(geometry, worldtoScreen);
        shape = new LiteShape2(screenGeom, null, null, false);
View Full Code Here

Examples of org.opengis.referencing.operation.MathTransform

    Assert.assertEquals(40, transformed.getHeight(), DELTA);
  }

  @Test
  public void getCrsTransformCrsTest() throws Exception {
    MathTransform mathTransform = geoService.findMathTransform(CRS.decode(LONLAT), CRS.decode(LAMBERT72));
    Assert.assertEquals("EPSG:4326->EPSG:31300", ((CrsTransform)mathTransform).getId());

    CrsTransform crsTransform = geoService.getCrsTransform(LONLAT, LAMBERT72);
    Assert.assertEquals("EPSG:4326->EPSG:31300", crsTransform.getId());
    Assert.assertTrue(crsTransform.equals(mathTransform));
View Full Code Here

Examples of org.opengis.referencing.operation.MathTransform

  private CrsTransform getCrsTransform(String key, CrsTransformInfo crsTransformInfo) throws GeomajasException {
    Crs source = getCrs2(crsTransformInfo.getSource());
    Crs target = getCrs2(crsTransformInfo.getTarget());

    MathTransform mathTransform = getBaseMathTransform(source, target);

    return new CrsTransformImpl(key, source, target, mathTransform, crsTransformInfo.getTransformableArea());
  }
View Full Code Here

Examples of org.opengis.referencing.operation.MathTransform

    return getSridFromCrs(crs.getIdentifiers().iterator().next().toString());
  }

  private MathTransform getBaseMathTransform(Crs sourceCrs, Crs targetCrs) throws GeomajasException {
    try {
      MathTransform transform;
      try {
        transform = CRS.findMathTransform(sourceCrs, targetCrs);
      } catch (Exception e) {
        transform = CRS.findMathTransform(sourceCrs, targetCrs, true);
      }
View Full Code Here

Examples of org.opengis.referencing.operation.MathTransform

  /** @{inheritDoc} */
  public CrsTransform getCrsTransform(Crs sourceCrs, Crs targetCrs) throws GeomajasException {
    String key = getTransformKey(sourceCrs, targetCrs);
    CrsTransform transform = transformCache.get(key);
    if (null == transform) {
      MathTransform mathTransform = getBaseMathTransform(sourceCrs, targetCrs);

      // as there was no transformable area configured, try to build it instead
      Envelope transformableArea = null;
      try {
        org.opengis.geometry.Envelope ogEnvelope = CRS.getEnvelope(targetCrs);
View Full Code Here

Examples of org.opengis.referencing.operation.MathTransform

              CRSAuthorityFactory crsAuthorityFactory = CRS.getAuthorityFactory(true);
              CoordinateReferenceSystem mapCRS = crsAuthorityFactory.createCoordinateReferenceSystem(code);
               
               
              boolean lenient = true; // allow for some error due to different datums
              MathTransform transform = CRS.findMathTransform(dataCRS, mapCRS, lenient);
             
              while (featureIterator.hasNext())
              {
                SimpleFeature feature = featureIterator.next();
   
View Full Code Here

Examples of org.opengis.referencing.operation.MathTransform

                    patternStop.delete();
            }
           
            if(tripPattern.shape != null) {
             
              MathTransform mt = GeoUtils.getTransform(new Coordinate(tripPattern.shape.shape.getCoordinateN(0).y, tripPattern.shape.shape.getCoordinateN(0).x));
              GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4326);
             
              Coordinate[] mCoords =  tripPattern.shape.shape.getCoordinates();
              ArrayList<Coordinate> coords = new ArrayList<Coordinate>();
             
View Full Code Here

Examples of org.opengis.referencing.operation.MathTransform

       //      parameters.parameter("false_northing").setValue(0.0);
       // 
       //      Map properties = Collections.singletonMap("name", "WGS 84 / UTM Zone " + zoneNumber);
       //      ProjectedCRS projCRS = factories.createProjectedCRS(properties, geoCRS, null, parameters, cartCS);

       final MathTransform transform =
           CRS.findMathTransform(geoCRS, dataCRS);
      
       GeoUtils.recentMathTransform = transform;
      
       return transform;
View Full Code Here

Examples of org.opengis.referencing.operation.MathTransform

       //      parameters.parameter("false_northing").setValue(0.0);
       // 
       //      Map properties = Collections.singletonMap("name", "WGS 84 / UTM Zone " + zoneNumber);
       //      ProjectedCRS projCRS = factories.createProjectedCRS(properties, geoCRS, null, parameters, cartCS);

       final MathTransform transform =
           CRS.findMathTransform(geoCRS, dataCRS);
      
       GeoUtils.recentMathTransform = transform;
      
       return transform;
View Full Code Here

Examples of org.opengis.referencing.operation.MathTransform

            }
        }
        CoordinateReferenceSystem aoiCRS = aOIService.getCrs();
        if( aoiCRS != null && !CRS.equalsIgnoreMetadata(aoiCRS, dataCRS )){
            try {
                MathTransform transform = CRS.findMathTransform( aoiCRS, dataCRS);
                geometry = JTS.transform(geometry, transform);
            }
            catch( TransformException outOfBounds ){
                return filter; // unable to use this bounds
            } catch (FactoryException notSupported) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.