Classes | Functions | Variables
InverseGeoCoding: Inverse geocode mercator coordinates to an address string

Classes

struct  RI_CInverseGeoCoding
 Data structure for the Request "InverseGeoCoding". More...
 

Functions

LRESULT RI_InverseGeoCoding_ReadData (LPARAM, RI_CInverseGeoCoding &)
 Read data from shared memory for "Inverse GeoCoding".
 
LRESULT RI_InverseGeoCoding_WriteData (LPARAM, RI_CInverseGeoCoding &)
 Write data to shared memory for "Inverse GeoCoding".
 

Variables

const UINT RI_MESSAGE_INVERSEGEOCODING = RegisterWindowMessage(TEXT("RI_MESSAGE_INVERSEGEOCODING"))
 

Detailed Description

Variable Documentation

const UINT RI_MESSAGE_INVERSEGEOCODING = RegisterWindowMessage(TEXT("RI_MESSAGE_INVERSEGEOCODING"))

Message ID for the Request "inverse geocoding":
RI_MESSAGE_INVERSEGEOCODING

Write Memory:

RI_InverseGeoCoding_WriteData(LPARAM id, RI_CInverseGeoCoding data );

Read Memory:

RI_InverseGeoCoding_ReadData(LPARAM id, RI_CInverseGeoCoding data );

Return Values for InverseGeoCoding:

RI_NOERROR = Inverse GeoCoding succeeded.
RI_NOTADDED = Inverse GeoCoding not succeeded, because address not found in map.

Description:

Returns an address string for a given mercator pos.
The output is given as a formatted string like the following:
D,76131,Karlsruhe,Tullastrasse,1-11|2-20
The housenumber will be given as ranges separated by the pipe '|' symbol. A range of 0-0 means no housenumber found for this side of the segment. The different ranges will always be sorted from lower to upper.

Returns a single package

Example:

#define USE_LOADLIBRARY
#include "TNSRemoteInterfaceDll.h"
LPARAM GetUniqueID()
{
//generate unique ID
static LPARAM id = 0;
if (++id == 0) ++id; // do not use 0 !!!!!
return id;
}
inline LRESULT RI_MESSAGE( const UINT request, HWND h_client, LPARAM id )
{
//check if RI handle is valid
if ( !IsWindow( RI_GetTNS() ) )
// send the request
PostMessage( RI_GetTNS(), request, WPARAM(h_client), id );
return RI_NOERROR;
}
LRESULT CDlgMFC_InverseGeoCoding::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
if ( message == RI_MESSAGE_INVERSEGEOCODING )
{
if ( (LRESULT)wParam == RI_NOERROR )
{
//Read Data from shared memory
LRESULT read_suc = RI_InverseGeoCoding_ReadData( lParam, data );
//Inverse GeoCoding succeeded. errorcode (0)
TRACE(TEXT("Result Address: %s" ),data.m_address);
AppendStatusText( TEXT("\r\n") );
}
else if ( (LRESULT)wParam == RI_NOTADDED )
//Inverse GeoCoding not succeeded, because Address not found in map. errorcode (11)
}
return CDialog::WindowProc( message, wParam, lParam );
}
void CDlgMFC_InverseGeoCoding::foo()
{
//define struct
data.m_mercator_x = 937170;
data.m_mercator_y = 6270165;
// *** write data in the Shared memory***
LPARAM id = GetUniqueID();
LRESULT sharing_ret = RI_InverseGeoCoding_WriteData( id, data );
if ( sharing_ret != RI_NOERROR )
return;
if ( RI_MESSAGE( RI_MESSAGE_INVERSEGEOCODING, GetSafeHwnd(), id ) == RI_NOERROR )
//message sending succeeded
else
//navigation software not running
}

© PTV Group 2020 Generated on Wed Apr 15 2020 12:47:52 for by doxygen 1.8.8