Package org.opengis.referencing.operation

Examples of org.opengis.referencing.operation.MathTransform.transform()


            if( !mt.isIdentity() ){
                double tx=gridSize[0]/2.0;
                double ty=gridSize[1]/2.0;
                double[] toTransform=new double[]{-tx,-ty,tx,ty};
                double[] dest=new double[4];
                mt.transform(toTransform,0,dest,0,2);
                gridSize=new double[]{Math.abs(dest[2]-dest[0]), Math.abs(dest[3]-dest[1])};
            }
        }catch (Exception e) {
            MapGraphicPlugin.log("",e); //$NON-NLS-1$
        }
View Full Code Here


                // see if the features is to be included in this tile
                Point p = ((Geometry) f.getDefaultGeometry()).getCentroid();
                coords[0] = p.getX();
                coords[1] = p.getY();
                if (tx != null)
                    tx.transform(coords, 0, coords, 0, 1);
                if (tile.contains(coords[0], coords[1]))
                    currFids.add(f.getID());
            }
        } finally {
            if (fi != null)
View Full Code Here

                }
               
                coords[0] = centroid.getX();
                coords[1] = centroid.getY();
                if (tx != null)
                    tx.transform(coords, 0, coords, 0, 1);

                // insert
                ps.setDouble(1, coords[0]);
                ps.setDouble(2, coords[1]);
                ps.setString(3, f.getID());
View Full Code Here

                    src1[1] = southBoundLatitude;

                    double[] src2 = new double[tr.getSourceDimensions()];
                    src2[0] = eastBoundLongitude;
                    src2[1] = northBoundLatitude;
                    tr.transform(src1, 0, dst1, 0, 1);
                    tr.transform(src2, 0, dst2, 0, 1);
                } catch (Exception e1) {
                    e1.printStackTrace();
                    throw new RuntimeException(e1);
                }
View Full Code Here

                    double[] src2 = new double[tr.getSourceDimensions()];
                    src2[0] = eastBoundLongitude;
                    src2[1] = northBoundLatitude;
                    tr.transform(src1, 0, dst1, 0, 1);
                    tr.transform(src2, 0, dst2, 0, 1);
                } catch (Exception e1) {
                    e1.printStackTrace();
                    throw new RuntimeException(e1);
                }
View Full Code Here

                        continue;
                    }
                   
                    //now get the position in raster space using the world to grid related to corner
                    final MathTransform worldToGrid=reader.getOriginalGridToWorld(PixelInCell.CELL_CORNER).inverse();
                    final DirectPosition rasterMid = worldToGrid.transform(position,null);
                    // create a 20X20 rectangle aruond the mid point and then intersect with the original range
                    final Rectangle2D.Double rasterArea= new Rectangle2D.Double();
                    rasterArea.setFrameFromCenter(rasterMid.getOrdinate(0), rasterMid.getOrdinate(1), rasterMid.getOrdinate(0)+10, rasterMid.getOrdinate(1)+10);
                    final Rectangle integerRasterArea=rasterArea.getBounds();
                    final GridEnvelope gridEnvelope=reader.getOriginalGridRange();
View Full Code Here

    public void testVersionedFeatureCollection10Reproject() throws Exception {
        // prepare the expected transformation results
        MathTransform tx = CRS.findMathTransform(CRS.decode("EPSG:26713"), CRS.decode("EPSG:900913"));
        double[] original = new double[] {604000,4930000};
        double[] expected = new double[2];
        tx.transform(original, 0, expected, 0, 1);
       
        // gather the results and extract the coordinates using xpath
        Document doc = getAsDOM(root() + "service=wfsv&version=1.0.0&request=GetVersionedFeature&srsName=EPSG:900913&typeName=topp:archsites&featureId=archsites.5");
        String transformed = xpath.evaluate("//topp:archsites[@fid=\"archsites.5\"]/topp:the_geom/gml:Point/gml:coordinates/text()", doc);
       
View Full Code Here

    public void testVersionedFeatureCollection11Reproject() throws Exception {
        // prepare the expected transformation results
        MathTransform tx = CRS.findMathTransform(CRS.decode("EPSG:26713"), CRS.decode("EPSG:900913"));
        double[] original = new double[] {604000,4930000};
        double[] expected = new double[2];
        tx.transform(original, 0, expected, 0, 1);
       
        // gather the results and extract the coordinates using xpath
        Document doc = getAsDOM(root() + "service=WFSV&version=1.1.0&request=GetVersionedFeature&srsName=EPSG:900913&typeName=topp:archsites&featureId=archsites.5");
        print(doc);
        String transformed = xpath.evaluate("//topp:archsites[@gml:id=\"archsites.5\"]/topp:the_geom/gml:Point/gml:pos/text()", doc);
View Full Code Here

            if( !mt.isIdentity() ){
                double x=gridSize[0]/2.0;
                double y=gridSize[1]/2.0;
                double[] toTransform=new double[]{-x,-y,x,y};
                double[] dest=new double[4];
                mt.transform(toTransform,0,dest,0,2);
                gridSize=new double[]{Math.abs(dest[2]-dest[0]), Math.abs(dest[3]-dest[1])};
            }
        }catch (Exception e) {
            MapGraphicPlugin.log("",e); //$NON-NLS-1$
        }
View Full Code Here

            if( !mt.isIdentity() ){
                double x=gridSize[0]/2.0;
                double y=gridSize[1]/2.0;
                double[] toTransform=new double[]{-x,-y,x,y};
                double[] dest=new double[4];
                mt.transform(toTransform,0,dest,0,2);
                gridSize=new double[]{Math.abs(dest[2]-dest[0]), Math.abs(dest[3]-dest[1])};
            }
        }catch (Exception e) {
            MapGraphicPlugin.log("",e); //$NON-NLS-1$
        }
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.