span8
span4
span8
span4
As announced by Google on December 11,2018, Google Fusion Tables and the Fusion Tables API will be turned off on December 3,2019.Some users may start to see errors in August 2019.Fusion Tables support will be removed from FME after the service has been shut down.For ways to migrate your data out of Google Fusion Tables using FME,see the blog post 7+ Google Fusion Tables Alternatives.
FME Server can respond to database events in real time by making use of external database triggers.This allows you to push data in real-time from your database into applications using FME Server.In this article,we show you how to setup SQL Server and FME Server to respond to single feature database edits.If a large number of edits are being made,a bulk insert can also be set to push out large quantities of data with a single call,this is described in the following article:Bulk Edits SQL Server: Push data from your database to your application in real-time
NOTE: This example was created to demonstrate different interaction possibilities between FME Server and SQL Server.This article contains several code snippets which must be customized for particular environments.
This tutorial was tested with FME Desktop and FME Server 2017.0 and SQL Server 2016.
In this example we use a simple web interface that calls FME Server to upload data and log updates in an SQL Server database.The sequence of events when a user runs the demo from the web interface is as follows:
This example shows how to setup SQL Server triggers that can call a workspace on FME Server using an HTTP request.This method should only be used if not many rows are expected to be modified at the same time;for large numbers of concurrent modifications the bulk insert trigger example would be more appropriate.We recommend you read the scripts carefully to you ensure you have fully tailored them to your database environment.
We need to create a new table in our database and set triggers for inserts,updates,and deletes on all rows.We also need to add a procedure to the database that allows access to your FME Server using HTTP.This can be done by running Create_Table_and_Triggers.sql.Some modifications to the SQL script need to be made as indicated in the comments and in the following images.
This demo involves one template and one workspace:sqlserver_single_loader.fmwtandsqlserver_single_logger.fmw,which are included in the zip file attached above.
Open thesqlserver_single_loader.fmwtworkspace.
Edit the SQL Server writer to match your own database credentials.
Publish the workspace to FME Server,in a new repository called trigger.
Next,open thesqlserver_single_logger.fmwworkspace.
Open the Google Fusion Table writer.
Click the ellipsis (...) for the Refresh Token parameter.
You will be asked to sign into your Gmail account and allow FME to manage your Fusion Tables.Click Allow to create a Fusion Tables OAuth refresh key.
Publish the workspace to FME Server in the trigger repository.
Make sure the 'fmeguest' role has Read and Run permissions on the trigger repository.This can be set by logging into FME Server as the admin user and clicking Security on the left sidebar under Admin,clicking Roles,and selecting fmeguest.Under Permissions,expand the Repositories section and for the trigger repository select Read and Run if they are not already selected.
Run the sqlserver_single_logger workspace once either from FME Server or FME Desktop to create the Google Fusion Table (to view the table,log in to the Gmail account specified and the table should appear under the ‘Drive' Tab) make note of the table's URL for the next step.
Copy the entire contents of the "web" folder included in the zip file to a web server.Then edit the contents of the index.html file to include the name of your FME Server and the URL of the Google Fusion Table.
Once this is complete,open index.html in a web browser and run one of the options,this should modify the data in the SQL Server Database triggering information to be written to the Google Fusion Table.You can click on the link on the web page to open the table.
Bulk Edits SQL Server: Push data from your database to your application in real-time
Bulk Edits PostgreSQL: Push data from your database to your application in real-time
Data Upload,Validation,and Real-time Display
HTTP POST Requests to FME Server from Node.js
Streaming features from PostGIS to FME using WebSockets
Streaming features from PostGIS to Amazon SQS - Process in FME
Sending email,Part 4: Sending prettier email using HTML (2015)
Receiving email,Part 2: Processing email with a workspace (2015)
Bulk Edits Oracle: Push data from your database to your application in real-time
Sending email,Part 1: Setting up a topic and an email subscriber (2015)
© 2019 亚搏在线Safe Software Inc |Legal