Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.LineString.buffer()


    if (!(jtsGeometry instanceof LineString)) {
      throw new GeomajasException(ExceptionCode.UNEXPECTED_PROBLEM, "splitter has to be a LineString");
    }
    LineString preciseLine = (LineString) jtsGeometry;
    int precision = polygon.getPrecisionModel().getMaximumSignificantDigits() - 1;
    com.vividsolutions.jts.geom.Geometry bufferedLine = preciseLine.buffer(Math.pow(10.0, -precision));
    com.vividsolutions.jts.geom.Geometry diff = polygon.difference(bufferedLine);

    if (diff instanceof Polygon) {
      response.setGeometries(new Geometry[] { converter.toDto(diff) });
    } else if (diff instanceof MultiPolygon) {
View Full Code Here


           
            try {
              // transform buffer dimension to world coordinates
              double bufferMultiplier=worldToScreen.createInverse().getScaleX();
              // gets buffered linestring
        Geometry buffered=l.buffer(buffer*bufferMultiplier);
        if(buffered instanceof Polygon) {
          Polygon poly=(Polygon)decimate(buffered);
          if(poly!=null) {
            LineString shell = poly.getExteriorRing();
                 
View Full Code Here

                for (int i = 0; i < cleanedLines.size(); i++) {
                    LineString cleaned = cleanedLines.get(i);
                    if (g.getEnvelopeInternal().intersects(cleaned.getEnvelopeInternal())) {
                        Geometry buffer = bufferCache.get(i);
                        if (buffer == null) {
                            buffer = cleaned.buffer(2);
                            bufferCache.set(i, buffer);
                        }
                        g = g.difference(buffer);
                    }
                }
View Full Code Here

           
            try {
              // transform buffer dimension to world coordinates
              double bufferMultiplier=worldToScreen.createInverse().getScaleX();
              // gets buffered linestring
        Geometry buffered=l.buffer(buffer*bufferMultiplier);
        if(buffered instanceof Polygon) {
          Polygon poly=(Polygon)decimate(buffered);
          if(poly!=null) {
            LineString shell = poly.getExteriorRing();
                    if(shell!=null && shell.getCoordinates()!=null)
View Full Code Here

             
              try {
                // transform buffer dimension to world coordinates
                double bufferMultiplier=worldToScreen.createInverse().getScaleX();
                // gets buffered linestring
          Geometry buffered=l.buffer(buffer*bufferMultiplier);
          if(buffered instanceof Polygon) {
            Polygon poly=(Polygon)decimate(buffered);
            if(poly!=null) {
              LineString shell = poly.getExteriorRing();
                    if(shell!=null && shell.getCoordinates()!=null)
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.