Examples of toGeometry()


Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

        partly = true;
         envelope = new Envelope(2, 4, 2, 4);
      }
      PrecisionModel precisionModel  = new PrecisionModel(PrecisionModel.FLOATING);
      GeometryFactory geometryFactory = new GeometryFactory(precisionModel, LAYER_SRID);
      geometry = geometryFactory.toGeometry(envelope);
    }

    public Geometry getVisibleArea(String layerId) {
      return geometry;
    }
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

      // build Geometry which covers biggest possible area
      Envelope maxBounds = new Envelope(-Double.MAX_VALUE, Double.MAX_VALUE,
          -Double.MAX_VALUE, Double.MAX_VALUE);
      PrecisionModel precisionModel = new PrecisionModel(PrecisionModel.FLOATING);
      GeometryFactory geometryFactory = new GeometryFactory(precisionModel, 0);
      biggestGeometry = geometryFactory.toGeometry(maxBounds);
    }
    return biggestGeometry;
  }

  protected boolean isPartlyAuthorizedSufficient(String layerId) {
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

      // build Geometry which covers biggest possible area
      Envelope maxBounds = new Envelope(-Double.MAX_VALUE, Double.MAX_VALUE,
          -Double.MAX_VALUE, Double.MAX_VALUE);
      PrecisionModel precisionModel = new PrecisionModel(PrecisionModel.FLOATING);
      GeometryFactory geometryFactory = new GeometryFactory(precisionModel, 0);
      biggestGeometry = geometryFactory.toGeometry(maxBounds);
    }
    return biggestGeometry;
  }

  protected boolean isPartlyAuthorizedSufficient(String layerId) {
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

    // base is the max bounds of the layer
    Envelope maxBounds = converterService.toInternal(layerInfo.getMaxExtent());
    PrecisionModel precisionModel = new PrecisionModel(PrecisionModel.FLOATING);
    int srid = geoService.getSridFromCrs(layer.getLayerInfo().getCrs());
    GeometryFactory geometryFactory = new GeometryFactory(precisionModel, srid);
    Geometry geometry = geometryFactory.toGeometry(maxBounds);

    // limit based on authorizations
    for (Authentication authentication : authentications) {
      for (BaseAuthorization authorization : authentication.getAuthorizations()) {
        if (authorization instanceof AreaAuthorization) {
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

        feature.setAttribute(DESCRIPTION_ATTR, "description"); //$NON-NLS-1$
        writer.write();
    }
    public static MultiPolygon createBounds( ReferencedEnvelope env ) {
        GeometryFactory factory=new GeometryFactory();
        Polygon[] polygons=new Polygon[]{(Polygon)factory.toGeometry(env)};
        return factory.createMultiPolygon(polygons);
    }
    public static void addFeatures(DataStore store, SimpleFeatureType featureType) throws Exception {
      FeatureWriter<SimpleFeatureType, SimpleFeature> writer = store.getFeatureWriterAppend(featureType.getName().getLocalPart(), Transaction.AUTO_COMMIT);
       
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

          issue.getViewMemento(viewMemento);
         
          GeometryFactory geometryFactory = new GeometryFactory();
          Geometry bounds=null;
          if( issue.getBounds()!=null )
          bounds = geometryFactory.toGeometry(issue.getBounds());
          if( bounds instanceof Polygon && MultiPolygon.class.isAssignableFrom(attributeType[0].getType().getBinding()) ){
              bounds=geometryFactory.createMultiPolygon(new Polygon[]{ (Polygon)bounds});
          }
          if( bounds instanceof MultiPolygon && Polygon.class.isAssignableFrom(attributeType[0].getType().getBinding()) ){
              bounds=((MultiPolygon)bounds).getGeometryN(0);
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

    for (Object obj : linesList) {

      LineString line = (LineString) obj;
      GeometryFactory gfac = line.getFactory();
      bboxGeometry = gfac.toGeometry(bbox);

      if (bboxGeometry.intersects(line)) {
        geom = line;
      }
    }
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

                    Geometry centroidGeom = null;

                    // get geometry of the area of interest
                    Envelope aoi = mapContext.getAreaOfInterest();
                    GeometryFactory factory = new GeometryFactory();
                    Geometry displayGeom = factory.toGeometry(new Envelope(aoi
                            .getMinX(), aoi.getMaxX(), aoi.getMinY(), aoi
                            .getMaxY()));

                    // get the styles for this feature
                    SimpleFeatureType featureType = features.getSchema();
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

        final GeometryFactory gfac = new GeometryFactory();
        final Optional<Geometry> rotatedMapBounds = getRotatedMapBounds(gfac);

        if (rotatedMapBounds.isPresent()) {
            return rotatedMapBounds.get().intersects(gfac.toGeometry(tileBounds));
        } else {
            // in case of an error, we simply load the tile
            return true;
        }
    }
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.toGeometry()

        SimpleFeature smallestFeature = null;
        while (indexIter.hasNext()) {
            SimpleFeature newFeature = indexIter.next();

            BoundingBox bounds = newFeature.getBounds();
            Geometry geometry = factory.toGeometry(new ReferencedEnvelope(
                    bounds));
            double newArea = geometry.getArea();

            if (smallestFeature == null || newArea < area) {
                smallestFeature = newFeature;
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.