Package org.geotools.grid
Class DefaultGridFeatureBuilder
- Object
-
- GridFeatureBuilder
-
- DefaultGridFeatureBuilder
-
public final class DefaultGridFeatureBuilder extends GridFeatureBuilder
A basic implementation ofGridFeatureBuilder
which will create aSimpleFeatureType
having two properties:- element - TYPE Polygon
- id - TYPE Integer
Grid elements will be assigned sequential id values starting with 1.
- Since:
- 2.7
- Author:
- mbedward
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_TYPE_NAME
Default feature TYPE name: "grid"static String
ID_ATTRIBUTE_NAME
Name used for the integer id attribute: "id"-
Fields inherited from class GridFeatureBuilder
DEFAULT_GEOMETRY_ATTRIBUTE_NAME
-
-
Constructor Summary
Constructors Constructor Description DefaultGridFeatureBuilder()
Creates a new instance with a feature TYPE having the default name and a null coordinate reference system.DefaultGridFeatureBuilder(String typeName, CoordinateReferenceSystem crs)
Creates a new instance.DefaultGridFeatureBuilder(CoordinateReferenceSystem crs)
Creates a new instance with a feature TYPE having the default name and the supplied coordinate reference system.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static SimpleFeatureType
createType(String typeName, CoordinateReferenceSystem crs)
Creates the feature TYPEvoid
setAttributes(GridElement el, Map<String,Object> attributes)
Overrides GridFeatureBuilder.setAttributes(GridElement, Map) to assign a sequential integer id value to each grid element feature as it is constructed.-
Methods inherited from class GridFeatureBuilder
getCreateFeature, getFeatureID, getType
-
-
-
-
Field Detail
-
DEFAULT_TYPE_NAME
public static final String DEFAULT_TYPE_NAME
Default feature TYPE name: "grid"- See Also:
- Constant Field Values
-
ID_ATTRIBUTE_NAME
public static final String ID_ATTRIBUTE_NAME
Name used for the integer id attribute: "id"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultGridFeatureBuilder
public DefaultGridFeatureBuilder()
Creates a new instance with a feature TYPE having the default name and a null coordinate reference system.- See Also:
DEFAULT_TYPE_NAME
-
DefaultGridFeatureBuilder
public DefaultGridFeatureBuilder(CoordinateReferenceSystem crs)
Creates a new instance with a feature TYPE having the default name and the supplied coordinate reference system.- Parameters:
crs
- coordinate reference system (may benull
)- See Also:
DEFAULT_TYPE_NAME
-
DefaultGridFeatureBuilder
public DefaultGridFeatureBuilder(String typeName, CoordinateReferenceSystem crs)
Creates a new instance.- Parameters:
typeName
- name for the feature TYPE; ifnull
or empty, DEFAULT_TYPE_NAME will be usedcrs
- coordinate reference system (may benull
)
-
-
Method Detail
-
createType
protected static SimpleFeatureType createType(String typeName, CoordinateReferenceSystem crs)
Creates the feature TYPE- Parameters:
typeName
- name for the feature TYPE; ifnull
or empty, DEFAULT_TYPE_NAME will be usedcrs
- coordinate reference system (may benull
)- Returns:
- the feature TYPE
-
setAttributes
public void setAttributes(GridElement el, Map<String,Object> attributes)
Overrides GridFeatureBuilder.setAttributes(GridElement, Map) to assign a sequential integer id value to each grid element feature as it is constructed.- Specified by:
setAttributes
in classGridFeatureBuilder
- Parameters:
el
- the element from which the new feature is being constructedattributes
- aMap
with the single key "id"
-
-