how to implement real time vehicle/asset tracking within the smallworld gis application
DESCRIPTION
How to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Application. Presented By: Mark Field Field Consulting and Services, Inc. Requirements. Need to quickly update graphics system. In the order of less then 1 second. - PowerPoint PPT PresentationTRANSCRIPT
How to Implement Real How to Implement Real Time Vehicle/Asset Time Vehicle/Asset Tracking within the Tracking within the Smallworld GIS Smallworld GIS ApplicationApplication
Presented By:Presented By:
Mark FieldMark Field
Field Consulting and Services, Inc.Field Consulting and Services, Inc.
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
22
RequirementsRequirements
Need to quickly update graphics Need to quickly update graphics system. system. – In the order of less then 1 second.In the order of less then 1 second.
Our requirement was to show Our requirement was to show 1000+ updatable entities,1000+ updatable entities,
Support selection of entities.Support selection of entities. Support multiple symbols Support multiple symbols
depending on type of entity.depending on type of entity.
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
33
Limitations with Limitations with Smallworld Core Spatial Smallworld Core Spatial Technology™Technology™
Slow refresh. Slow refresh. – Approximately 5 seconds to draw basic Approximately 5 seconds to draw basic
geometrygeometry– Approximately 10 seconds to draw with Approximately 10 seconds to draw with
rasters.rasters. Even refreshing just bounds of 1000+ Even refreshing just bounds of 1000+
entities would be slow.entities would be slow.– As well as distracting.As well as distracting.
Add-on geometry drawing is limited.Add-on geometry drawing is limited.– Must provide data to databus in Smallworld Must provide data to databus in Smallworld
Core Spatial Technology (CST) 4 Core Spatial Technology (CST) 4 with :geometry_to_draw or :post_render_setswith :geometry_to_draw or :post_render_sets
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
44
FCSI Solution FCSI Solution OverviewOverview
Basic idea: DOUBLE BUFFERINGBasic idea: DOUBLE BUFFERING– Real time technique to draw data in Real time technique to draw data in
memory, and ‘pop’ the frame to the memory, and ‘pop’ the frame to the view.view.
– Prevents the noticeable drawing of Prevents the noticeable drawing of individual features, which contribute individual features, which contribute to “flickering.”to “flickering.”
Double Buffering ExampleDouble Buffering Example
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
55
FCSI Solution FCSI Solution OverviewOverview
Use a memory canvas to record Use a memory canvas to record what has been drawn by the GIS.what has been drawn by the GIS.
Store the base memory canvas.Store the base memory canvas. Draw the vehicle positions on a Draw the vehicle positions on a
copy of the memory canvas.copy of the memory canvas. Display the modified memory Display the modified memory
canvas to the usercanvas to the user Exemplar: fcsi_fast_displayExemplar: fcsi_fast_display
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
66
Canvas CopyingCanvas Copying
SWAF canvas after refresh is
complete
Copy canvas to memory_canvas
Draw Geometries on memory_canvas
Replace modified memory_canvas
to SWAF canvas
Update loop
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
77
Memory Canvas Memory Canvas DetailsDetails
Need to know when refresh is started.Need to know when refresh is started.– For pre-CST 4: dependency of graphics system, (:start_refresh)For pre-CST 4: dependency of graphics system, (:start_refresh)– For CST 4: databus, (:fcsi_start_refresh) For CST 4: databus, (:fcsi_start_refresh)
Need to know when the drawing is complete.Need to know when the drawing is complete.– For pre-CST 4: dependency of graphics system, (refreshed)For pre-CST 4: dependency of graphics system, (refreshed)– For CST 4: databus, (: fcsi_end_refresh)For CST 4: databus, (: fcsi_end_refresh)
post_render_sets doesn’t truly workpost_render_sets doesn’t truly work Store the window to a memory canvas using Store the window to a memory canvas using
fcsi_reset_memory_canvas()fcsi_reset_memory_canvas()– Uses memory_canvas.copy_area() Uses memory_canvas.copy_area()
Draw vehicle geometry on the memory canvas with Draw vehicle geometry on the memory canvas with fcsi_draw_geoms()fcsi_draw_geoms()
– Uses memory_canvas.draw()Uses memory_canvas.draw() Copy the memory canvas data to the graphics view canvas.Copy the memory canvas data to the graphics view canvas.
– Uses memory_canvas.copy_area()Uses memory_canvas.copy_area()
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
88
Geometry DetailsGeometry Details
Dynamic Geometry is stored in .fcsi_geomsDynamic Geometry is stored in .fcsi_geoms Styles for dynamic geometry stored in .fcsi_styles.Styles for dynamic geometry stored in .fcsi_styles.
– .fcsi_geoms[n] uses .fcsi_styles[n] style.fcsi_geoms[n] uses .fcsi_styles[n] style Need to get handles to symbology.Need to get handles to symbology.
– Get handle to a symbol from the style system, orGet handle to a symbol from the style system, or– Create symbol, or Create symbol, or – For point symbols, can be basic sector data with line For point symbols, can be basic sector data with line
style that can be used as a point symbol.style that can be used as a point symbol. Loop over the geometry you want to draw and use Loop over the geometry you want to draw and use
memory_canvas.draw() with style.memory_canvas.draw() with style. Any geometry and style can be drawn, points, Any geometry and style can be drawn, points,
lines, areas, etc.lines, areas, etc.
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
99
Example Display Example Display DetailsDetails
fcsi_pvd_menu exemplarfcsi_pvd_menu exemplar– Simple example of fcsi_fast_display.Simple example of fcsi_fast_display.– Creates/stores routes from node to nodeCreates/stores routes from node to node– Allows you to select a dynamic geometryAllows you to select a dynamic geometry
Open GUI:Open GUI:– fcsi_pvd_menu.open(grs) orfcsi_pvd_menu.open(grs) or– fcsi_pvd_menu.open(appl)fcsi_pvd_menu.open(appl)
Set ManifoldSet Manifold– Select geometrySelect geometry– Set ManifoldSet Manifold
Interactively create routes using trail.Interactively create routes using trail.– Create 2 point trail identifying start and end nodes for Create 2 point trail identifying start and end nodes for
route.route.– Or randomly create routes using trail boundsOr randomly create routes using trail bounds
Use fcsi_get_test_paths(num)Use fcsi_get_test_paths(num)
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
1010
Example Display Example Display Details (cont.)Details (cont.)
Set Delay (milliseconds)Set Delay (milliseconds) Run.Run.
– The engine loop calculates new coordinate The engine loop calculates new coordinate along route by 5m.along route by 5m.
– Updates the .fcsi_geoms slot with new Updates the .fcsi_geoms slot with new coordinates.coordinates.
– Calls fast_display.fcsi_update_view().Calls fast_display.fcsi_update_view().– Sleeps for the given delay.Sleeps for the given delay.
Select dynamic geometry.Select dynamic geometry.– Pauses engine loop.Pauses engine loop.– Selects closest coordinate in .fcsi_geoms Selects closest coordinate in .fcsi_geoms
list.list.
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
1111
Extending Extending ImplementationImplementation
Can realistically be any process, internal or Can realistically be any process, internal or external (ACP).external (ACP).
Example code moves the current location 5m Example code moves the current location 5m down trace result, but can be any type of data.down trace result, but can be any type of data.
Future UpdatesFuture Updates– Pause when panning/zooming Pause when panning/zooming
Would need dependency of “current_state” of the Would need dependency of “current_state” of the application.application.
– After new selection – recreate base memory canvasAfter new selection – recreate base memory canvas Contact FCSIContact FCSI
– [email protected]@field-csi.com – 407-275-9351407-275-9351
How to Implement Real Time Vehicle/AssetHow to Implement Real Time Vehicle/Asset Tracking within the Smallworld GIS Applic Tracking within the Smallworld GIS Applicationation
1212
DemonstrationDemonstration
This demonstration will show 1000 entities.This demonstration will show 1000 entities. There are 1000 paths that have been There are 1000 paths that have been
randomly generated.randomly generated.– 1 path for 1 entity1 path for 1 entity
Each iteration of the main loop:Each iteration of the main loop:– Updates the position of each entity by 10 meters Updates the position of each entity by 10 meters
along each path.along each path.– Stores updated coordinate and distance in ropesStores updated coordinate and distance in ropes– At end of all updates, display resultsAt end of all updates, display results
The road works symbol is a basic X from the The road works symbol is a basic X from the style system.style system.
Simple selection of entity will report it’s ID Simple selection of entity will report it’s ID (position in rope).(position in rope).