public class Layer extends MajorObject
The Layer class is a binding for the C++ OGRLayer class.
Modifier and Type | Method | Description |
---|---|---|
void |
addReference(java.lang.Object reference) |
|
int |
AlterFieldDefn(int iField,
FieldDefn newFieldDefn,
int nFlags) |
Alter the definition of an existing field on a layer.
|
int |
Clip(Layer pLayerMethod,
Layer pLayerResult) |
Clip off areas that are not covered by the method layer.
|
int |
Clip(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options) |
Clip off areas that are not covered by the method layer.
|
int |
Clip(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options,
ProgressCallback callback) |
Clip off areas that are not covered by the method layer.
|
int |
CommitTransaction() |
For datasources which support transactions, CommitTransaction commits a
transaction.
|
int |
CreateFeature(Feature feature) |
Create and write a new feature within a layer.
|
int |
CreateField(FieldDefn field_def) |
Create a new field on a layer.
|
int |
CreateField(FieldDefn field_def,
int approx_ok) |
Create a new field on a layer.
|
int |
CreateGeomField(GeomFieldDefn field_def) |
|
int |
CreateGeomField(GeomFieldDefn field_def,
int approx_ok) |
|
void |
delete() |
Deprecated.
Do not do anything...
|
int |
DeleteFeature(long fid) |
Delete feature from layer.
|
int |
DeleteField(int iField) |
Delete an existing field on a layer.
|
boolean |
equals(java.lang.Object obj) |
|
int |
Erase(Layer pLayerMethod,
Layer pLayerResult) |
Remove areas that are covered by the method layer.
|
int |
Erase(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options) |
Remove areas that are covered by the method layer.
|
int |
Erase(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options,
ProgressCallback callback) |
Remove areas that are covered by the method layer.
|
int |
FindFieldIndex(java.lang.String pszFieldName,
int bExactMatch) |
|
double[] |
GetExtent() |
Fetch the extent of this layer.
|
double[] |
GetExtent(boolean force) |
Fetch the extent of this layer.
|
int |
GetExtent(double[] extent,
int force) |
Fetch the extent of this layer.
|
Feature |
GetFeature(long fid) |
Fetch a feature by its identifier.
|
long |
GetFeatureCount() |
Fetch the feature count in this layer.
|
long |
GetFeatureCount(int force) |
Fetch the feature count in this layer.
|
long |
GetFeaturesRead() |
Return the total number of features read.
|
java.lang.String |
GetFIDColumn() |
Returns the name of the FID column.
|
java.lang.String |
GetGeometryColumn() |
Returns the name of the geometry column.
|
int |
GetGeomType() |
Return the layer geometry type.
|
FeatureDefn |
GetLayerDefn() |
Fetch the schema information for this layer.
|
java.lang.String |
GetName() |
Return the layer name.
|
Feature |
GetNextFeature() |
Fetch the next available feature from this layer.
|
int |
GetRefCount() |
Fetch reference count.
|
Geometry |
GetSpatialFilter() |
Return the current spatial filter for this layer.
|
SpatialReference |
GetSpatialRef() |
Fetch the spatial reference system for this layer.
|
StyleTable |
GetStyleTable() |
|
int |
hashCode() |
|
int |
Identity(Layer pLayerMethod,
Layer pLayerResult) |
Identify the features of this layer with the ones from the
identity layer.
|
int |
Identity(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options) |
Identify the features of this layer with the ones from the
identity layer.
|
int |
Identity(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options,
ProgressCallback callback) |
Identify the features of this layer with the ones from the
identity layer.
|
int |
Intersection(Layer pLayerMethod,
Layer pLayerResult) |
Intersection of two layers.
|
int |
Intersection(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options) |
Intersection of two layers.
|
int |
Intersection(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options,
ProgressCallback callback) |
Intersection of two layers.
|
int |
ReorderField(int iOldFieldPos,
int iNewFieldPos) |
Reorder an existing field on a layer.
|
int |
ReorderFields(int[] panMap) |
Reorder all the fields of a layer.
|
void |
ResetReading() |
Reset feature reading to start on the first feature.
|
int |
RollbackTransaction() |
For datasources which support transactions, RollbackTransaction will roll
back a datasource to its state before the start of the current transaction.
|
int |
SetAttributeFilter(java.lang.String filter_string) |
Set a new attribute query.
|
int |
SetFeature(Feature feature) |
Rewrite an existing feature.
|
int |
SetIgnoredFields(java.util.Vector fieldNames) |
Set which fields can be omitted when retrieving features from the layer.
|
int |
SetNextByIndex(long new_index) |
Move read cursor to the new_index'th feature in the current resultset.
|
void |
SetSpatialFilter(int iGeomField,
Geometry filter) |
|
void |
SetSpatialFilter(Geometry filter) |
Set a new spatial filter.
|
void |
SetSpatialFilterRect(double minx,
double miny,
double maxx,
double maxy) |
Set a new rectangular spatial filter.
|
void |
SetSpatialFilterRect(int iGeomField,
double minx,
double miny,
double maxx,
double maxy) |
|
void |
SetStyleTable(StyleTable table) |
|
int |
StartTransaction() |
For datasources which support transactions, StartTransaction creates
a transaction.
|
int |
SymDifference(Layer pLayerMethod,
Layer pLayerResult) |
Symmetrical difference of two layers.
|
int |
SymDifference(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options) |
Symmetrical difference of two layers.
|
int |
SymDifference(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options,
ProgressCallback callback) |
Symmetrical difference of two layers.
|
int |
SyncToDisk() |
Flush pending changes to disk.
|
boolean |
TestCapability(java.lang.String cap) |
Test if this layer supported the named capability.
|
int |
Union(Layer pLayerMethod,
Layer pLayerResult) |
Union of two layers.
|
int |
Union(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options) |
Union of two layers.
|
int |
Union(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options,
ProgressCallback callback) |
Union of two layers.
|
int |
Update(Layer pLayerMethod,
Layer pLayerResult) |
Update this layer with features from the update layer.
|
int |
Update(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options) |
Update this layer with features from the update layer.
|
int |
Update(Layer pLayerMethod,
Layer pLayerResult,
java.util.Vector options,
ProgressCallback callback) |
Update this layer with features from the update layer.
|
GetDescription, GetMetadata_Dict, GetMetadata_Dict, GetMetadata_List, GetMetadata_List, GetMetadataDomainList, GetMetadataItem, GetMetadataItem, SetDescription, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadataItem, SetMetadataItem
public void delete()
delete
in class MajorObject
public void addReference(java.lang.Object reference)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public double[] GetExtent(boolean force)
Returns the extent (MBR) of the data in the layer. If force is false, and it would be expensive to establish the extent then a null value will be returned indicating that the extent isn't know. If force is true then some implementations will actually scan the entire layer once to compute the MBR of all the features in the layer.
Depending on the drivers, the returned extent may or may not take the spatial filter into account. So it is safer to call GetExtent() without setting a spatial filter.
Layers without any geometry may return a null value just indicating that no meaningful extents could be collected.
force
- Flag indicating whether the extent should be computed even
if it is expensivepublic double[] GetExtent()
GetExtent(boolean force)
public int GetRefCount()
Should be of little use in Java...
public void SetSpatialFilter(Geometry filter)
This method set the geometry to be used as a spatial filter when fetching features via the GetNextFeature() method. Only features that geometrically intersect the filter geometry will be returned.
Currently this test is may be inaccurately implemented, but it is guaranteed that all features who's envelope (as returned by Geometry.getEnvelope()) overlaps the envelope of the spatial filter will be returned. This can result in more shapes being returned that should strictly be the case.
This method makes an internal copy of the passed geometry. The passed geometry remains the responsibility of the caller, and may be safely destroyed.
For the time being the passed filter geometry should be in the same SRS as the layer (as returned by GetSpatialRef()). In the future this may be generalized.
filter
- the geometry to use as a filtering region. null may
be passed indicating that the current spatial filter should be cleared,
but no new one instituted.public void SetSpatialFilterRect(double minx, double miny, double maxx, double maxy)
The x/y values should be in the same coordinate system as the layer as a whole (as returned by GetSpatialRef()). Internally this method is normally implemented as creating a 5 vertex closed rectangular polygon and passing it to SetSpatialFilter(). It exists as a convenience.
The only way to clear a spatial filter set with this method is to call SetSpatialFilter(null).
minx
- the minimum X coordinate for the rectangular region.miny
- the minimum Y coordinate for the rectangular region.maxx
- the maximum X coordinate for the rectangular region.maxy
- the maximum Y coordinate for the rectangular region.public void SetSpatialFilter(int iGeomField, Geometry filter)
public void SetSpatialFilterRect(int iGeomField, double minx, double miny, double maxx, double maxy)
public Geometry GetSpatialFilter()
public int SetAttributeFilter(java.lang.String filter_string)
This method sets the attribute query string to be used when fetching features via the GetNextFeature() method. Only features for which the query evaluates as true will be returned.
The query string should be in the format of an SQL WHERE clause. For instance "population > 1000000 and population < 5000000" where population is an attribute in the layer. The query format is a restricted form of SQL WHERE clause as defined "eq_format=restricted_where" about half way through this document:
Proposal 6.2: Capabilities MetadataNote that installing a query string will generally result in resetting the current reading position (ala ResetReading()).
filter_string
- query in restricted SQL WHERE format, or null to clear the
current query.public void ResetReading()
public java.lang.String GetName()
This returns the same content as GetLayerDefn().GetName(), but for a few drivers, calling GetName() directly can avoid lengthy layer definition initialization.
public int GetGeomType()
This returns the same result as GetLayerDefn().GetGeomType(), but for a few drivers, calling GetGeomType() directly can avoid lengthy layer definition initialization.
public java.lang.String GetGeometryColumn()
This method returns the name of the underlying database column being used as the geometry column, or "" if not supported.
public java.lang.String GetFIDColumn()
This method returns the name of the underlying database column being used as the FID column, or "" if not supported.
public Feature GetFeature(long fid)
If this method returns a non-null feature, it is guaranteed that its feature id (Feature.GetFID()) will be the same as fid.
Use Layer.TestCapability(ogr.OLCRandomRead) to establish if this layer supports efficient random access reading via GetFeature(); however, the call should always work if the feature exists as a fallback implementation just scans all the features in the layer looking for the desired feature.
Sequential reads are generally considered interrupted by a GetFeature() call.
The returned feature will be properly handled by the Java garbage collector, but you can help it by explicitly calling the Feature.delete() method.
fid
- the feature id of the feature to read.public Feature GetNextFeature()
Only features matching the current spatial filter (set with SetSpatialFilter() will be returned.
This method implements sequential access to the features of a layer. The ResetReading() method can be used to start at the beginning again.
The returned feature will be properly handled by the Java garbage collector, but you can help it by explicitly calling the Feature.delete() method.
public int SetNextByIndex(long new_index)
This method allows positioning of a layer such that the GetNextFeature() call will read the requested feature, where nIndex is an absolute index into the current result set. So, setting it to 3 would mean the next feature read with GetNextFeature() would have been the 4th feature to have been read if sequential reading took place from the beginning of the layer, including accounting for spatial and attribute filters.
Only in rare circumstances is SetNextByIndex() efficiently implemented. In all other cases the default implementation which calls ResetReading() and then calls GetNextFeature() nIndex times is used. To determine if fast seeking is available on the current layer use the TestCapability() method with a value of OLCFastSetNextByIndex.
new_index
- the index indicating how many steps into the result set
to seek.public int SetFeature(Feature feature)
This method will write a feature to the layer, based on the feature id within the Feature.
Use Layer.TestCapability(ogr.OLCRandomWrite) to establish if this layer supports random access writing via SetFeature().
feature
- the feature to write.CreateFeature(Feature)
public int CreateFeature(Feature feature)
The passed feature is written to the layer as a new feature, rather than overwriting an existing one. If the feature has a feature id other than OGRNullFID, then the native implementation may use that as the feature id of the new feature, but not necessarily. Upon successful return the passed feature will have been updated with the new feature id.
feature
- the feature to write to disk.SetFeature(Feature)
public int DeleteFeature(long fid)
fid
- the feature id to be deleted from the layerpublic int SyncToDisk()
This call is intended to force the layer to flush any pending writes to disk, and leave the disk file in a consistent state. It would not normally have any effect on read-only datasources.
Some layers do not implement this method, and will still return 0. The default implementation just returns 0. An error is only returned if an error occurs while attempting to flush to disk.
public FeatureDefn GetLayerDefn()
The returned FeatureDefn is owned by the Layer, and should not be modified or freed by the application. It encapsulates the attribute schema of the features of the layer.
public long GetFeatureCount(int force)
Returns the number of features in the layer. For dynamic databases the count may not be exact. If force is 0, and it would be expensive to establish the feature count a value of -1 may be returned indicating that the count isn't know. If force is 1 some implementations will actually scan the entire layer once to count objects.
The returned count takes the spatial filter into account.
force
- Flag indicating whether the count should be computed even
if it is expensive.public long GetFeatureCount()
Same as below with force == 1.
GetFeatureCount(int force)
public int GetExtent(double[] extent, int force)
Returns the extent (MBR) of the data in the layer. If force is 0, and it would be expensive to establish the extent then a RuntimeException will be thrown indicating that the extent is not known. If force is 1 then some implementations will actually scan the entire layer once to compute the MBR of all the features in the layer.
Depending on the drivers, the returned extent may or may not take the spatial filter into account. So it is safer to call GetExtent() without setting a spatial filter.
Layers without any geometry may throw a RuntimeException just indicating that no meaningful extents could be collected.
extent
- an allocated array of 4 doubles in which the extent value will be returned.force
- Flag indicating whether the extent should be computed even
if it is expensive (1 for true, 0 for false).public boolean TestCapability(java.lang.String cap)
The capability codes that can be tested are represented as strings, but ogrConstants constants exists to ensure correct spelling. Specific layer types may implement class specific capabilities, but this can't generally be discovered by the caller.
cap
- the name of the capability to test.public int CreateField(FieldDefn field_def, int approx_ok)
You must use this to create new fields on a real layer. Internally the FeatureDefn for the layer will be updated to reflect the new field. Applications should never modify the FeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
Not all drivers support this method. You can query a layer to check if it supports it with the OLCCreateField capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly.
field_def
- field definition to write to disk.approx_ok
- If 1, the field may be created in a slightly different
form depending on the limitations of the format driver.public int CreateField(FieldDefn field_def)
public int DeleteField(int iField)
You must use this to delete existing fields on a real layer. Internally the FeatureDefn for the layer will be updated to reflect the deleted field. Applications should never modify the FeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
Not all drivers support this method. You can query a layer to check if it supports it with the OLCDeleteField capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly.
iField
- index of the field to delete.public int ReorderField(int iOldFieldPos, int iNewFieldPos)
This method is a convenience wrapper of ReorderFields() dedicated to move a single field. It is a non-virtual method, so drivers should implement ReorderFields() instead.
You must use this to reorder existing fields on a real layer. Internally the FeatureDefn for the layer will be updated to reflect the reordering of the fields. Applications should never modify the FeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
The field definition that was at initial position iOldFieldPos will be moved at position iNewFieldPos, and elements between will be shuffled accordingly.
For example, let suppose the fields were "0","1","2","3","4" initially. ReorderField(1, 3) will reorder them as "0","2","3","1","4".
Not all drivers support this method. You can query a layer to check if it supports it with the OLCReorderFields capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly.
iOldFieldPos
- previous position of the field to move. Must be in the range [0,GetFieldCount()-1].iNewFieldPos
- new position of the field to move. Must be in the range [0,GetFieldCount()-1].public int ReorderFields(int[] panMap)
You must use this to reorder existing fields on a real layer. Internally the FeatureDefn for the layer will be updated to reflect the reordering of the fields. Applications should never modify the FeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
panMap is such that,for each field definition at position i after reordering, its position before reordering was panMap[i].
For example, let suppose the fields were "0","1","2","3","4" initially. ReorderFields(new Integer[]{0,2,3,1,4}) will reorder them as "0","2","3","1","4".
Not all drivers support this method. You can query a layer to check if it supports it with the OLCReorderFields capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly.
panMap
- an array of GetLayerDefn().GetFieldCount() elements which
is a permutation of [0, GetLayerDefn().GetFieldCount()-1].public int AlterFieldDefn(int iField, FieldDefn newFieldDefn, int nFlags)
You must use this to alter the definition of an existing field of a real layer. Internally the FeatureDefn for the layer will be updated to reflect the altered field. Applications should never modify the FeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
Not all drivers support this method. You can query a layer to check if it supports it with the OLCAlterFieldDefn capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly. Some drivers might also not support all update flags.
iField
- index of the field whose definition must be altered.newFieldDefn
- new field definitionnFlags
- combination of ALTER_NAME_FLAG, ALTER_TYPE_FLAG and ALTER_WIDTH_PRECISION_FLAG
to indicate which of the name and/or type and/or width and precision fields from the new field
definition must be taken into account.public int CreateGeomField(GeomFieldDefn field_def, int approx_ok)
public int CreateGeomField(GeomFieldDefn field_def)
public int StartTransaction()
If starting the transaction fails, will throw a RuntimeException (or an error code if DontUseExceptions() has been called). Datasources which do not support transactions will always return 0.
public int CommitTransaction()
If no transaction is active, or the commit fails, will throw a RuntimeException (or an error code if DontUseExceptions() has been called). Datasources which do not support transactions will always return 0.
public int RollbackTransaction()
If no transaction is active, or the rollback fails, will throw a RuntimeException (or an error code if DontUseExceptions() has been called). Datasources which do not support transactions will always return 0.
public int FindFieldIndex(java.lang.String pszFieldName, int bExactMatch)
public SpatialReference GetSpatialRef()
public long GetFeaturesRead()
Note: not all drivers seem to update properly this count.
public int SetIgnoredFields(java.util.Vector fieldNames)
If the driver supports this functionality (testable using OLCIgnoreFields capability), it will not fetch the specified fields in subsequent calls to GetFeature() / GetNextFeature() and thus save some processing time and/or bandwidth.
Besides field names of the layers, the following special fields can be passed: "OGR_GEOMETRY" to ignore geometry and "OGR_STYLE" to ignore layer style.
By default, no fields are ignored.
fieldNames
- a vector of field names. If null is passed, the ignored list is cleared.public int Intersection(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options, ProgressCallback callback)
The result layer contains features whose geometries represent areas that are common between features in the input layer and in the method layer. The features in the result layer have attributes from both input and method layers. The schema of the result layer can be set by the user or, if it is empty, is initialized to contain all fields in the input and method layers.
If the schema of the result is set by user and contains fields that have the same name as a field in input and in method layer, then the attribute in the result feature will get the value from the feature of the method layer.
For best performance use the minimum amount of features in the method layer and copy it into a memory layer.
The recognized list of options is :
This method relies on GEOS support. Do not use unless the GEOS support is compiled in.
pLayerMethod
- the method layer. Should not be null.pLayerResult
- the layer where the features resulting from the
operation are inserted. Should not be null. See above the note
about the schema.options
- list of options (may be null).callback
- a callback function for reporting progress or null.public int Intersection(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options)
public int Intersection(Layer pLayerMethod, Layer pLayerResult)
public int Union(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options, ProgressCallback callback)
The result layer contains features whose geometries represent areas that are in either in the input layer or in the method layer. The features in the result layer have attributes from both input and method layers. For features which represent areas that are only in the input or in the method layer the respective attributes have undefined values. The schema of the result layer can be set by the user or, if it is empty, is initialized to contain all fields in the input and method layers.
If the schema of the result is set by user and contains fields that have the same name as a field in input and in method layer, then the attribute in the result feature will get the value from the feature of the method layer (even if it is undefined).
For best performance use the minimum amount of features in the method layer and copy it into a memory layer.
The recognized list of options is :
This method relies on GEOS support. Do not use unless the GEOS support is compiled in.
pLayerMethod
- the method layer. Should not be null.pLayerResult
- the layer where the features resulting from the
operation are inserted. Should not be null. See above the note
about the schema.options
- list of options (may be null).callback
- a callback function for reporting progress or null.public int Union(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options)
public int SymDifference(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options, ProgressCallback callback)
The result layer contains features whose geometries represent areas that are in either in the input layer or in the method layer but not in both. The features in the result layer have attributes from both input and method layers. For features which represent areas that are only in the input or in the method layer the respective attributes have undefined values. The schema of the result layer can be set by the user or, if it is empty, is initialized to contain all fields in the input and method layers.
If the schema of the result is set by user and contains fields that have the same name as a field in input and in method layer, then the attribute in the result feature will get the value from the feature of the method layer (even if it is undefined).
For best performance use the minimum amount of features in the method layer and copy it into a memory layer.
The recognized list of options is :
This method relies on GEOS support. Do not use unless the GEOS support is compiled in.
pLayerMethod
- the method layer. Should not be null.pLayerResult
- the layer where the features resulting from the
operation are inserted. Should not be null. See above the note
about the schema.options
- list of options (may be null).callback
- a callback function for reporting progress or null.public int SymDifference(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options)
public int SymDifference(Layer pLayerMethod, Layer pLayerResult)
public int Identity(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options, ProgressCallback callback)
The result layer contains features whose geometries represent areas that are in the input layer. The features in the result layer have attributes from both input and method layers. The schema of the result layer can be set by the user or, if it is empty, is initialized to contain all fields in input and method layers.
If the schema of the result is set by user and contains fields that have the same name as a field in input and in method layer, then the attribute in the result feature will get the value from the feature of the method layer (even if it is undefined).
For best performance use the minimum amount of features in the method layer and copy it into a memory layer.
The recognized list of options is :
This method relies on GEOS support. Do not use unless the GEOS support is compiled in.
pLayerMethod
- the method layer. Should not be null.pLayerResult
- the layer where the features resulting from the
operation are inserted. Should not be null. See above the note
about the schema.options
- list of options (may be null).callback
- a callback function for reporting progress or null.public int Identity(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options)
public int Identity(Layer pLayerMethod, Layer pLayerResult)
public int Update(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options, ProgressCallback callback)
The result layer contains features whose geometries represent areas that are either in the input layer or in the method layer. The features in the result layer have areas of the features of the method layer or those ares of the features of the input layer that are not covered by the method layer. The features of the result layer get their attributes from the input layer. The schema of the result layer can be set by the user or, if it is empty, is initialized to contain all fields in the input layer.
If the schema of the result is set by user and contains fields that have the same name as a field in the method layer, then the attribute in the result feature the originates from the method layer will get the value from the feature of the method layer.
For best performance use the minimum amount of features in the method layer and copy it into a memory layer.
The recognized list of options is :
This method relies on GEOS support. Do not use unless the GEOS support is compiled in.
pLayerMethod
- the method layer. Should not be null.pLayerResult
- the layer where the features resulting from the
operation are inserted. Should not be null. See above the note
about the schema.options
- list of options (may be null).callback
- a callback function for reporting progress or null.public int Update(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options)
public int Update(Layer pLayerMethod, Layer pLayerResult)
public int Clip(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options, ProgressCallback callback)
The result layer contains features whose geometries represent areas that are in the input layer and in the method layer. The features in the result layer have the (possibly clipped) areas of features in the input layer and the attributes from the same features. The schema of the result layer can be set by the user or, if it is empty, is initialized to contain all fields in the input layer.
For best performance use the minimum amount of features in the method layer and copy it into a memory layer.
The recognized list of options is :
This method relies on GEOS support. Do not use unless the GEOS support is compiled in.
pLayerMethod
- the method layer. Should not be null.pLayerResult
- the layer where the features resulting from the
operation are inserted. Should not be null. See above the note
about the schema.options
- list of options (may be null).callback
- a callback function for reporting progress or null.public int Clip(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options)
public int Clip(Layer pLayerMethod, Layer pLayerResult)
public int Erase(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options, ProgressCallback callback)
The result layer contains features whose geometries represent areas that are in the input layer but not in the method layer. The features in the result layer have attributes from the input layer. The schema of the result layer can be set by the user or, if it is empty, is initialized to contain all fields in the input layer.
For best performance use the minimum amount of features in the method layer and copy it into a memory layer.
The recognized list of options is :
This method relies on GEOS support. Do not use unless the GEOS support is compiled in.
pLayerMethod
- the method layer. Should not be null.pLayerResult
- the layer where the features resulting from the
operation are inserted. Should not be null. See above the note
about the schema.options
- list of options (may be null).callback
- a callback function for reporting progress or null.public int Erase(Layer pLayerMethod, Layer pLayerResult, java.util.Vector options)
public int Erase(Layer pLayerMethod, Layer pLayerResult)
public StyleTable GetStyleTable()
public void SetStyleTable(StyleTable table)