Skip to main content

Suggest an Idea

Vote for your favorite Qlik product ideas and add your own suggestions.

Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW

GeoAnalytics: Improve "NamedPointLookup" functionalities in order obtain a sufficient quality of detection & search

Joseph_Musekura
Support
Support

GeoAnalytics: Improve "NamedPointLookup" functionalities in order obtain a sufficient quality of detection & search

When using "NamedPointLookup" , all entries in the location database get matches for alternative spellings from geonames.org

However, if a city has dashes in its name like 'La Roche-sur-Yon' or space like "La Roche sur Yon", NamedPointLookup does not often return a correct result.

Workaround exists like  https://support.qlik.com/articles/000060042  and https://community.qlik.com/t5/Qlik-GeoAnalytics-Documents/How-to-improve-the-lookup-accuracy/ta-p/15...

But  we cannot modify the data entered by users into data sources and it is not possible to modify the script every day when a new data source about a city name is not exactly what "NamedPointLookup" expected to detect the GPS coordinates.

Thus, I suggest an improvement of "NamedPointLookup" to detect at least a space or dash character entered into a city name. (for example), thus obtain a sufficient quality of detection of city's GPS coordinates,

2 Comments
Florent
Partner - Contributor II
Partner - Contributor II

View attached file for this improvment idea :

https://community.qlik.com/t5/Ideas/GeoAnalytics-Improve-quot-NamedPointLookup-quot-functionalities/...

exemple.png

Script used :

CityDetection:
LOAD * INLINE [
Id, CityCountryName
1, "La Roche-sur-Yon,FR"
2,  "La Roche sur Yon,FR"
3, "Saint-Gilles-Croix-de-Vie,FR"
4, "Saint-Gilles Croix de Vie,FR"
5, "La Rochelle,FR"
6, "La  Rochelle,FR"
];

LIB CONNECT TO 'GeoAnalyticsPlusCloud';

/* Generated by GeoAnalytics for operation NamedPointLookup ---------------------- */
[_inlineMap_]:
mapping LOAD * inline [
_char_, _utf_
"'", '\u0027'
'"', '\u0022'
"[", '\u005b'
"/", '\u002f'
"*", '\u002a'
";", '\u003b'
"}", '\u007d'
"{", '\u007b'
"`", '\u0060'
"´", '\u00b4'
"	", '\u0009'
];

IF FieldNumber('Id', 'CityDetection') = 0 THEN
	call InvalidInlineData('The field Id in CityDetection is not available');
END IF
IF FieldNumber('CityCountryName', 'CityDetection') = 0 THEN
	call InvalidInlineData('The field CityCountryName in CityDetection is not available');
END IF
Let [CityDetectionInlineTable] = 'Id' & Chr(9) & 'CityCountryName';
Let numRows = NoOfRows('CityDetection');
Let chunkSize = 1000;
Let chunks = numRows/chunkSize;
For n = 0 to chunks
	Let chunkText = '';
	Let chunk = n*chunkSize;
	For i = 0 To chunkSize-1
		Let row = '';
		Let rowNr = chunk+i;
		Exit for when rowNr >= numRows;
		For Each f In 'Id', 'CityCountryName'
			row = row & Chr(9) & MapSubString('_inlineMap_', Peek('$(f)', $(rowNr), 'CityDetection'));
		Next
		chunkText = chunkText & Chr(10) & Mid('$(row)', 2);
	Next
	[CityDetectionInlineTable] = [CityDetectionInlineTable] & chunkText;
Next
chunkText=''


[LookupResult]:
SQL SELECT [CityCountryName], [CityDetection_Geometry], [CityDetection_Name], [CountryIso2] FROM NamedPointLookup(nameField='CityCountryName', type='P*', country='', nameTable='CityDetection')
DATASOURCE CityDetection INLINE tableName='CityDetection', tableFields='Id,CityCountryName', geometryType='NONE', loadDistinct='NO', suffix='', crs='Auto' {$(CityDetectionInlineTable)}
;
tag field [CityCountryName] with '$primarykey';
tag field [CityDetection_Geometry] with '$geopoint';
tag field [CityCountryName] with '$geoname';
tag field [CityDetection_Geometry] with '$relates_CityCountryName';
tag field [CityCountryName] with '$relates_CityDetection_Geometry';

[CityDetectionInlineTable] = '';
/* End GeoAnalytics operation NamedPointLookup ----------------------------------- */

LEFT JOIN(CityDetection)
LOAD *
RESIDENT [LookupResult];

DROP TABLE [LookupResult];

 

 

 

Meghann_MacDonald

Hi team, I noticed this was submitted twice, we have to close 1 as a duplicate. Please add likes and comments to the first post here: https://community.qlik.com/t5/Ideas/GeoAnalytics-Improve-quot-NamedPointLookup-quot-functionalities/...

Meghann

Status changed to: Closed - Duplicate