Package com.vividsolutions.jts.geom

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


       
              SimpleFeature feature = featureIterator.next();
       
              Geometry defaultGeometry = (Geometry) feature.getDefaultGeometry();
              ProjectPlugin.log(className
                + "- Original feature: " + defaultGeometry.toText()); //$NON-NLS-1$
       
              if (!defaultGeometry.isValid()) {
            ProjectPlugin
              .log(className
                + "- Original feature has invalid geometry: " + defaultGeometry.toText()); //$NON-NLS-1$
View Full Code Here


                + "- Original feature: " + defaultGeometry.toText()); //$NON-NLS-1$
       
              if (!defaultGeometry.isValid()) {
            ProjectPlugin
              .log(className
                + "- Original feature has invalid geometry: " + defaultGeometry.toText()); //$NON-NLS-1$
            throw new SplitFeaturesCommandException(
              Messages.SplitFeaturesCommand_the_feature_has_invalid_geometry);
              }
              featureList.add(feature);
       
View Full Code Here

    Geometry geometry;

    geometry = reader.read(wkt);
   
    if(!geometry.isValid()){
        throw new IllegalStateException("the geometry is not valid: " + geometry.toText() ); //$NON-NLS-1$
    }

    return geometry;
  }
View Full Code Here

      this.splitResultList = new LinkedList<SimpleFeature>();
      boolean existSplit = false;
      for (SimpleFeature feature : this.featureList) {

        Geometry geomToSplit = (Geometry) feature.getDefaultGeometry();
        assert geomToSplit.isValid() : "No Valid Geometry: " + geomToSplit.toText(); //$NON-NLS-1$
        CoordinateReferenceSystem featureCrs = feature.getFeatureType()
            .getCoordinateReferenceSystem();
        geomToSplit = GeoToolsUtils.reproject(geomToSplit, featureCrs, this.desiredCRS);

        if (canSplit(geomToSplit)) {
View Full Code Here

                Geometry g = (Geometry) f.getDefaultGeometry();
                Point centroid = g.getCentroid();
               
                //robustness check for bad geometries
                if ( Double.isNaN( centroid.getX() ) || Double.isNaN( centroid.getY() ) ) {
                    LOGGER.warning( "Could not calculate centroid for feature " + f.getID() + "; g =  " + g.toText() );
                    continue;
                }
               
                coords[0] = centroid.getX();
                coords[1] = centroid.getY();
View Full Code Here

    .getResultSplitLine();
  AdaptedPolygon adaptedPolygon = this.usefulSplitLineBuilder
    .getAdaptedPolygon();

  LOGGER.fine("Adapted Polygon: " + adaptedPolygon.asPolygon().toText()); //$NON-NLS-1$
  LOGGER.fine("Util split line: " + utilSplitLine.toText()); //$NON-NLS-1$

  buildGraph(utilSplitLine, adaptedPolygon.asPolygon());

  return this;
View Full Code Here

    } catch (TransformException e) {
      logger.error("Cannot perform the transformation!", e);
      return inGeomWKT;
    }

    return outGeom.toText();
  }
}
View Full Code Here

      sb.append("[");
      for (Iterator<Geometry> itr = geometries.iterator(); itr.hasNext();) {
        Geometry geometry = itr.next();
        sb.append("{");
        sb.append(geometry.toText());
        sb.append("}");
      }
      sb.append("]");

      return sb.toString();
View Full Code Here

    final String sourceSRID = "EPSG:4326";
    final String targetSRID = "EPSG:3395";
    Geometry geom = factory.createPoint(new Coordinate(42.349167d,
        3.684722d));
    geom = MessageProcessor.transform(geom, sourceSRID, targetSRID);
    assertEquals(geom.toText(),
        "POINT (410181.3767547725 5184634.982024495)");

  }
}
View Full Code Here

          coord.x = - coord.x;//invert sign of dateline boundary some of the time
      }
    });
    pGeom.geometryChanged();
    assertFalse(pGeom.isValid());
    return (JtsGeometry) ctx.readShapeFromWkt(pGeom.toText());
  }

  @Test
  public void testRelations() throws ParseException {
    testRelations(false);
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.