Examples of GeometryDescriptor


Examples of org.opengis.feature.type.GeometryDescriptor

            Rule rule = getRule(sld);

            BufferedImage swtIcon = null;
            if (layer.hasResource(FeatureSource.class) && rule != null) {
                SimpleFeatureType type = layer.getSchema();
                GeometryDescriptor geom = type.getGeometryDescriptor();
                if (geom != null) {
                    Class geom_type = geom.getType().getBinding();
                    if (geom_type == Point.class || geom_type == MultiPoint.class) {
                        swtIcon = point(rule, boxWidth, boxHeight);
                    } else if (geom_type == LineString.class || geom_type == MultiLineString.class) {
                        swtIcon = line(rule, boxWidth, boxHeight);
                    } else if (geom_type == Polygon.class || geom_type == MultiPolygon.class) {
View Full Code Here

Examples of org.opengis.feature.type.GeometryDescriptor

        SimpleFeatureSource featureSource = (SimpleFeatureSource) selectedLayer.getResource(FeatureSource.class,
                new SubProgressMonitor(monitor, 1));
        if (featureSource == null) {
            return;
        }
        GeometryDescriptor geometryDescriptor = featureSource.getSchema().getGeometryDescriptor();
        ReferencedEnvelope bounds = ApplicationGIS.getActiveMap().getViewportModel().getBounds();
        CoordinateReferenceSystem mapCrs = bounds.getCoordinateReferenceSystem();
       
        ReferencedEnvelope featureBounds = featureSource.getBounds();
        if (featureBounds == null || featureBounds.isNull()){
            return;
        }
        CoordinateReferenceSystem featureCrs = featureBounds.getCoordinateReferenceSystem();
        ReferencedEnvelope tBounds = bounds.transform(featureCrs, true);
       
        boolean crsEqual = CRS.equalsIgnoreMetadata(featureCrs, mapCrs);
        MathTransform mathTransform = CRS.findMathTransform(featureCrs, mapCrs, true);
       
        String name = geometryDescriptor.getLocalName();
        Filter bboxFilter = getBboxFilter(name, tBounds);
        SimpleFeatureCollection featureCollection = featureSource.getFeatures(bboxFilter);

        FeatureIterator<SimpleFeature> featureIterator = featureCollection.features();
        IViewportModel viewPort = ApplicationGIS.getActiveMap().getViewportModel();
View Full Code Here

Examples of org.opengis.feature.type.GeometryDescriptor

        manager.getMap().sendCommandASync(sync);
    }
    @Override
    // This is simply the same as in DecoratingFeature.class
    public void setDefaultGeometry( Object geometry ) {
        GeometryDescriptor geometryDescriptor = getFeatureType().getGeometryDescriptor();
        setAttribute(geometryDescriptor.getName(), geometry);
    }
View Full Code Here

Examples of org.opengis.feature.type.GeometryDescriptor

        throw new UnsupportedOperationException();
    }

    @Override
    public void setDefaultGeometry( Geometry geometry ) throws IllegalAttributeException {
        GeometryDescriptor geometryDescriptor = getFeatureType().getGeometryDescriptor();
        setAttribute(geometryDescriptor.getName(), geometry);
    }
View Full Code Here

Examples of org.opengis.feature.type.GeometryDescriptor

        bb.addPoint(10,10,geom.getShell());
        EditGeom geom2 = bb.newGeom(fid, null);
        AttributeTypeBuilder builder = new AttributeTypeBuilder();
        builder.setBinding(Geometry.class);
        builder.setName("geom");
        GeometryDescriptor at = (GeometryDescriptor) builder.buildDescriptor("geom", builder.buildGeometryType());
        Map<String, Bag> result = GeometryCreationUtil.createAllGeoms(geom, Point.class, at, false);
       
        assertEquals(1, result.get(fid).jts.size());

        bb.addPoint(100,100, geom2.getShell());
View Full Code Here

Examples of org.opengis.feature.type.GeometryDescriptor

        bb.addPoint(10,10,geom.getShell());
        EditGeom geom2 = bb.newGeom(fid, null);
        AttributeTypeBuilder builder = new AttributeTypeBuilder();
        builder.setBinding(Geometry.class);
        builder.setName("geom");
        GeometryDescriptor at = builder.buildDescriptor("geom", builder.buildGeometryType());
        bb.addPoint(100,100, geom2.getShell());
       
        String fid2="FID2";
        EditGeom differentGeom=bb.newGeom(fid2, null);
        bb.addPoint(200,200, differentGeom.getShell());
View Full Code Here

Examples of org.opengis.feature.type.GeometryDescriptor

    assert layer != null;

    this.layer = layer;
    this.featureType = layer.getSchema();

    GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor();
    if( geometryDescriptor == null){
      throw new IllegalStateException( "The layer schema does not contain a geometry descriptor"); //$NON-NLS-1$
    }
    this.mergedFeature = new Object[featureType.getAttributeCount()];
    this.defaultGeometryIndex = featureType.indexOf(geometryDescriptor.getName());   
  }
View Full Code Here

Examples of org.opengis.feature.type.GeometryDescriptor

        throws Exception {
  FeatureSource<SimpleFeatureType, SimpleFeature> source =
    (FeatureSource<SimpleFeatureType, SimpleFeature>) target;
 
    SimpleFeatureType featureType = source.getSchema();
    GeometryDescriptor geometryType = featureType.getGeometryDescriptor();
    CoordinateReferenceSystem crs = geometryType.getCoordinateReferenceSystem();   
   
    String typeName = featureType.getTypeName();   
   
    // String filename = promptSaveDialog( typeName )
    String filename = typeName.replace(':', '_');   
View Full Code Here

Examples of org.opengis.feature.type.GeometryDescriptor

            keywords = new String[]{type, ft.getName().getNamespaceURI()};
        }

        public CoordinateReferenceSystem getCRS() {
            GeometryDescriptor defaultGeometry = ft.getGeometryDescriptor();
            if (defaultGeometry != null)
                return defaultGeometry.getCoordinateReferenceSystem();
            return null;
        }
View Full Code Here

Examples of org.opengis.feature.type.GeometryDescriptor

   */
  public static Class<? extends Geometry> getGeometryClass(final ILayer layer) {

    assert layer != null;

    GeometryDescriptor type = layer.getSchema().getGeometryDescriptor();

    Class<? extends Geometry> geomClass = (Class<? extends Geometry>) type.getType().getBinding();

    return geomClass;
  }
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.