Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.CoordinateFilter


            try{
                final double height = new FeatureHeightTemplate(template).execute(f);

                if (!Double.isNaN(height) && height != 0){
                    geom.apply(
                        new CoordinateFilter(){
                            public void filter(Coordinate c){
                                c.setCoordinate(new Coordinate(c.x, c.y, height));
                            }
                        }
                    );
View Full Code Here


    final Random random = RandomizedContext.current().getRandom();
    Geometry pGeom = poly.getGeom();
    assertTrue(pGeom.isValid());
    //shift 180 to the right
    pGeom = (Geometry) pGeom.clone();
    pGeom.apply(new CoordinateFilter() {
      @Override
      public void filter(Coordinate coord) {
        coord.x = normX(coord.x + lon_shift);
        if (ctx.isGeo() && Math.abs(coord.x) == 180 && random.nextBoolean())
          coord.x = - coord.x;//invert sign of dateline boundary some of the time
View Full Code Here

       
        assertTrue(handler.requiresProcessing( g));
        Geometry preProcessed = handler.preProcess(g);
        Geometry reprojected = JTS.transform(preProcessed, prepared);
        assertTrue(reprojected.isValid());
        reprojected.apply(new CoordinateFilter() {
           
            @Override
            public void filter(Coordinate coord) {
                assertEquals(90.0, Math.abs(coord.getOrdinate(0)), 0.1);
                assertEquals(180.0, Math.abs(coord.getOrdinate(1)), 5);
View Full Code Here

            Geometry geom = (Geometry) f.getDefaultGeometry();
            try {
                final double height = new FeatureHeightTemplate(template).execute(f);

                if (!Double.isNaN(height) && height != 0) {
                    geom.apply(new CoordinateFilter() {
                        public void filter(Coordinate c) {
                            c.setCoordinate(new Coordinate(c.x, c.y, height));
                        }
                    });
                    geom.geometryChanged();
View Full Code Here

         */
        private Geometry getFeatureGeometry(SimpleFeature sf, final double height) {
            Geometry geom = (Geometry) sf.getDefaultGeometry();

            if (!Double.isNaN(height) && height != 0) {
                geom.apply(new CoordinateFilter() {
                    public void filter(Coordinate c) {
                        c.setCoordinate(new Coordinate(c.x, c.y, height));
                    }
                });
                geom.geometryChanged();
View Full Code Here

            try{
                final double height = new FeatureHeightTemplate(template).execute(f);

                if (!Double.isNaN(height) && height != 0){
                    geom.apply(
                        new CoordinateFilter(){
                            public void filter(Coordinate c){
                                c.setCoordinate(new Coordinate(c.x, c.y, height));
                            }
                        }
                    );
View Full Code Here

   * @param g the Geometry to modify
   * @param c the point to move to the origin
   */
  public static void align(Geometry g, Coordinate c) {
    final Coordinate move = CoordUtil.subtract(new Coordinate(0,0), c);
    g.apply(new CoordinateFilter() {
            @Override
      public void filter(Coordinate coordinate) {
        coordinate.x += move.x;
        coordinate.y += move.y;
      }
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.CoordinateFilter

Copyright © 2018 www.massapicom. 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.