Hexagon Geospatial
MENU

Developers Knowledge Base

Mobile and field solutions function as an extension of the overall enterprise, and include the ability to access, create, review and update geospatial data and asset information in real-time in the field.
Showing results for 
Search instead for 
Do you mean 

On demand synchronization

by Technical Evangelist on ‎08-17-2017 07:18 AM (770 Views)

How it works?

On demand synchronization works in two directions:

  • application -> remote source
  • remote source -> application

Application is able to download the latest data snapshot and to send local changes to a remote source.
Currently the application supports two remote source types: WFS-T and WMS. WMS synchronization works with raster data and only in one direction; download data. WFS-T synchronization works with vector data and in two directions; download and upload. Synchronization works also with feature sources that have blob attributes configured.

 

System overview

Synchronization system is composed of three main elements: Mobile MapWorks Advantage application, Synchronization Service and remote source (WMS, WFS-T).

 

Graphic below shows how those three components communicate:

sync.png

 

In order to get the latest data, the application downloads data as geopackage database using the Synchronization Service. The Synchronization Service communicates with remote source to get the requested data, creates geopackage database and returns it back to the application.All user changes from the application are directly synchronized with remote source (WFS-T), without use of synchronization service.

 

In order to get the system running you must:

  • deploy the Synchronization Service
  • prepare Configuration
  • use the configuration with MMW Advantage application

 

Synchronization Service

How to deploy synchronization service

Synchronization service is used to generate geopackage. MMW communicate with service to download snapshot of data.

 

Service restriction:

  • Support only for EPSG:3857
  • Support only for WFS 1.1.0
  • Support only for WMS 1.3.0
  • Can generate only one raster in one geopackage

Configuration

To use synchronization in your application you must add 'synchronization' section to your configuration and add at least one synchronization definition. Synchronization section is an array of synchronization definitions. 
Synchronization definition must contain:

 

  • id
  • localFsd - local feature source definition id. Local feature source description must be defined in feature source description section.
  • remoteFsd - remote source definition id. Remote feature source description must be defined in feature source description section.
  • service - id of synchronization service definition. Service definition must be defined in service section.
  • mode - defines synchronization policy. Supported values: once and continuous. If once mode is set then data will be downloaded only once. Mode continuous allow to download data each time synchronization start. This parameter is optional. Default value is continuous.
  • options - synchronization options. It is object that must contains fields: outputCrs, bbox, zoomLevel 
    - outputCrs - output crs as string e.g. EPSG:3857
    - bbox - an array of bbox coordinates
    - zoomLevel - max zoom level as string

e.g.

 

"synchronization": [
        {
		"id": "hydrantSync",
		"localFsd": "hydrantDbBlobFsdId",
		"remoteFsd": "hydrantWfsFsdId",
		"service": "syncServiceId",
		"mode": "once",
		"options": {
			"outputCrs": "EPSG:3857",
			"bbox": [
				"-9368962.993942337",
				"3955864.6340997987",
				"-9367355.427691216",
				"3957598.799179017"
			],
			"zoomLevel": "18"
		}
	}
]

 

Sample sync service configuration

{
        "id": "syncServiceId",
        "name": "syncService",
        "type": "syncService",
        "url": "http://111.111.111.111/syncservice"
}

 

  • Note:
    If local source have configured blob attributes then localFsd must be id of blob feature source definition that point on local feature source definition to synchronize.

Basic configuration with one vector that can be synchronized

Configuration with raster and vector offline sources that can be synchronized

Application

Download data

To download latest snapshot of data tap on synchronization data button. After tap, application will download latest snapshot of data defined in configuration.

 

Upload changes

To synchronize your local changes with remote source tap synchronize data button. Application will send changes to the server and after that it will download latest snapshot of data to the device.

 

Synchronization indicator/button

Synchronization button inform about actual state of synchronization.

buttondown.png

buttonup.png

 

 

 

 

 

 

 

Button with arrow down inform that all outgoing changes are synchronize and only new data snapshot can be downloaded.

Button with arrow up inform that local changes are made and application is ready to synchronize them with remote source.

 

Map with synchronization button and no data:

sync0.png

 

Synchronization in progress:

sync.3png.png

 

Synchronization finished:

sync4png.png

 

Overview