Package org.opengis.feature.type

Examples of org.opengis.feature.type.GeometryDescriptor


                    .put("name", NAME )
                    .put("property", kind )
                    .put("type", t.getBinding().getSimpleName() );
               
                if( d instanceof GeometryDescriptor){
                    GeometryDescriptor g = (GeometryDescriptor) d;                   
                    proj( property.putObject("proj"), g.getCoordinateReferenceSystem(), null );
                }

                if( details){
                    property
                        .put("namespace", d.getName().getNamespaceURI() )
View Full Code Here


                if (delegate.getSchema().getDescriptors().size() != featureType.getDescriptors()
                        .size()) {
                    throw new GeoToolsOpException(
                            GeoToolsOpException.StatusCode.INCOMPATIBLE_FEATURE_TYPE);
                }
                GeometryDescriptor geomDescriptorOrg = delegate.getSchema().getGeometryDescriptor();
                GeometryDescriptor geomDescriptorDest = featureType.getGeometryDescriptor();
                if (!geomDescriptorOrg.getType().getBinding()
                        .equals(geomDescriptorDest.getType().getBinding())
                        || !geomDescriptorOrg
                                .getType()
                                .getCoordinateReferenceSystem()
                                .equals(geomDescriptorDest.getType().getCoordinateReferenceSystem())) {
                    throw new GeoToolsOpException(
                            GeoToolsOpException.StatusCode.INCOMPATIBLE_FEATURE_TYPE);
                }
                FeatureIterator<F> iterator = delegate.features();
                SimpleFeatureBuilder builder = new SimpleFeatureBuilder(
View Full Code Here

        List<Optional<Object>> values = getValues();
        Object defaultGeometry = idx != null ? values.get(idx).orNull() : null;

        // not found? do we have a default geometry at all?
        if (defaultGeometry == null) {
            GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor();
            if (geometryDescriptor != null) {
                Integer defaultGeomIndex = nameToRevTypeIndex.get(geometryDescriptor.getName()
                        .getLocalPart());
                defaultGeometry = values.get(defaultGeomIndex.intValue()).get();
            }
        }
View Full Code Here

        return (BoundingBox) bounds;
    }

    @Override
    public GeometryAttribute getDefaultGeometryProperty() {
        GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor();
        GeometryAttribute geometryAttribute = null;
        if (geometryDescriptor != null) {
            Object defaultGeometry = getDefaultGeometry();
            geometryAttribute = new GeometryAttributeImpl(defaultGeometry, geometryDescriptor, null);
        }
View Full Code Here

        List<PropertyDescriptor> sortedDescriptors = revType.sortedDescriptors();

        Map<String, Integer> typeAttNameToRevTypeIndex = Maps.newHashMap();

        final GeometryDescriptor defaultGeometry = ((SimpleFeatureType) revType.type())
                .getGeometryDescriptor();
        for (int revFeatureIndex = 0; revFeatureIndex < sortedDescriptors.size(); revFeatureIndex++) {
            PropertyDescriptor prop = sortedDescriptors.get(revFeatureIndex);
            typeAttNameToRevTypeIndex.put(prop.getName().getLocalPart(),
                    Integer.valueOf(revFeatureIndex));
View Full Code Here

            }
        }
    }

    private String getOriginTreesFromOutputFeatureType(SimpleFeatureType featureType) {
        GeometryDescriptor descriptor = featureType.getGeometryDescriptor();
        Class<?> clazz = descriptor.getType().getBinding();
        if (clazz.equals(Point.class)) {
            return "node";
        } else {
            return "way";
        }
View Full Code Here

                // If there is previous data in the destination tree, we try to get the name of the
                // geom attribute.
                // If the destination tree does not exist, we use the default name for the geometry
                // attribute
                if (ft.isPresent()) {
                    GeometryDescriptor geomDescriptor = ft.get().type().getGeometryDescriptor();
                    if (geomDescriptor != null) {
                        geomName = geomDescriptor.getLocalName();
                    }
                }
            }
            try {
                cli.getConsole().println("Importing from GeoJSON " + geoJSON);
View Full Code Here

            dataStore.dispose();
        }
    }

    private String getOriginTreesFromOutputFeatureType(SimpleFeatureType featureType) {
        GeometryDescriptor descriptor = featureType.getGeometryDescriptor();
        Class<?> clazz = descriptor.getType().getBinding();
        if (clazz.equals(Point.class)) {
            return "node";
        } else {
            return "way";
        }
View Full Code Here

        }
        return tableName;
    }

    private String getOriginTreesFromOutputFeatureType(SimpleFeatureType featureType) {
        GeometryDescriptor descriptor = featureType.getGeometryDescriptor();
        Class<?> clazz = descriptor.getType().getBinding();
        if (clazz.equals(Point.class)) {
            return "node";
        } else {
            return "way";
        }
View Full Code Here

            throws SQLException, IOException {
       
        //create any geometry columns entries after the fact
        for ( AttributeDescriptor ad : featureType.getAttributeDescriptors() ) {
            if ( ad instanceof GeometryDescriptor ) {
                GeometryDescriptor gd = (GeometryDescriptor) ad;
                StringBuffer sql = new StringBuffer( "INSERT INTO geometry_columns VALUES (");
               
                //table name
                sql.append( "'").append( featureType.getTypeName() ).append( "'," );
               
                //geometry name
                sql.append( "'").append( gd.getLocalName() ).append( "',");
               
                //type
                String gType = Geometries.getForBinding((Class<? extends Geometry>) gd.getType().getBinding() ).getName();
                if ( gType == null ) {
                    throw new IOException( "Unknown geometry type: " + gd.getType().getBinding() );
                }
                sql.append( "'").append( gType ).append( "',");
               
                //coord dimension
                sql.append( 2 ).append( ",");
               
                //srid
                Integer epsgCode = null;
                if ( gd.getCoordinateReferenceSystem() != null ) {
                    CoordinateReferenceSystem crs = gd.getCoordinateReferenceSystem();
                    try {
                        epsgCode = CRS.lookupEpsgCode( crs , true );
                    }
                    catch (Exception e) {}
                }
View Full Code Here

TOP

Related Classes of org.opengis.feature.type.GeometryDescriptor

Copyright © 2018 www.massapicom. 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.