![]() |
NAVTOR SDK
v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
|
Admiralty Total Tide (ATT) - Provides tidal height and stream predictions worldwide.
SDK total tide component provides tidal information based on the Admiralty Total Tide database.
It gives access to more than 7000 ports and 3000 tidal stream stations available in ATT and allows making tidal height and stream predictions for them.
Admiralty Total Tide works only on Windows.To be able to use Admiralty Total Tide functionality, make sure the Admiralty Total Tide application is installed on your computer and the license is activated.
Within Admiralty Total Tide there are several different types of Ports. These ports differ in the methods that are used for collecting and predicting the tidal information for them.
= These are ports where the tidal predictions are calculated from a set of harmonic constants. They can be used as the source of information for non-harmonic secondary ports in which case they are referred to as the reference port.
= These ports also have an associated set of harmonic constants from which to calculate the tidal predictions. However, the observations made to collect this information generally were not as extensive as with standard ports and so the tidal predictions are of secondary quality.
- These ports do not have any harmonic constants, instead their tidal predictions are calculated by taking the prediction for a reference port and applying time and height differences.There are two different types of stream represented within Admiralty Total Tide. A stream can be either harmonic or non-harmonic.
Harmonic and non-harmonic streams are shown in the chart view with the same symbol
without indication of their types.
The SDK provides access to the Total tide database through the kTotalTideWorkspaceFactoryCID component. You can obtain all information on ports and stream stations using standard data object interfaces (IWorkspace, IDataset, IFeature, IAttribute, and so on). All objects are grouped in a single dataset.
Below is a sample of how to open the database (from the total_tide_demo sample):
sdk::ISDKComponentSP tt_wks_factory_obj;
SDKCreateComponentInstance(NULL, kTotalTideWorkspaceFactoryCID, &tt_wks_factory_obj);
sdk::gdb::IWorkspaceFactorySP tt_wks_factory =
tt_wks_factory_obj.GetInterface();
sdk::gdb::IWorkspaceSP tt_wks;
tt_wks_factory->Open(NULL, &tt_wks);
To obtain other information, use the same procedures as when working with a regular chart database.
To display objects from the tides database on the screen, just add the database to the SceneManager.
Below is a sample of how to add tides to the display in a separate layer (from the total_tide_demo sample):
sdk::vis::IPortrayalLayerSP tt_portrayal_layer;
portrayal_manager->CreatePortrayalLayer(
sdk::SDKStringHandler(L"tt_portrayal_layer"), tt_portrayal_layer);
sdk::SizeF scene_size(1, 1); // Scene is resized to the window extent on first resize
sdk::vis::ISceneLayerSP tt_scene_layer;
layers_manager->CreateLayer(
sdk::SDKStringHandler(L"tt_scene_layer"), priority, sdk::PointF2D(0, 0), scene_size,
sdk::vis::kSceneLayerFlag_Charts, sdk::ScopedString(L"tt_portrayal_layer"), sdk::ScopedString(L""),
sdk::ScopedAny(sdk::vis::kSceneLayerRenderer_Chart), tt_scene_layer, NULL);
layers_manager->AddLayer(tt_scene_layer, sdk::vis::kSceneLayerID_Undefined);
sdk::vis::IDataSourceViewSP datasource_view;
sdk::vis::DataSourceViewID source_id = sdk::vis::kDataSourceViewID_Unknown;
scene_manager->AddDataSourceView(sdk::ScopedAny(tt_wks), sdk::ScopedString(L"tt"),
sdk::vis::kAddDataSourceFlag_ReplaceView, &datasource_view, &source_id);
adp_portrayal_layer->AddDataSourceView(source_id);
To obtain up-to-date data, specify required time:
sdk::gdb::IQueryParametersSP tt_params;
wks_factory_util->CreateQueryParameters(&tt_params);
SDKTime time_start = MakeTime(2016, 4, 3, 12, 0, 0, 0);
tt_params->SetParameter(sdk::gdb::kGetFeaturesParameter_Tides_DateStart, sdk::ScopedAny(time_start));
datasource_view->SetFeatureQueryFilter(tt_params);
Objects from the tides database are filtered by scale to avoid cluttering the chart.
Ports are displayed beginning with the scale of 1:12 000 000; stream stations are displayed beginning with the scale of 1:1 500 000.
To obtain full information about tides, you should set up database query parameters. Specify the station and time period for which you need the data.
Below is a sample of how to set up query parameters (from the total_tide_demo sample):
sdk::ScopedAny tt_foid;
feature->GetFOID(tt_foid);
sdk::gdb::IQueryParametersSP tt_params;
wks_factory_utils->CreateQueryParameters(&tt_params);
tt_params->SetParameter(
sdk::gdb::kGetFeaturesParameter_IncludeFOIDs, tt_foid);
tt_params->SetParameter(
sdk::gdb::kGetFeaturesParameter_Tides_DateStart, sdk::ScopedAny(time_start));
tt_params->SetParameter(
sdk::gdb::kGetFeaturesParameter_Tides_DateEnd, sdk::ScopedAny(time_end));
sdk::gdb::IEnumFeatureSP enum_predictions;
tt_dataset->GetFeatures(NULL, tt_params, NULL, &enum_predictions));
If you request information for a port, you will receive a list of tidal heights for the specified period, as well as High Water/Low Water values, and so on. That is, the result of the request is an iterator of objects where each object is one of the following:
If you request information for a stream station, you will receive a list of the stream's directions and rates for each minute within the specified period.