Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
JonathanKelly
Contributor III
Contributor III

Search by map/coordinates

Hi,

This may not be possible however, is it possible if I have a list of roads and postal codes(Zip codes) linked with global coordinates to setup a page whereby you can search for coordinates and it would return all roads within a set mile radius e.g. 1 mile?

I could have just a postal code search however I've found that either side of a road could have a different postal code.

I don't want to have a road name search e.g. high street would bring back 1000s of results. You would need a multitude of filters

With the coordinates you could input latitude and longitude and then a range of roads would appear 

 

 

Labels (5)
2 Replies
KGalloway
Creator II
Creator II

Could you try creating a table with dimension = if(distancebetween(RoadCoordinates, InputCoordinates) < 1, RoadName) and then unchecking Include null values?

The distancebetween function would need to be some variation of 

atan2(sqrt(sqr(cos(RoadLat*pi()/180)*sin(RoadLong*pi()/180-DestLongitude*pi()/180))
+sqr(cos(InputLat *pi()/180)*sin(RoadLat*pi()/180)-sin(InputLat *pi()/180)*cos(RoadLat*pi()/180)
*cos(RoadLong*pi()/180 -InputLong*pi()/180))),sin(InputLat *pi()/180)*sin(RoadLat*pi()/180)
+cos(InputLat *pi()/180)*cos(RoadLat*pi()/180)*cos(RoadLong*pi()/180 -InputLong*pi()/180))*6371

since this outputs kilometers.

Also, InputLat and InputLong would likely need to be variables that could be changed by the user in input objects.

Could you share a sample of the data?

JonathanKelly
Contributor III
Contributor III
Author

I've put together some sample data to protect clients and hopefully this helps.

Building Number Street Town Postcode
1 HILL LANE LONDON S1 3AB
2 HILL LANE LONDON S1 3AB
3 HILL LANE LONDON S1 3AB
4 HILL LANE LONDON S1 3AB
5 HILL LANE LONDON S1 3AB
1 WHEEL LANE LONDON S1 3AC
2 WHEEL LANE LONDON S1 3AC
3 WHEEL LANE LONDON S1 3AC
4 WHEEL LANE LONDON S1 3AC
5 WHEEL LANE LONDON S1 3AC
1 PLUMBER CLOSE LONDON S1 3AF
2 PLUMBER CLOSE LONDON S1 3AF
3 PLUMBER CLOSE LONDON S1 3AF
4 PLUMBER CLOSE LONDON S1 3AF
5 PLUMBER CLOSE LONDON S1 3AF
1 MANS ROAD LONDON S1 3BC
2 MANS ROAD LONDON S1 3BC
3 MANS ROAD LONDON S1 3BC
4 MANS ROAD LONDON S1 3BC
5 MANS ROAD LONDON S1 3BC

Those are an example of addresses, if my coordinates put me at latitude 52.579171, longitude 3.4699609, all of the addresses fall within a range of that. 

I was hoping to input those coordinates and it'll return those addresses because they are all within a 1/2 mile range.

I will try the formula you sent and see, I wasn't sure if it was possible in the first place as Lat and Long will be inputted variables and then the radius search would be an inputted variable