Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
The main module contains the GeoTools public interfaces that are used by
other GeoTools modules (and GeoTools applications). Where possible we make
use industry standard terms as provided by OGC and ISO standards.
The formal GeoTools public api consists of gt-metadata, jts and the gt-main module.
The main module contains the default implementations that are available provided
to other GeoTools modules using our factory system. Factories are obtained from
an appropriate FactoryFinder, giving applications a chance configure the factory
used using the Factory Hints facilities.
FilterFactory ff = CommonFactoryFinder.getFilterFactory();
Expression expr = ff.add( expression1, expression2 );
If you find yourself using implementation specific classes chances are you doing it wrong:
Expression expr = new AddImpl( expression1, expressiom2 );
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2008, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package org.geotools.feature.simple;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import org.geotools.data.DataUtilities;
import org.geotools.factory.CommonFactoryFinder;
import org.geotools.feature.FeatureBuilder;
import org.geotools.feature.type.Types;
import org.locationtech.jts.geom.Geometry;
import org.opengis.feature.Feature;
import org.opengis.feature.FeatureFactory;
import org.opengis.feature.IllegalAttributeException;
import org.opengis.feature.Property;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.feature.type.AttributeDescriptor;
import org.opengis.feature.type.FeatureType;
import org.opengis.feature.type.Name;
/**
* A builder for features.
*
*
Simple Usage:
*
* //type of features we would like to build ( assume schema = (geom:Point,name:String) )
* SimpleFeatureType featureType = ...
*
* //create the builder
* SimpleFeatureBuilder builder = new SimpleFeatureBuilder();
*
* //set the type of created features
* builder.setType( featureType );
*
* //add the attributes
* builder.add( new Point( 0 , 0 ) );
* builder.add( "theName" );
*
* //build the feature
* SimpleFeature feature = builder.buildFeature( "fid" );
*
*
*
*
This builder builds a feature by maintaining state. Each call to {@link #add(Object)} creates
* a new attribute for the feature and stores it locally. When using the add method to add
* attributes to the feature, values added must be added in the same order as the attributes as
* defined by the feature type. The methods {@link #set(String, Object)} and {@link #set(int,
* Object)} are used to add attributes out of order.
*
*
Each time the builder builds a feature with a call to {@link #buildFeature(String)} the
* internal state is reset.
*
*
This builder can be used to copy features as well. The following code sample demonstrates:
*
*
* //original feature
* SimpleFeature original = ...;
*
* //create and initialize the builder
* SimpleFeatureBuilder builder = new SimpleFeatureBuilder();
* builder.init(original);
*
* //create the new feature
* SimpleFeature copy = builder.buildFeature( original.getID() );
*
*
*
*
*
The builder also provides a number of static "short-hand" methods which can be used when its
* not ideal to instantiate a new builder, thought this will trigger some extra object allocations.
* In time critical code sections it's better to instantiate the builder once and use it to build
* all the required features.
*
* SimpleFeatureType type = ..;
* Object[] values = ...;
*
* //build a new feature
* SimpleFeature feature = SimpleFeatureBuilder.build( type, values, "fid" );
*
* ...
*
* SimpleFeature original = ...;
*
* //copy the feature
* SimpleFeature feature = SimpleFeatureBuilder.copy( original );
*
*
*
*
This class is not thread safe nor should instances be shared across multiple threads.
*
* @author Justin Deoliveira
* @author Jody Garnett
*/
public class SimpleFeatureBuilder extends FeatureBuilder {
/** logger */
static Logger LOGGER = org.geotools.util.logging.Logging.getLogger(SimpleFeatureBuilder.class);
/** the feature type */
SimpleFeatureType featureType;
/** the feature factory */
FeatureFactory factory;
/** the attribute name to index index */
Map index;
/** the values */
// List