Package org.geotools.feature

Examples of org.geotools.feature.NameImpl


      return new GeometryTypeImpl( new NameImpl( "dummygeomtype" ), clazz, null, false, false, null, null, null );
    }
   
    public static GeometryDescriptor createGeometryDescriptor( GeometryType geometryType )
    {
      return new GeometryDescriptorImpl( geometryType, new NameImpl( "dummygeom" ), 0, 1, true, null );
    }
View Full Code Here


    // TODO Try using the SimpleFeatureBuilder class.
    GeometryType geometryType = LimbGeneratorTest.Utils.createGeometryType( LineString.class );
    GeometryDescriptor geometryDescriptor = LimbGeneratorTest.Utils.createGeometryDescriptor( geometryType );
    List<AttributeDescriptor> attributeDescriptors = new ArrayList<AttributeDescriptor>();
    attributeDescriptors.add( geometryDescriptor );
    SimpleFeatureType featureType = new SimpleFeatureTypeImpl( new NameImpl( "test" ), attributeDescriptors, geometryDescriptor, false, null, null, null );
    List<Object> attributeValues = new ArrayList<Object>();
    attributeValues.add( null );
    this.feature = new SimpleFeatureImpl( attributeValues, featureType, new FeatureIdImpl( "test" ) );
  }
View Full Code Here

        SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
        String name = "feature";
        if (config.has("name", config)) {
            name = Context.toString(config.get("name", config));
        }
        builder.setName(new NameImpl(name));
        String namespaceUri = (String) getOptionalMember(config, "uri", String.class);
        if (namespaceUri == null) {
            namespaceUri = "http://geoscript.org/#schema";
        }
        builder.setNamespaceURI(namespaceUri);
View Full Code Here

   
    @JSStaticFunction
    public static Process get(Scriptable processNameObj) {
        Process jsProcess = null;
        String[] parts = processNameObj.toString().split(":");
        Name name = new NameImpl(parts[0], parts[1]);
        ProcessFactory factory = Processors.createProcessFactory(name);
        if (factory != null) {
            org.geotools.process.Process process = factory.create(name);
            Scriptable scope = ScriptableObject.getTopLevelScope(processNameObj);
            jsProcess = new Process(scope, factory.getTitle(name),
View Full Code Here

            Catalog catalog = workspaceBuilder.catalogBuilder.catalog;
           
            when(catalog.getLayer(id)).thenReturn(layer);
            when(catalog.getLayerByName(wsName+":"+name)).thenReturn(layer);
            when(catalog.getLayerByName(new NameImpl(workspaceBuilder.namespace.getURI(), name))).thenReturn(layer);
        }
View Full Code Here

        return l;
    }

    LayerInfo createLayerFromResource(JSONObj ref, WorkspaceInfo ws, Catalog cat) throws IOException {
        String storeName = ref.str("store");
        Name resourceName = new NameImpl(ref.str("name"));

        CatalogBuilder builder = new CatalogBuilder(cat);

        StoreInfo store = findStore(ws.getName(), storeName, cat);

        if( store instanceof DataStoreInfo){
            DataStoreInfo dataStore = (DataStoreInfo) store;
            builder.setStore(dataStore);

            // create from the resource
            FeatureTypeInfo ft = null;
            try {
                ft = builder.buildFeatureType(resourceName);
            }
            catch(Exception e) {
                Throwables.propagateIfInstanceOf(e, IOException.class);
                Throwables.propagate(e);
            }

            DataAccess data = dataStore.getDataStore(null);

            FeatureSource source = data.getFeatureSource(resourceName);
            builder.setupBounds(ft, source);

            return builder.buildLayer(ft);
        }
        else if (store instanceof CoverageStoreInfo) {
            CoverageStoreInfo covStore = (CoverageStoreInfo) store;
            builder.setStore(covStore);

            CoverageInfo cov = null;
            try {
                cov = builder.buildCoverage(resourceName.getLocalPart());
            } catch (Exception e) {
                Throwables.propagateIfInstanceOf(e, IOException.class);
                Throwables.propagate(e);
            }
View Full Code Here

        throw new NotFoundException(message);
    }

    LayerInfo findLayer(String wsName, String name) {
        Catalog cat = geoServer.getCatalog();
        return wsName != null ? cat.getLayerByName(new NameImpl(wsName, name)) :
            cat.getLayerByName(name);
    }
View Full Code Here

            org.geotools.data.ResourceInfo info;
            if (dataStore instanceof DataStore) {
                schema = ((DataStore) dataStore).getSchema(name);
                info = ((DataStore) dataStore).getFeatureSource(name).getInfo();
            } else {
                NameImpl qname = new NameImpl(name);
                schema = dataStore.getSchema(qname);
                info = dataStore.getFeatureSource(qname).getInfo();
            }
            String title = info.getTitle() == null
                    ? WordUtils.capitalize(name)
View Full Code Here

            String name = descriptor.getName().getLocalPart();
            Preconditions.checkArgument(!name.equals(geomName),
                    "The provided geom name is already in use by another attribute");
            if (name.equals(oldGeomName)) {
                AttributeDescriptorImpl newDescriptor = new AttributeDescriptorImpl(
                        descriptor.getType(), new NameImpl(geomName), descriptor.getMinOccurs(),
                        descriptor.getMaxOccurs(), descriptor.isNillable(),
                        descriptor.getDefaultValue());
                newAttributes.add(newDescriptor);
            } else {
                newAttributes.add(descriptor);
View Full Code Here

    }

    private SimpleFeatureType forceFeatureTypeName(SimpleFeatureType featureType, String path) {
        SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
        builder.setAttributes(featureType.getAttributeDescriptors());
        builder.setName(new NameImpl(featureType.getName().getNamespaceURI(), path));
        builder.setCRS(featureType.getCoordinateReferenceSystem());

        featureType = builder.buildFeatureType();
        return featureType;
    }
View Full Code Here

TOP

Related Classes of org.geotools.feature.NameImpl

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.