A Transactional WFS (WFS-T) is a WFS service that allows features to be created, changed, replaced and deleted from the underlying data store. It introduces the following requests:
-
A
Transaction
request to insert, update and delete features for a given WFS feature type -
A
LockFeature
request to lock features and enforce exclusive access to modify or delete them -
A
GetFeatureWithLock
request to request and lock features at the same time
To set up a WFS-T in LuciadFusion, you need to enable transactions for your WFS service, either through the UI or through
the REST API.
LuciadFusion has out-of-the-box support for WFS-T for data stored in a TLcdDatabaseModel
.
This includes vector data decoded from Microsoft SQL Server, DB2 Spatial, Informix (Geodetic and Spatial), Oracle (Locator
and Spatial), PostgreSQL PostGIS, SQLite SpatiaLite and GeoPackage.
You can add other data formats by plugging in your own ILcdWFSServerModelEncoderFactory
.
To plug in a WFS server model encoder factory, you register it with the service loader using the @LcdService
annotation. You don’t have to specify a priority in the LcdService
. By default, your custom WFS server model encoder factory already has a higher priority than the pre-configured WFS server
model encoder factory.
For more information about the services mechanism, see Working with the services mechanism.
The sample code includes an example of a custom WFS server model encoder factory that adds support for JSON data items.
package samples.fusion.wfs;
import com.luciad.format.geojson.TLcdGeoJsonModelDescriptor;
import com.luciad.format.geojson.TLcdGeoJsonModelEncoder;
import com.luciad.model.ILcdModel;
import com.luciad.model.ILcdModelEncoder;
import com.luciad.ogc.wfs.ILcdWFSServerModelEncoderFactory;
import com.luciad.util.service.LcdService;
@LcdService(service = ILcdWFSServerModelEncoderFactory.class)
public class WFSGeoJSONServerModelEncoderFactory implements ILcdWFSServerModelEncoderFactory {
@Override
public ILcdModelEncoder createModelEncoder(ILcdModel aModel) {
if (aModel.getModelDescriptor() instanceof TLcdGeoJsonModelDescriptor) {
return new TLcdGeoJsonModelEncoder();
}
return null;
}
}