Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Geometry.apply()


            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));
                            }
                        }
View Full Code Here


  protected Geometry buildScreenPosition( Dimension2D screenSize, Geometry view, Geometry intersection )
  {
    AffineTransformation transformer = createWorldToScreenTransform( view.getEnvelopeInternal(), screenSize );
   
    Geometry position = (Geometry)intersection.clone();
    position.apply( transformer );
    position.geometryChanged();
   
    return position;
  }
 
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

        final Geometry geom = (Geometry) obj;
        final int geometryType = getGeometryType(geom);
        final int typeAndMasks = geometryType;

        writeUnsignedVarInt(typeAndMasks, out);
        geom.apply(new EncodingSequenceFilter(out, true));
    }

    @Override
    public Geometry read(DataInput in) throws IOException {
View Full Code Here

        // anything larger than half of the world might have wrapped it, however,
        // if it's touching both datelines then don't wrap it, as it might be something
        // like antarctica
        if (datelineWrappingCheckEnabled && width > radius && width < radius * 2) {
            Geometry wrapped = (Geometry) geometry.clone();
            wrapped.apply(new WrappingCoordinateFilter(radius, radius * 2, mt, northEast));
            wrapped.geometryChanged();
            // did we un-wrap it?
            if (wrapped.getEnvelopeInternal().getWidth() < radius) {
                geometry = wrapped;
                env = geometry.getEnvelopeInternal();
View Full Code Here

            if (Math.abs(offset) < radius) {
                // in this case we can keep the original geometry, which is already in
            } else {
                // in all other cases we make a copy and offset it
                Geometry offseted = (Geometry) geometry.clone();
                offseted.apply(new OffsetOrdinateFilter(northEast ? 1 : 0, offset));
                offseted.geometryChanged();      
                geomType = accumulate(geoms, offseted, geomType);
            }

            curr += radius * 2;
 
View Full Code Here

                // of their center, this makes for odd results if the polygon is just slightly
                // misaligned with the coverage
                AffineTransformation at = new AffineTransformation();
               
                at.setToTranslation(-0.5, -0.5);
                simplifiedGeometry.apply(at);
               
                // build a shape using a fast point in polygon wrapper
                ROI roi = new ROIGeometry(simplifiedGeometry, false);

                // run the stats via JAI
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

            // manage Z preservation
            if(preserveZ && !geom.equalsExact(clipped)) {
                // for polygons we need to go idw, for points and multipoints idw will do and will not
                // add much overhead (it has optimizations for points that were already in the input)
                if(result instanceof MultiPolygon || result instanceof MultiPoint || result instanceof Point) {
                    result.apply(new IDWElevationInterpolator(geom, crs));
                } else if(result instanceof MultiLineString) {
                    result.apply(new LinearElevationInterpolator(geom, crs));
                }
            }
           
View Full Code Here

                // for polygons we need to go idw, for points and multipoints idw will do and will not
                // add much overhead (it has optimizations for points that were already in the input)
                if(result instanceof MultiPolygon || result instanceof MultiPoint || result instanceof Point) {
                    result.apply(new IDWElevationInterpolator(geom, crs));
                } else if(result instanceof MultiLineString) {
                    result.apply(new LinearElevationInterpolator(geom, crs));
                }
            }
           
            return result;
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.