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 PostgreSQL and FME Server to respond to single feature database edits.
NOTE: This example was created to demonstrate different interaction possibilities between FME Server and PostgreSQL/PostGIS.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,PostgreSQL 9.6,and Python 2.7.
In this example we use a simple web interface that calls FME Server to upload data and log updates in a PostgreSQL database.The sequence of events when a user runs the demo from the web interface is as follows:
This example shows how to setup PostgreSQL triggers that can call an FME Server workspace 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 a bulk insert trigger would be more appropriate.We recommend you read the scripts carefully to ensure you have fully tailored them to your database environment.
In order to make HTTP requests from a database function in PostgreSQL,you will need to install Python on your system,and enable PL/Python in your PostgreSQL installation.
In a Windows environment,
to install PL/Python in a particular database,use CREATE EXTENSION plpythonu,or from the shell command line use createlang plpythonudbname
Your environment may have different requirements.Please see thePostgreSQL documentationfor more information on PL/Python and PostgreSQL.
The included SQL script,postgis_single.sql,performs the following steps:
This script can be run via pgAdmin or a similar tool.Please review it carefully to ensure it is configured correctly for your system.Your FME Server URL will need to be specified,along with the repository to which you will be publishing the workspaces.
This article includes two workspaces:postgis_single_loader.fmwtandpostgis_single_logger.fmw.The first is called directly from the sample web page - it loads data into the database.The database trigger is fired on every INSERT,UPDATE or DELETE,and runs the logger workspace,which logs object IDs and geometries to a Google Fusion Table.
Open thepostgis_single_loader.fmwtworkspace.
Edit the Postgis writer database parameters to match your own database credentials.
Publish the workspace to the logger repository.Make sure to publish the sample datasets along with the loader workspace.
Next,open thepostgis_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.
Run the workspace once with the Creator_2 transformer to create the Google Fusion table.Then disable Creator_2 and enable the Creator transformer.
Publish the workspace to the logger repository.
Finally,ensure that the workspaces can be run anonymously.This means that the fmeguest role must have permissions to run the workspaces,and be set up as the default user in the web apps.(This is the default configuration).Make sure the fmeguest role has Read and Run permissions for the logger repository.
In the attached "web" directory,index.html must be configured with your server URL and repository.Additionally,you will need to enter the URL for your Google Fusion table (to view the table,log in to the Gmail account provided and the table should appear under the ‘Drive' Tab).
Open index.html in a web browser,and go through the steps presented.When you view the Google Fusion Table,you should see a list of transactions,and the associated geometry.
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
Bulk Edits Oracle: Push data from your database to your application in real-time
Bulk Edits SQL Server: Push data from your database to your application in real-time
Intro to Notification Service: Receiving,Inspecting and Processing Notification Messages
Subscribe,Report and Notify: 2.Spatial Business Rules
Bulk Edits PostgreSQL: Push data from your database to your application in real-time
Subscribe,Report and Notify Tutorial - 2.Spatial Business Rules (2014)
© 2019 亚搏在线Safe Software Inc |Legal