Examples of GeometryCoordinateSequenceTransformer


Examples of org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer

        if (source != null) {
            MathTransform2D tx = (MathTransform2D) ReferencingFactoryFinder
                    .getCoordinateOperationFactory(hints).createOperation(source, target)
                    .getMathTransform();

            GeometryCoordinateSequenceTransformer transformer = new GeometryCoordinateSequenceTransformer();
            transformer.setMathTransform(tx);
            transformers.put(source, transformer);
        } else {
            throw new RuntimeException("Source was null in trying to create a reprojected feature collection!");
        }
    }
View Full Code Here

Examples of org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer

                }

                if (crs != null) {
                    // if equal, nothing to do
                    if (!crs.equals(target)) {
                        GeometryCoordinateSequenceTransformer transformer = (GeometryCoordinateSequenceTransformer) transformers
                                .get(crs);

                        if (transformer == null) {
                            transformer = new GeometryCoordinateSequenceTransformer();

                            MathTransform2D tx;

                            try {
                                tx = (MathTransform2D) ReferencingFactoryFinder
                                        .getCoordinateOperationFactory(hints).createOperation(crs,
                                                target).getMathTransform();
                            } catch (Exception e) {
                                String msg = "Could not transform for crs: " + crs;
                                throw (IOException) new IOException(msg).initCause(e);
                            }

                            transformer.setMathTransform(tx);
                            transformers.put(crs, transformer);
                        }

                        // do the transformation
                        try {
                            object = transformer.transform(geometry);
                        } catch (TransformException e) {
                            String msg = "Error occured transforming " + geometry.toString();
                            throw (IOException) new IOException(msg).initCause(e);
                        }
                    }
View Full Code Here

Examples of org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer

                    if ( source != null && target != null && !CRS.equalsIgnoreMetadata(source, target)) {
                        try {
                            //TODO: this code should be shared with the code
                            // from ReprojectingFeatureCollection --JD
                            MathTransform tx = CRS.findMathTransform(source, target, true);
                            GeometryCoordinateSequenceTransformer gtx =
                                new GeometryCoordinateSequenceTransformer();
                            gtx.setMathTransform(tx);
                           
                            values[j] = gtx.transform(geometry);   
                        }
                        catch( Exception e ) {
                            String msg = "Failed to reproject geometry:" + e.getLocalizedMessage();
                            throw new WFSTransactionException( msg, e );
                        }
View Full Code Here

Examples of org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer

                    if ( source != null && target != null && !CRS.equalsIgnoreMetadata(source, target)) {
                        try {
                            //TODO: this code should be shared with the code
                            // from ReprojectingFeatureCollection --JD
                            MathTransform tx = CRS.findMathTransform(source, target, true);
                            GeometryCoordinateSequenceTransformer gtx =
                                new GeometryCoordinateSequenceTransformer();
                            gtx.setMathTransform(tx);
                           
                            values[j] = gtx.transform(geometry);   
                        }
                        catch( Exception e ) {
                            String msg = "Failed to reproject geometry:" + e.getLocalizedMessage();
                            throw new WFSTransactionException( msg, e );
                        }
View Full Code Here

Examples of org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer

        if (source != null) {
            MathTransform2D tx = (MathTransform2D) ReferencingFactoryFinder
                    .getCoordinateOperationFactory(hints).createOperation(source, target)
                    .getMathTransform();

            GeometryCoordinateSequenceTransformer transformer = new GeometryCoordinateSequenceTransformer();
            transformer.setMathTransform(tx);
            transformers.put(source, transformer);
        } else {
            throw new RuntimeException("Source was null in trying to create a reprojected feature collection!");
        }
    }
View Full Code Here

Examples of org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer

                }

                if (crs != null) {
                    // if equal, nothing to do
                    if (!crs.equals(target)) {
                        GeometryCoordinateSequenceTransformer transformer = (GeometryCoordinateSequenceTransformer) transformers
                                .get(crs);

                        if (transformer == null) {
                            transformer = new GeometryCoordinateSequenceTransformer();

                            MathTransform2D tx;

                            try {
                                tx = (MathTransform2D) ReferencingFactoryFinder
                                        .getCoordinateOperationFactory(hints).createOperation(crs,
                                                target).getMathTransform();
                            } catch (Exception e) {
                                String msg = "Could not transform for crs: " + crs;
                                throw (IOException) new IOException(msg).initCause(e);
                            }

                            transformer.setMathTransform(tx);
                            transformers.put(crs, transformer);
                        }

                        // do the transformation
                        try {
                            object = transformer.transform(geometry);
                        } catch (TransformException e) {
                            String msg = "Error occured transforming " + geometry.toString();
                            throw (IOException) new IOException(msg).initCause(e);
                        }
                    }
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.