import pandas as pd
import matplotlib.pyplot as plt
import datetime
import numpy as np
%matplotlib inline
import seaborn as sns
import urllib
from urllib.parse import unquote
#import validators
 
data = pd.read_json(path_or_buf = 'data_kerala_1125-1708.json', lines = False, encoding = 'utf-8', orient = "records")
data.head()
dateadded detailcloth detailfood detailkit_util detailmed detailrescue detailtoilet detailwater district id ... needkit_util needmed needothers needrescue needtoilet needwater requestee requestee_phone status supply_details
0 2018-08-16T09:17:58.895Z ekm 6765 ... False False Rescue from water filled house False False False Sreeram 094470581 new
1 2018-08-16T09:21:22.609Z idk 6794 ... False False False False False Test Test new
2 2018-08-16T09:19:14.170Z idk 6775 ... False False False False False Vellachamy 9947009803 new
3 2018-08-16T09:19:24.604Z ekm 6777 ... False False Boat False False False Sebin 9544117226 new
4 2018-08-16T09:23:44.005Z ptm 6803 ... False False Rescue required False False False Abraham George 9744064073 new

5 rows × 26 columns

data.columns
Index(['dateadded', 'detailcloth', 'detailfood', 'detailkit_util', 'detailmed',
       'detailrescue', 'detailtoilet', 'detailwater', 'district', 'id',
       'is_request_for_others', 'latlng', 'latlng_accuracy', 'location',
       'needcloth', 'needfood', 'needkit_util', 'needmed', 'needothers',
       'needrescue', 'needtoilet', 'needwater', 'requestee', 'requestee_phone',
       'status', 'supply_details'],
      dtype='object')

What was already analysed

(Copied from: https://github.com/IEEEKeralaSection/rescuekerala/issues/240 to know what does not need to be done)

  • Where are most requests coming from?
  • What kinds of needs are most per district
  • Volunteer expertise per district.
  • Im filtering Requests with "New" status. As of now, I see only "New" Status in the data. Here's a Request counts grouped by District and Status.
  • Prioritising
    • One way to do Idea 1 automatically would be tokenize the free text strings like "detailRescue" to search for keywords like "Urgent", "Pregnant", "Baby","Elderly", "Medical help", etc and give it a higher priority based on the count of people in those strings.
    • Alternatively, If we have people available to sift through the requests and vote/flag them that would be fine for now. The flag should be clearly visible to the rescue team next to the requests on the site.
  • Hourly breakdown of requests coming in from different districts gives an idea of where situation got worse first or is getting worse.
  • Idea: We can flag urgency based on category(Adults, Kids, Elderly, etc) and Counts of people. Parsing the detailrescue for counts is proving cumbersome. It would help if we have fields for how many Adults, Kids, Elderly, Pregnant, etc when filling in request field?
data.location.nunique()
3849
  • If I do search-API / mix n match to try to map with name we could get from the entities:
    • Local dialing code local dialling code
# how many rows do not have a correct lat&long
def checkLengthLatLong(row):
    if (',' in row['latlng']):
        #print(row['latlng'])
        return 1
    else:
        print(row['latlng'])
        return 0

latlngok = data.apply(checkLengthLatLong,axis=1)
def checkLengthLatLong(row):latlngok.value_counts()
https://goo.gl/maps/XoN2aU56WAu
10°07'06.1"N    76°20'47.4"E
https://goo.gl/maps/a9kk9oJUJo32
thundumannil house
Pandanadu
10°15'54"N 76°19'02"E
https://goo.gl/maps/raRwJeMxazS2
Near St Thomas Knanaya Church (Menathottam) Pullopuram road
https://maps.google.com/?cid=9289948376535277802&hl=en&gl=in
https://maps.google.com/?cid=9289948376535277802&hl=en&gl=in
10 18 38.8 N 76 21 06.2E
10 17' 45.3"N 76 20'01.8"E
9°19'56.6"N 76°38'15.8"E
9°19'44.5" N 76°40'30.7"E
https://goo.gl/maps/FpcE5mok4nK2
10°18'33.9"N 76°21'16.9"E
10°06'26.6"N 76°19'32.1"E
9°22'54.4"N 76°37'26.3"E
Please check below kerala address
9°20'30.5"N 76°42'08.5"E
10°07'08.8"N 76°20'42.2"E Dr Sharon & Family stuck in a house
9.323466
Umayattur
https://goo.gl/maps/rr2FujHCSPH2
8547751185
Latitude 10.117809 Longitude 76. 283639
നെഗറ്റീവ്
Near petrol bung
9°19'22.7"N 76°34'09.2"E
10°10'44.9"N 76°19'02.7"E
Don't know
https://maps.google.com/?cid=14260923343439197804&hl=en&gl=in
location coordinates 10°18'14.6"N 76°22'00.2"E
9°20'27.2"N 76°40'10.8"E
https://goo.gl/maps/kiVsZw3U9NB2
9°19'28.7"N 76°38'12.8"E
https://goo.gl/maps/wAwKGDpp1kA2
https://goo.gl/maps/tZ4ME4Ga7A92
https://goo.gl/maps/HPicMsUYjmJ2
https://goo.gl/maps/Rf7ZNuEV5hn
https://maps.app.goo.gl/i/yWySs
Arattupuzha  https://goo.gl/maps/v1p2THBAj9E2
Near Kodimittom bus stop
Arattupuzha
9°22'40.0"N
Near Kodimittom bus stop
Near Kodimittom bus stop
9°19'38.6"N 76°41'37.6"E
9°19'56.5"N 76°34'51.9"E  https://goo.gl/maps/CEyUKF2WKiG2
തൃശ്ശൂർ - പൂലാനി കോവിലകം പടി
10°15'31.9"N 76°18'29.3"E
https://goo.gl/maps/dMJvP33LLj32
10°17'38.1"N 76°19'23.6"E
https://goo.gl/maps/KWo3ZgDmRzP2
https://goo.gl/maps/DzTWR5M7xgH2
9°20'06.2"N 76°39'04.7"E
10°07'01.9"N 76°19'48.9"E
Aluva - Kadungalooor
https://maps.google.com/?cid=12396817781223984730&hl=en&gl=gb
9°20'02.9"N 76°38'00.9"E
KOtyall
9.3334910
9°21'53"N 76°32'33"E
10.121694
10°05′36.2″N 76°19′56.6"E°
St Joseph’s church poovathussery.
https://maps.google.com/?q=Parakkadavu+Poovam+Cross+Rd%2C+Poovathussery%2C+Kerala+680734&ftid=0x3b08
Near Indian oil pump
https://goo.gl/maps/KWo3ZgDmRzP2
near thiruvanvandoor vanavaathukkara sastha temple
Thrikkandapuram temple
https://goo.gl/maps/5PeFQkiUV3B2
9°19'46.0"N 76°37'23.0"E
https://goo.gl/maps/RN5zLBo2HSP2
9°20'11.0"N 76°35'51.0"E
9°20'26.3"N 76°36'03.4"E
9°19'39.9"N 76°36'05.5"E
https://goo.gl/maps/Ec5WuSnjAiq
Tiruvalla
Thrikkandapuram temple
Alangad neerkode route
https://goo.gl/maps/xmnCY5hXc7S2
https://lm.facebook.com/l.php?u=https%3A%2F%2Fgoo.gl%2Fmaps%2Fd496uHBhTvx&h=AT2o-FM-ozHtfkZnevUM8joF
Vallam st theresas forane church
https://goo.gl/maps/hrkaJjsg7GQ2
200meter near bretheren believers campus
Poovathoor junction
https://l.facebook.com/l.php?u=https%3A%2F%2Fgoo.gl%2Fmaps%2Fj9bZb6ELgHD2&h=AT31B9j3W9HXLYt-pKXnbbRf
mekalady
10°10'38.6"N 76°18'20.0"E
Near thrikaipuram mama vishnu kshetram
https://goo.gl/maps/HVSiczcPhqN2
near orthodox church maangalam
https://goo.gl/maps/kxphkj2Xat52
podiyadi
9°19'38.5"N 76°38'58.1"E
10°10'33.5"N 76°14'13.3"E
10.156319 76.480708
chalaka medical college hostal
9°19'54.5"N 76°37'40.5"E
https://goo.gl/maps/D81KwK5fjMv
They are alone in that area.
https://l.facebook.com/l.php?u=https%3A%2F%2Fgoo.gl%2Fmaps%2FR4Pp1wtX5w42&h=AT1xGcZA776B2VXlG8juhA8B
between http://st.george  orthodox church and kuttikkadupadi-vazhrmangalam-chengannur
9°17'05.5"N 76°35'19.8"E
9°19'27.7"N 76°34'09.7"E
Kallissery
9°14'24.9"N 76°45'20.3"E
9497491001
https://goo.gl/maps/rNtdn88HjzJ2
10°15'59.4"N 76°17'39.0"E
Latitude:10.3740068 longitude:76.2552164
https://maps.google.com/?cid=10070337149436213922&hl=en&gl=us
Aster Medicity Hospital cheranellur Ernakulam
https://goo.gl/maps/EdAMfuqQbim
Muthoot hospital staff and students hostel
10 09'45.9''N76026'04.2''E
https://goo.gl/maps/4wmFZGHXtaU2
Zion English medium school
Zion English medium school
https://goo.gl/maps/7azVtjixDvm
Zion English medium school
Zion English medium school
Zion English medium school
10°07'09.1"N 76°18'22.5"E
https://maps.google.com/?cid=10732019211492737520&hl=en&gl=gb
Moovattupuzha paramedical college girls hostel
Angamali parakkadav ward no.  13..  House 45 46. 47 pin code683579...
https://goo.gl/maps/zCxVu3k4U9m
ramamangalam korankadavu
9°19'41.7"N 76°38'54.4"E
Najathnursing college Aluva
GKYLP School
689124
Aluva :Kayanatikkara society
https://goo.gl/maps/QPi4Mr2CSmo
9°19'36.5"N 76°39'29.5"E
Kadungullar aluva
9°20'23.1"N 76°40'57.0"E
https://goo.gl/maps/SUwVFSdtPGT2
9°20'08"N 76°40'34"E
Kodungalloor
College of engineering Munnar
10 25 15 .8 N 76 13 19.1 E
9°21'11.6"N 76°40'27.7"E
9°19'32.5"N 76°38'02.2"E
Kalady onampilli juma masjid
https://goo.gl/maps/9cmGTQ3BgTs
10°06'42.1"N 76°19'52.6"E
https://maps.google.com/?cid=10239116496635686781&hl=en&gl=gb
https://goo.gl/maps/q8Dy4TCCGbn
karakkal- kaavumbhaagam
10"09'14.8"N76"25'13.5"E
https://goo.gl/maps/CZKqYrtbZy72
Thymaravumkara
thiruvalla and chathankiri thoni kadav
Thiruvandoor
10°09'31.9"N 76°26'38.7"E
https://maps.google.com/?q=Eramallikkara+Bridge%2C+Kadapra%2C+Kerala+689102&ftid=0x3b0623df1beb4f77
9°19'29.7"N 76°39'26.1"E
10"12'35.9"N76"19'42.7"E
https://goo.gl/maps/cDVeJEMCJDA2
വരാപ്പുഴ കൂനമ്മാവ് ചെങ്കോട്ടുകുന്ന് പാടം
https://goo.gl/maps/A7Qy5Jn86tN2
https://www.google.com/maps/place/Manavelil+Kudumbakavu+%E0%B4%AE%E0%B4%A3%E0%B4%B5%E0%B5%87%E0%B4%B
Chengannur thiruvalla route kallisary left turn 5km
9°24'33.0"N 76°32'05.6"E
https://goo.gl/maps/KsYtmzanZQu
9°21'42.1"N
YWCA KOZHENCHERY
10°05'36.2"N 76°19'56.6"E
9°19'43.7"N 76°38'40.7"E
https://goo.gl/maps/wPit7ZapA6r
10°13'56"N 76°18'52"E
Latitude10.1161.    longitude76.3381
Ayroor opp Ayurveda hospital
9°22'21.4"N    76°32'35.6"E
Cmi public school
Chengannur thiruvalla route kallisary left turn 5km
10.156319 76.480708
https://goo.gl/maps/PkarsKaeD622
10°10'48.2"N 76°17'43.6"E
https://goo.gl/maps/tu9iYXjBx2B2
10°18'11.8"N 76°22'28.2"E
9°19'35.7"N 76°36'15.3"E
10°13'46.4"N 76°20'00.1"E
9°20'56.1"N 76°34'42.2"E
ആലുംത്തുരിത്തിപാലത്തിന് കിഴക്ക് about 4km ഉള്ളില്‍ വളഞ്ഞവട്ടം പള്ളിക് അടുത്ത
https://maps.google.com/?q=Pambutra+Rd%2C+Kallur+Vadakkummuri%2C+Kerala+680309&ftid=0x3b0803078ee5f5
https://goo.gl/maps/cpFaRmPoGXL2
10°15'04.7"N 76°18'35.3"E
Don't know
Maramon thottapuzhasery
NA
Latitude 9.3609.  Longitude 76.5657
10°06'33.5"N 76°20'38.1"E
http://maps.google.com/?cid=11980799448074305022&hl=en&gl=us
Near puthukulangara devi temple on the side of varattaru . Alappuzha district side
Near Edanad Orthodox Church
https://goo.gl/maps/7wFLZdcBf2Q2
9°19'45.1"N 76°38'43.4"E
Koipuram
Kottamam Kerala 683574  https://maps.google.com/?q=Kottamam%2C+Kerala+683574&ftid=0x3b07fd60dfb917db
10°10'48.4"N 76°17'43.6"E Vakkachan and 30+  people are waiting on second floor of white house
9°19'47.5"N 76°39'36.0"E
Kaipetty bagavathy temple
CMI School - near pumb house
10 .10'42.9"N76 .27'18.0"E
9°19'22.8"N 76°41'03.0"E
Kodumthara temple
9.333055-76.636201
10°18'30.1"N        76°21'20.2"E
10°07'31.5"N 76°18'11.5"E
https://maps.google.com/?cid=5028532610228275885&hl=en&gl=gb
Umayattukara Devi Temple
10 .10'42.9"N76 .27'18.0"E
Mannar
https://goo.gl/maps/TNRtXsAjwqP2
N  10°   9′   22″	E  76°   16′   56.91″
Koipuram
9°56'30.0"N 76°28'44.0"E
Thiruvanmandoor vannipuzha colony
10°09'31.9"N 76°26'38.7"E
East kadungaloor-rajasree road-aluva
Not available . address in details
9.959808 76.546793
Vazhakunnam junction is 9 kms away from ranni town and 5 kms away kozhencherrry
10°11'11.0"N 76°27'07.5"E
Nellumalayil road evangelical church arattupuzha
9°23'15.9"N 76°32'35.7"E
Vazhakunnam junction is 9 kms away from ranni town and 5 kms away kozhencherrry
Towads vanavathukkara road from society junction or kallikkattil junction
9°23'15.9"N 76°32'35.7"E
Vannipuzhathu colony
putiyamadathil house  near pulikeezhu bridge  bhagyodayam press road palliyarathalam temple road Tir
https://m.facebook.com/story.php?story_fbid=2228099104102826&id=100007082747500
10°06'42.5"N 76°20'06.5"E
https://goo.gl/maps/btXhp74E57B2
9°19'41.7"N 76°38'54.4"E
10°06'29"N 76°19'07"E
10''15'00.4'N76''54.7'E
Arattupuzha jucntion
Thiruvanmandoor eramallikara palam route before HP petrol pump
10°11'05.8"N   76°27'07.9"E
https://goo.gl/maps/D6ZmwKAWbJG2
10° 10′ 20.05″ N 76° 27′ 12.08″ E
10 06 55.9 N. 76 20 48.4 E
Sneha Nagar Residents Association  https://goo.gl/maps/ugoRqDSo27M2
Behind chakkulath kaave temple
9°21'56.1"N 76°30'53.4"E
Thalavady  near pachayat.
Kainattikkara aluva +918547534980
http://www.google.com/maps/d/viewer?mid=1NhMwufzkqG8ivYUSoHChlNz6m-Ti5UiA&ll=9.325551150090613%2C76.
http://www.google.com/maps/d/viewer?mid=1NhMwufzkqG8ivYUSoHChlNz6m-Ti5UiA&ll=9.325551150090613%2C76.
https://goo.gl/maps/XLWs6NoKkZQ2
https://goo.gl/maps/a9kk9oJUJo32
9°19'14.0"N 76°35'47.5"E
Vazharmangalam chengannur
NIL
SNDP Pavukkara
10°15'31.9"N 76°18'29.3"E
Near orthodox Church
Thiruvalla kayamkulam route  podiyadi half km inside
10°11'05.8"N   76°27'07.9"E
10°05'36.2"N 76°19'56.6"E
https://goo.gl/maps/BjcYwCfm57K2
https://goo.gl/maps/XSgeaQMN7RB2
Near orthodox Church
Dropped pin  https://goo.gl/maps/LYsR3C4op1m
Dropped pin  https://goo.gl/maps/iZSEhRfRvPu
Thiruvalla Municipal Libarary
9°20'42.8"N 76°36'02.0"E
kadapara niranam west veeyapuram route
9°19'42.2"N 76°38'55.3"E
https://goo.gl/maps/2aQejoGd1tG2
9°21'24.8"N 76°32'33.4"E
https://maps.google.com/?q=Kozhipalam%2C+Kerala+689532&ftid=0x3b063d1adb73
Rakkad muvattupuzha
9°20'18.4"N 76°37'24.2"E
https://goo.gl/maps/hdPWvU1bDyH2
https://maps.google.com/?cid=13669561898043948312&hl=en&gl=us
https://goo.gl/maps/y8EkJDJioHN2
9°19'17.4"N 76°33'55.4"E
https://maps.google.com/?cid=7258389364277917185&hl=en&gl=us
9°20'47.5"N 76°35'48.3"E
10°10'08.0"N 76°13'59.6"E  https://goo.gl/maps/Bw4KTQf2EEs
10°09'59.0"N 76°16'37.0"E
St Jude
Behind Bethlehem Marthoma Church
10°10'38.4"N 76°18'19.9"E
Samji
10°15'31.9"N 76°18'29.3"E
10°15'31.9"N 76°18'29.3"E
Poovathussery
Poovathussery
GPS Coordi
GPS Coordi
https://goo.gl/maps/bSCKqzRnqRz
10.294029
10.295280
10°06'55.0"N 76°19'56.9"E
https://maps.google.com/?cid=14047986289895833821&hl=en&gl=us
9°14'27.1"N 76°36'47.0"E
aluva
9°20'26.5"N 76°38'00.2"E
Aluva. near UCA college.
https://goo.gl/maps/84BcpFKZqG42
https://goo.gl/maps/84BcpFKZqG42
Kodanad near Elephant Craal
near to duckfarm
9.20 37.2 N 76.34.59.5E
https://goo.gl/maps/NtgkqcC1nGx
Mannar
Dropped pin  https://goo.gl/maps/EF9AkcrtB3m
× Geolocation: Chendamangalam Panchayath office Latitude: 10.178248 Longitude: 76.253864
× Geolocation: Chendamangalam Panchayath office Latitude: 10.178248 Longitude: 76.253864
× Geolocation: Chendamangalam Panchayath office Latitude: 10.178248 Longitude: 76.253864
opposite to mangalam marthoma church
puliyur
7034648309
10°06'15.9"N  76°16'25.3"E
10°10'39.2"N 76°18'38.3"E
https://goo.gl/maps/HVSiczcPhqN2
Thattampady
chengothukunnu Kurishupally
10°10'43.1"N 76°27'46.3"E
10°10'43.1"N 76°27'46.3"E
10°17'28.8"N 76°19'40.6"E
9.328477
10°09'27.0"N 76°18'23.3"E
10°17'55.0"N 76°20'21.4"E
https://maps.app.goo.gl/yJBR0xJS4JAP7zav2
https://maps.google.com/maps?q=9.3278113%2C76.5942775&z=17&hl=en
10°12'24.6"N 76°19'22.7"E
Nakkara house East othera po 689546 Near art of living
https://goo.gl/maps/5gr2fxUzfWA2
Pandalam
Thiruvalla Kozhencherry road after Pullad - Kunnamthanam stop. From there take the road on the left
def dataCoord(row):
    if (',' in row['latlng']):
        try:
            lat,long = row['latlng'].split(',') 
            row['lat'] = lat
            row['long'] = long
            row['coord'] = True
        except ValueError:
            row['lat'] = 0.0
            row['long'] = 0.0
            row['coord'] = False
            #print('more than one comma')
    else:
        row['lat'] = 0.0
        row['long'] = 0.0
        row['coord'] = False
    return row    
        
        
    #else I skip the row
    

data_c = data.apply(dataCoord,axis=1)
data.shape
(5431, 26)
data_c.head()
dateadded detailcloth detailfood detailkit_util detailmed detailrescue detailtoilet detailwater district id ... needrescue needtoilet needwater requestee requestee_phone status supply_details lat long coord
0 2018-08-16T09:17:58.895Z ekm 6765 ... False False False Sreeram 094470581 new 10.0021295 76.3230197 True
1 2018-08-16T09:21:22.609Z idk 6794 ... False False False Test Test new 10.7208157 76.6447006 True
2 2018-08-16T09:19:14.170Z idk 6775 ... False False False Vellachamy 9947009803 new 9.7370423 77.155886 True
3 2018-08-16T09:19:24.604Z ekm 6777 ... False False False Sebin 9544117226 new 10.3470498 76.2086201 True
4 2018-08-16T09:23:44.005Z ptm 6803 ... False False False Abraham George 9744064073 new 8.5565307 76.8810618 True

5 rows × 29 columns

coord = data_c[data_c['coord']==True]
print(coord['lat'].head())
print(coord['long'].head())
print(coord.shape)
0    10.0021295
1    10.7208157
2     9.7370423
3    10.3470498
4     8.5565307
Name: lat, dtype: object
0    76.3230197
1    76.6447006
2     77.155886
3    76.2086201
4    76.8810618
Name: long, dtype: object
(5008, 29)
'''
def processCoordinates(row):
    keralaCoord = row['latlng']
    accuracy = row['latlng_accuracy']
    locationName = row['location']
    
    # I will first ignore the accuracy field, which should be a correction of the latlng field
    # Accuracy can be a field with a float and the word 'meters', just a string saying 'accurate', or a Google Maps URL
    '''
    if (validators.url(accuracy) and (('https://www.google.com/maps/' in accuracy) or ('https://goo.gl/maps/' in accuracy)):
        # it is a URL coming from GMaps
        #TODO: we should extract the PIN coordinates to overwrite the other location?
    elif ('Meters' in accuracy):    
        # something
    #if accuracy='accurate' there is nothing to do
       
    '''    
    i
    lat,long = keralaCoord.split(',')
    #accuracykm = float(accuracy_meters) / 1000
    #print(accuracy)
    #print(accuracykm)
    return lat,long

lat,long = data.apply(processCoordinates, axis=1)

'''    
# wikibase:radius can be the latlng accuracy, but the radius is in KM while the kerala data has it in meters
'''
def  processCoordinateprocessC (row):
    r = '@'+str(row['Y']) +'/' +str(row['X'])
    return r
def changeLetter(row):
    return row[1:]+row[0:1]
@47.3692926201664/8.5908112950803   

data_qs['P625']=datac.apply(processCoordinate,axis=1)
    
'''    
!pip install gastrodon
Collecting gastrodon
  Using cached https://files.pythonhosted.org/packages/0e/05/64c50e00f6afa761d93a875e64a9d40a673a602d926e97b8bce502f4beb2/gastrodon-0.9.3-py3-none-any.whl
Requirement already satisfied: pyparsing in /srv/paws/lib/python3.6/site-packages (from gastrodon)
Collecting ipython-autotime (from gastrodon)
  Using cached https://files.pythonhosted.org/packages/e6/f9/0626bbdb322e3a078d968e87e3b01341e7890544de891d0cb613641220e6/ipython-autotime-0.1.tar.bz2
Collecting SPARQLWrapper (from gastrodon)
  Using cached https://files.pythonhosted.org/packages/7f/c3/72d2d0a2ad86bd8d2bc762406c838f479c421678161cf78585d085436919/SPARQLWrapper-1.8.2-py3-none-any.whl
Collecting rdflib (from gastrodon)
  Using cached https://files.pythonhosted.org/packages/3c/fe/630bacb652680f6d481b9febbb3e2c3869194a1a5fc3401a4a41195a2f8f/rdflib-4.2.2-py3-none-any.whl
Collecting bs4 (from gastrodon)
  Using cached https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz
Requirement already satisfied: matplotlib in /srv/paws/lib/python3.6/site-packages (from gastrodon)
Collecting uritools (from gastrodon)
  Using cached https://files.pythonhosted.org/packages/8c/5d/ef3cd3c40b4b97f0cb50cee8e4c5a8a4abc30953e1c7ce7e0d25cb2534c3/uritools-2.2.0-py2.py3-none-any.whl
Requirement already satisfied: IPython in /srv/paws/lib/python3.6/site-packages (from gastrodon)
Requirement already satisfied: pandas in /srv/paws/lib/python3.6/site-packages (from gastrodon)
Collecting isodate (from rdflib->gastrodon)
  Using cached https://files.pythonhosted.org/packages/9b/9f/b36f7774ff5ea8e428fdcfc4bb332c39ee5b9362ddd3d40d9516a55221b2/isodate-0.6.0-py2.py3-none-any.whl
Requirement already satisfied: beautifulsoup4 in /srv/paws/lib/python3.6/site-packages (from bs4->gastrodon)
Requirement already satisfied: cycler>=0.10 in /srv/paws/lib/python3.6/site-packages (from matplotlib->gastrodon)
Requirement already satisfied: numpy>=1.7.1 in /srv/paws/lib/python3.6/site-packages (from matplotlib->gastrodon)
Requirement already satisfied: python-dateutil>=2.1 in /srv/paws/lib/python3.6/site-packages (from matplotlib->gastrodon)
Requirement already satisfied: six>=1.10 in /srv/paws/lib/python3.6/site-packages (from matplotlib->gastrodon)
Requirement already satisfied: kiwisolver>=1.0.1 in /srv/paws/lib/python3.6/site-packages (from matplotlib->gastrodon)
Requirement already satisfied: pytz in /srv/paws/lib/python3.6/site-packages (from matplotlib->gastrodon)
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.15 in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: backcall in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: simplegeneric>0.8 in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: pygments in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: pickleshare in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: decorator in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: traitlets>=4.2 in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: pexpect; sys_platform != "win32" in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: jedi>=0.10 in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: setuptools>=18.5 in /srv/paws/lib/python3.6/site-packages (from IPython->gastrodon)
Requirement already satisfied: wcwidth in /srv/paws/lib/python3.6/site-packages (from prompt-toolkit<2.0.0,>=1.0.15->IPython->gastrodon)
Requirement already satisfied: ipython-genutils in /srv/paws/lib/python3.6/site-packages (from traitlets>=4.2->IPython->gastrodon)
Requirement already satisfied: ptyprocess>=0.5 in /srv/paws/lib/python3.6/site-packages (from pexpect; sys_platform != "win32"->IPython->gastrodon)
Requirement already satisfied: parso>=0.2.0 in /srv/paws/lib/python3.6/site-packages (from jedi>=0.10->IPython->gastrodon)
Building wheels for collected packages: ipython-autotime, bs4
  Running setup.py bdist_wheel for ipython-autotime ... error
  Complete output from command /srv/paws/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-43l5uaa9/ipython-autotime/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp3gyr7q2xpip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for ipython-autotime
  Running setup.py clean for ipython-autotime
  Running setup.py bdist_wheel for bs4 ... error
  Complete output from command /srv/paws/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-43l5uaa9/bs4/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp5pbugishpip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for bs4
  Running setup.py clean for bs4
Failed to build ipython-autotime bs4
Installing collected packages: ipython-autotime, isodate, rdflib, SPARQLWrapper, bs4, uritools, gastrodon
  Running setup.py install for ipython-autotime ... done
  Running setup.py install for bs4 ... done
Successfully installed SPARQLWrapper-1.8.2 bs4-0.0.1 gastrodon-0.9.3 ipython-autotime-0.1 isodate-0.6.0 rdflib-4.2.2 uritools-2.2.0
from gastrodon import RemoteEndpoint,QName,ttl,URIRef,inline
https://query.wikidata.org/sparql?query={SPARQL}
prefixes=inline("""
    @prefix wd: <http://www.wikidata.org/entity/> .
    @prefix wdt: <http://www.wikidata.org/prop/direct/> .
""").graph #@prefix : <http://dbpedia.org/resource/> .

endpoint=RemoteEndpoint(
    "http://query.wikidata.org/sparql"
    #,default_graph="http://dbpedia.org"
    #,prefixes=prefixes
    #,base_uri="http://dbpedia.org/resource/"
)
points =endpoint.select("""
    SELECT ?place ?location ?distance ?placeLabel ?type ?layer WHERE {
    SERVICE wikibase:around { 
      ?place wdt:P625 ?location . 
      bd:serviceParam wikibase:center "Point(76.3230197 10.0021295)"^^geo:wktLiteral .
      bd:serviceParam wikibase:radius "5" . 
      bd:serviceParam wikibase:distance ?distance .
    } 
    ?place wdt:P31 ?type .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?type rdfs:label ?layer }
} ORDER BY ?distance LIMIT 100
""")
points
place location distance placeLabel type layer
0 http://www.wikidata.org/entity/Q1356097 Point(76.33 10.0) 0.800 None http://www.wikidata.org/entity/Q1149652 district of India
1 http://www.wikidata.org/entity/Q55454527 Point(76.315984 9.997558) 0.923 None http://www.wikidata.org/entity/Q4830453 business
2 http://www.wikidata.org/entity/Q7126739 Point(76.3125 9.998611111) 1.217 None http://www.wikidata.org/entity/Q486972 human settlement
3 http://www.wikidata.org/entity/Q4009048 Point(76.329422 10.01516) 1.610 None http://www.wikidata.org/entity/Q486972 human settlement
4 http://www.wikidata.org/entity/Q4009048 Point(76.329422222 10.015161111) 1.610 None http://www.wikidata.org/entity/Q486972 human settlement
5 http://www.wikidata.org/entity/Q7074799 Point(76.31222222 10.01444444) 1.809 None http://www.wikidata.org/entity/Q11315 shopping mall
6 http://www.wikidata.org/entity/Q7798151 Point(76.333333333 10.016666666) 1.972 None http://www.wikidata.org/entity/Q532 village
7 http://www.wikidata.org/entity/Q38697682 Point(76.304768888 10.006431944) 2.055 None http://www.wikidata.org/entity/Q928830 metro station
8 http://www.wikidata.org/entity/Q5197825 Point(76.3030518 10.0015282) 2.188 None http://www.wikidata.org/entity/Q4830453 business
9 http://www.wikidata.org/entity/Q7799487 Point(76.3333 9.98333) 2.374 None http://www.wikidata.org/entity/Q532 village
10 http://www.wikidata.org/entity/Q7709998 Point(76.31 9.984) 2.469 None http://www.wikidata.org/entity/Q486972 human settlement
11 http://www.wikidata.org/entity/Q7920136 Point(76.3 10.0) 2.532 None http://www.wikidata.org/entity/Q486972 human settlement
12 http://www.wikidata.org/entity/Q42306467 Point(76.299535 10.000554) 2.578 None http://www.wikidata.org/entity/Q928830 metro station
13 http://www.wikidata.org/entity/Q4901508 Point(76.3351 10.0227) 2.642 None http://www.wikidata.org/entity/Q3914 school
14 http://www.wikidata.org/entity/Q38584315 Point(76.302318888 10.01488) 2.674 None http://www.wikidata.org/entity/Q928830 metro station
15 http://www.wikidata.org/entity/Q1606027 Point(76.344 10.017) 2.830 None http://www.wikidata.org/entity/Q486972 human settlement
16 http://www.wikidata.org/entity/Q13110366 Point(76.3053 10.0219) 2.932 None http://www.wikidata.org/entity/Q16970 church
17 http://www.wikidata.org/entity/Q6888240 Point(76.328749 10.028484) 2.997 None http://www.wikidata.org/entity/Q1663017 engineering school
18 http://www.wikidata.org/entity/Q38582577 Point(76.308456111 10.025106111) 3.012 None http://www.wikidata.org/entity/Q928830 metro station
19 http://www.wikidata.org/entity/Q1523119 Point(76.3197 10.0297) 3.087 None http://www.wikidata.org/entity/Q486972 human settlement
20 http://www.wikidata.org/entity/Q6644430 Point(76.30777778 10.02555556) 3.094 None http://www.wikidata.org/entity/Q11315 shopping mall
21 http://www.wikidata.org/entity/Q6979223 Point(76.2938 9.9962) 3.267 None http://www.wikidata.org/entity/Q3918 university
22 http://www.wikidata.org/entity/Q420393 Point(76.3011 9.98056) 3.393 None http://www.wikidata.org/entity/Q2072238 archdiocese
23 http://www.wikidata.org/entity/Q12060941 Point(76.292 9.994) 3.515 None http://www.wikidata.org/entity/Q486972 human settlement
24 http://www.wikidata.org/entity/Q42308815 Point(76.291669 9.994484) 3.537 None http://www.wikidata.org/entity/Q928830 metro station
25 http://www.wikidata.org/entity/Q30280479 Point(76.291136 9.993581) 3.618 None http://www.wikidata.org/entity/Q5691113 health organization
26 http://www.wikidata.org/entity/Q17089381 Point(76.292934 9.987702) 3.664 None http://www.wikidata.org/entity/Q9826 high school
27 http://www.wikidata.org/entity/Q5395332 Point(76.337 9.972) 3.683 None http://www.wikidata.org/entity/Q532 village
28 http://www.wikidata.org/entity/Q7798150 Point(76.329 10.035) 3.713 None http://www.wikidata.org/entity/Q532 village
29 http://www.wikidata.org/entity/Q6444291 Point(76.318 9.969) 3.724 None http://www.wikidata.org/entity/Q486972 human settlement
30 http://www.wikidata.org/entity/Q12072358 Point(76.318 9.969) 3.724 None http://www.wikidata.org/entity/Q486972 human settlement
31 http://www.wikidata.org/entity/Q3525234 Point(76.33 10.0356) 3.799 None http://www.wikidata.org/entity/Q44539 temple
32 http://www.wikidata.org/entity/Q38566574 Point(76.314371111 10.035948055) 3.878 None http://www.wikidata.org/entity/Q928830 metro station
33 http://www.wikidata.org/entity/Q42308850 Point(76.288035 9.991247) 4.017 None http://www.wikidata.org/entity/Q928830 metro station
34 http://www.wikidata.org/entity/Q5139827 Point(76.285843 9.99733) 4.106 None http://www.wikidata.org/entity/Q327333 government agency
35 http://www.wikidata.org/entity/Q6754374 Point(76.288 9.9884) 4.127 None http://www.wikidata.org/entity/Q16917 hospital
36 http://www.wikidata.org/entity/Q5392597 Point(76.286703 9.991778) 4.140 None http://www.wikidata.org/entity/Q55488 railway station
37 http://www.wikidata.org/entity/Q6430669 Point(76.3 10.033333333) 4.288 None http://www.wikidata.org/entity/Q532 village
38 http://www.wikidata.org/entity/Q6389053 Point(76.2966 9.9712) 4.494 None http://www.wikidata.org/entity/Q3914 school
39 http://www.wikidata.org/entity/Q5335703 Point(76.299 10.035) 4.503 None http://www.wikidata.org/entity/Q55488 railway station
40 http://www.wikidata.org/entity/Q7811932 Point(76.3129 9.9626) 4.533 None http://www.wikidata.org/entity/Q3914 school
41 http://www.wikidata.org/entity/Q7783601 Point(76.35 10.033333333) 4.557 None http://www.wikidata.org/entity/Q532 village
42 http://www.wikidata.org/entity/Q31185193 Point(76.35 10.033333333) 4.557 None http://www.wikidata.org/entity/Q54050 hill
43 http://www.wikidata.org/entity/Q6345229 Point(76.3 9.966666666) 4.680 None http://www.wikidata.org/entity/Q486972 human settlement
44 http://www.wikidata.org/entity/Q10608093 Point(76.279722222 10.000833333) 4.743 None http://www.wikidata.org/entity/Q486972 human settlement
45 http://www.wikidata.org/entity/Q3530803 Point(76.326 10.045) 4.778 None http://www.wikidata.org/entity/Q1663017 engineering school
46 http://www.wikidata.org/entity/Q42328335 Point(76.282351 9.983395) 4.916 None http://www.wikidata.org/entity/Q928830 metro station
import requests
r = requests.get("https://query.wikidata.org/#SELECT%20%3Fplace%20%3Flocation%20%3Fdistance%20%3FplaceLabel%20%3Ftype%20%3FtypeLabel%20%3Flayer%20WHERE%20%7B%0A%20%20%20%20SERVICE%20wikibase%3Aaround%20%7B%20%0A%20%20%20%20%20%20%3Fplace%20wdt%3AP625%20%3Flocation%20.%20%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Acenter%20%22Point%2876.3230197%2010.0021295%29%22%5E%5Egeo%3AwktLiteral%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Aradius%20%225%22%20.%20%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Adistance%20%3Fdistance%20.%0A%20%20%20%20%7D%20%0A%20%20%20%20%3Fplace%20wdt%3AP31%20%3Ftype%20.%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%3Ftype%20rdfs%3Alabel%20%3Flayer%20%7D%0A%7D%20ORDER%20BY%20%3Fdistance%20LIMIT%20100")
r.content
b'<!DOCTYPE html><html lang="en" dir="ltr"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=yes"><title>Wikidata Query Service</title><link rel="stylesheet" href="css/style.min.40a87411b371425e18c4.css"><link rel="shortcut icon" href="favicon.ico"><script src="js/shim.min.d59d3aa7becb9e282fc1.js"></script></head><body><div class="wikibase-queryservice container-fluid"><div class="row"><nav class="navbar navbar-default"><div class="navbar-header"><button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#header-navbar-collapse" aria-expanded="false"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><div class="navbar-brand"><a href="./"><img width="48" height="31" src="logo.svg"><span></span></a></div></div><div class="collapse navbar-collapse in" id="header-navbar-collapse"><ul class="nav navbar-nav navbar-left" id="left-navbar"><li><button type="button" class="btn navbar-btn btn-default" id="open-example" data-toggle="modal" data-target="#QueryExamples"><span class="fa fa-folder-open-o"></span> <span data-i18n="wdqs-app-button-examples" id="examples-label"></span></button></li><li><div class="btn-group navbar-btn"><a href="https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Wikidata_Query_Help" target="_blank" class="btn btn-default"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <span data-i18n="wdqs-app-button-help" id="help-label"></span> </a><button data-toggle="dropdown" class="btn btn-default dropdown-toggle" id="help-toggle"><span class="caret"></span></button><ul class="dropdown-menu"><li><a target="_blank" rel="noopener" href="https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Wikidata_Query_Help" data-i18n="wdqs-app-help-portal"></a></li><li><a target="_blank" rel="noopener" href="https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual" data-i18n="wdqs-app-help-manual"></a></li><li><a target="_blank" rel="noopener" href="https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples" data-i18n="wdqs-app-help-examples"></a></li><li role="separator" class="divider"></li><li><a target="_blank" rel="noopener" href="https://www.w3.org/TR/sparql11-query/">SPARQL</a></li><li><a target="_blank" rel="noopener" href="https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format" data-i18n="wdqs-app-help-datamodel"></a></li><li><a target="_blank" rel="noopener" href="https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Full_list_of_prefixes" data-i18n="wdqs-app-help-prefixes"></a></li><li role="separator" class="divider"></li><li><a target="_blank" rel="noopener" href="https://www.wikidata.org/wiki/Wikidata:Request_a_query" data-i18n="wdqs-app-help-request-query"></a></li><li><a target="_blank" rel="noopener" href="https://www.mediawiki.org/w/index.php?title=Talk:Wikidata_query_service&action=edit&section=new" data-i18n="wdqs-app-help-feedback"></a></li><li><a target="_blank" rel="noopener" href="copyright.html" data-i18n="wdqs-app-help-copy"></a></li></ul></div></li><li class="dropdown"><div class="btn-group navbar-btn"><button data-toggle="dropdown" class="btn btn-default dropdown-toggle" id="tools-toggle"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> <span data-i18n="wdqs-app-button-tools" id="tools-label"></span> <span class="caret"></span></button><ul class="dropdown-menu"><li><a target="_blank" rel="noopener" href="https://tools.wmflabs.org/hay/propbrowse/"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> Hay\'s Properties Browser</a></li><li><a target="_blank" rel="noopener" href="https://tools.wmflabs.org/sqid/#/browse?type=properties"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> SQID Properties Browser</a></li><li><a target="_blank" rel="noopener" href="https://angryloki.github.io/wikidata-graph-builder/"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> Wikidata Graph Builder</a></li><li><a target="_blank" rel="noopener" href="https://wdaqua-frontend.univ-st-etienne.fr"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> Text to SPARQL (WDAqua)</a></li><li role="separator" class="divider"></li><li><a target="_blank" rel="noopener" href="https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/exploring-linked-data.md"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> Exploring Linked Data</a></li><li><a target="_blank" rel="noopener" href="https://tools.wmflabs.org/wdq2sparql/w2s.php"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> WDQ Syntax Translator</a></li><li><a target="_blank" rel="noopener" href="https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual#SPARQL_endpoint"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> SPARQL REST Endpoint</a></li></ul></div></li></ul><ul class="nav navbar-nav navbar-right" id="right-navbar"><li><a href="#" class="uls-trigger" id="language-toggle" data-toggle="tooltip"></a></li></ul></div></nav><div id="query-box"><form id="query-form" action="https://query.wikidata.org/bigdata/namespace/wdq/sparql"><div class="query-main"><div class="toolbar"><div class="toolbar-top"><div><a href="#" class="btn query-helper-trigger" target="_blank" title="Show query explanation"><span class="fa fa-info-circle" aria-hidden="true"></span></a></div><div><a href="#" class="btn fullscreen-toggle" data-toggle="tooltip" data-placement="top" data-i18n="[title]wdqs-app-button-fullscreen-title"><span class="fa fa-arrows-alt" aria-hidden="true"></span></a></div><div class="dropdown"><a href="#" class="btn dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" data-i18n="[title]wdqs-app-button-prefixes"><span class="fa fa-thumb-tack" aria-hidden="true"></span><span class="caret"></span></a><ul class="dropdown-menu"><li><strong data-i18n="wdqs-app-button-prefixes"></strong></li><li role="separator" class="divider"></li><li><div class="namespace-shortcuts"></div></li><li role="separator" class="divider"></li><li><a class="addPrefixes" data-i18n="wdqs-app-editor-addprefixes"></a></li></ul></div><div><a href="#" class="btn" data-i18n="[title]wdqs-app-button-examples" data-toggle="modal" data-target="#QueryExamples"><span class="fa fa-folder-open-o" aria-hidden="true"></span></a></div><div><a href="#" class="btn restore" id="restore-button" data-toggle="tooltip" data-placement="top" data-i18n="[title]wdqs-app-button-restore-title"><span class="fa fa-history" aria-hidden="true"></span></a></div><div><a href="#" class="btn" id="clear-button" data-toggle="tooltip" data-placement="top" data-i18n="[title]wdqs-app-button-clear-title"><span class="fa fa-trash-o" aria-hidden="true"></span></a></div><div><a href="#" class="btn shareQuery shortUrlTrigger query" target="_blank" data-i18n="[title]wdqs-app-shorturl-page-title" data-toggle="popover"><span class="fa fa-link" aria-hidden="true"></span></a></div></div><div class="toolbar-bottom"><button type="submit" class="btn btn-info" id="execute-button" data-toggle="tooltip" data-placement="top" data-i18n="[title]wdqs-app-button-run-title"><span class="fa fa-play" aria-hidden="true"></span></button></div></div><div class="query-helper-and-editor"><div class="query-helper query-helper-hidden"><div class="panel panel-info"><div class="panel-heading"><strong data-i18n="wdqs-app-help-queryhelper"></strong> <a target="_blank" rel="noopener" id="query-helper-help" href="https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Query_Helper"><span class="glyphicon glyphicon-question-sign"></span></a> <button type="button" class="close" aria-label="Close"><span aria-hidden="true">&times;</span></button></div><div class="panel-body"></div></div></div><div class="splitter"></div><div class="query-editor-container" dir="ltr"><textarea class="queryEditor" name="query" data-i18n="[placeholder]wdqs-app-editor-placeholder" placeholder="(Input a SPARQL query or choose a query example)"></textarea></div></div></div><div class="navbar navbar-default query-helper-tag-cloud query-helper-hidden"></div><div class="status navbar navbar-default toolbar"><div class="navbar-right"><span class="dataUpdated"></span></div></div></form></div></div><noscript><div class="row action-bar" style="display: block"><div class="message"><div class="label label-warning">For interactive query editing, a localized user interface, and other improvements, please enable JavaScript or use a browser that supports it.</div></div></div></noscript><div class="row"><nav class="navbar navbar-default result"><ul class="nav navbar-nav navbar-left"><li><a id="display-button" href="#" data-toggle="dropdown" class="dropdown-toggle" data-placement="top" data-i18n="[title]wdqs-app-button-display-title"><span id="display-button-icon" class="glyphicon glyphicon-eye-open" aria-hidden="true"></span><span id="display-button-label"></span><span class="caret"></span></a><ul id="result-browser-menu" class="dropdown-menu" role="menu"></ul></li><li></li><li><a target="_blank" class="help" rel="noopener" href="https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Wikidata_Query_Help/Result_Views"><span class="fa fa-question-circle"></span></a></li></ul><ul class="nav navbar-nav navbar-right"><li class="navbar-text"><span class="query-total"><span class="label label-default" id="response-summary"></span> </span>&nbsp;</li><li><a class="btn" data-toggle="modal" data-target="#CodeExamples" data-i18n="[title]wdqs-app-button-code-title"><span class="fa fa-code"></span> <span data-i18n="wdqs-app-button-code"></span></a></li><li><a id="download-button" href="#" data-toggle="dropdown" class="dropdown-toggle" data-placement="top" data-i18n="[title]wdqs-app-button-download-title"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span><span data-i18n="wdqs-app-button-download"></span><span class="caret"></span></a><ul class="dropdown-menu" role="menu"><li><a id="downloadJSON" href="#"><span class="fa fa-file-code-o" aria-hidden="true"></span> <span data-i18n="wdqs-app-result-json"></span></a></li><li><a id="downloadFull-JSON" href="#"><span class="fa fa-file-code-o" aria-hidden="true"></span> <span data-i18n="wdqs-app-result-json-verbose"></span></a></li><li role="separator" class="divider"></li><li><a id="downloadSimple-TSV" href="#"><span class="fa fa-file-excel-o" aria-hidden="true"></span> <span data-i18n="wdqs-app-result-tsv"></span></a></li><li><a id="downloadTSV" href="#"><span class="fa fa-file-excel-o" aria-hidden="true"></span> <span data-i18n="wdqs-app-result-tsv-verbose"></span></a></li><li role="separator" class="divider"></li><li><a id="downloadCSV" href="#"><span class="fa fa-file-excel-o" aria-hidden="true"></span> <span data-i18n="wdqs-app-result-csv"></span></a></li><li role="separator" class="divider"></li><li><a id="downloadHTML" href="#"><span class="fa fa-file-code-o" aria-hidden="true"></span> <span data-i18n="wdqs-app-result-html"></span></a></li><li role="separator" class="divider"></li><li><a id="downloadSVG" href="#"><span class="fa fa-file-image-o" aria-hidden="true"></span> <span data-i18n="wdqs-app-result-svg"></span></a></li></ul></li><li><a id="link-button" href="#" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true" aria-expanded="false" data-placement="top" data-i18n="[title]wdqs-app-button-link-title"><span class="glyphicon glyphicon-link" aria-hidden="true"></span><span data-i18n="wdqs-app-button-link"></span><span class="caret"></span></a><ul class="dropdown-menu"><li><a href="#" class="shortUrlTrigger result" target="_blank" data-i18n="[title]wdqs-app-result-shorturl-title" data-toggle="popover"><span data-i18n="wdqs-app-result-shorturl"></span></a></li><li><a target="_blank" class="queryUri" data-i18n="[title]wdqs-app-result-endpoint-title"><span data-i18n="wdqs-app-result-endpoint"></span></a></li><li><a href="#" class="embed result" target="_blank" data-toggle="popover" data-i18n="wdqs-app-result-embed"></a></li><li role="separator" class="divider"></li><li><a target="_blank" rel="noopener" class="rawGraphsUri" data-i18n="[title]wdqs-app-result-rawgraphs-title"><span class="glyphicon glyphicon-export"></span> <span data-i18n="wdqs-app-result-rawgraphs"></span></a></li></ul></li></ul></nav></div><div class="row action-bar"><div class="message"></div></div><div class="row"><div id="query-result">Test result</div></div><div class="row"><div id="query-error" class="panel-heading"></div></div><div class="row"><div id="empty-query-error" class="text-center"><p data-i18n="wdqs-action-empty-query"></p><button type="button" class="btn navbar-btn btn-default" id="open-example" data-toggle="modal" data-target="#QueryExamples"><span class="fa fa-folder-open-o"></span> <span data-i18n="wdqs-app-button-examples" id="examples-label"></span></button></div></div><div class="row"><div id="loading-spinner"><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i> <span class="sr-only">Loading...</span></div></div><div id="explorer-dialogs"><div class="explorer-dialog"><div data-role="header" class="modal-header clearfix explorer-header"><h3 data-role="title" class="modal-title pull-left explorer-title">Explorer</h3><button data-role="close" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button></div><div data-role="body" class="explorer-body"></div></div></div></div><div class="modal fade QueryExamples" id="QueryExamples" tabindex="-1" role="dialog" aria-labelledby="QueryExamplesModalLabel"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-body"><div class="tagCloud"></div><div class="tagFilter"></div><div class="input-group"><span class="input-group-addon"><span class="glyphicon glyphicon-filter" aria-hidden="true"></span></span> <input type="text" class="tableFilter form-control" placeholder="Type to filter"> <span class="input-group-addon"><span class="badge count"></span></span></div><div class="exampleTable"><table class="table"><tbody class="searchable"></tbody></table></div></div></div></div></div><div class="modal" id="keyboardShortcutHelpModal" tabindex="-1" role="dialog" aria-labelledby="keyboardShortcutHelpModalLabel" aria-hidden="true"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="keyboardShortcutHelpModalLabel" data-i18n="wdqs-dialog-key-shortcut-title"></h5></div><div class="modal-body"><table class="keyboard-shortcut-help"><tbody><tr><th scope="row"><kbd><kbd>ctrl</kbd>+<kbd>enter</kbd></kbd></th><td data-i18n="wdqs-dialog-key-shortcut-run-query"></td></tr><tr><th scope="row"><kbd>esc</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-esc"></td></tr><tr><th scope="row"><kbd>?</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-show-shortcut-help"></td></tr><tr><th scope="row"><kbd>i</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-focus-textarea"></td></tr><tr><th scope="row"><kbd>r</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-jump-to-result"></td></tr><tr><th scope="row"><kbd>f</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-focus-filter"></td></tr><tr><th scope="row"><kbd>s</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-focus-show"></td></tr><tr><th scope="row"><kbd>m</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-focus-limit"></td></tr><tr><th scope="row"><kbd>e</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-show-example"></td></tr><tr><th scope="row"><kbd>h</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-help-menu"></td></tr><tr><th scope="row"><kbd>l</kbd></th><td data-i18n="wdqs-dialog-key-shortcut-show-language"></td></tr></tbody></table></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="wdqs-dialog-key-shortcut-close-button"></button></div></div></div></div><div class="modal fade CodeExamples" id="CodeExamples" tabindex="-1" role="dialog" aria-labelledby="CodeExamplesModalLabel"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-body"><div><ul class="nav nav-tabs" role="tablist"></ul><div class="tab-content"></div></div></div></div></div></div><script src="js/vendor.min.a6f355d5018fdbb467fb.js"></script><script src="js/wdqs.min.0968a8fe8abab9fafb2d.js"></script></body></html>'
https://query.wikidata.org/#%23Items%20around%20with%20user%20location%0A%23defaultView%3AMap%7B%22layer%22%3A%22%3Finstance_ofLabel%22%7D%0ASELECT%20%3Fplace%20%3FplaceLabel%20%3Fimage%20%3Fcoordinate_location%20%3Fdist%20%3Finstance_of%20%3Finstance_ofLabel%20WHERE%20%7B%0A%20%20SERVICE%20wikibase%3Aaround%20%7B%0A%20%20%20%20%3Fplace%20wdt%3AP625%20%3Fcoordinate_location.%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Acenter%20%22%5BAUTO_COORDINATES%5D%22.%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Aradius%20%221%22.%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Adistance%20%3Fdist.%0A%20%20%7D%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%20%20OPTIONAL%20%7B%20%3Fplace%20wdt%3AP18%20%3Fimage.%20%7D%0A%20%20OPTIONAL%20%7B%20%3Fplace%20wdt%3AP31%20%3Finstance_of.%20%7D%0A%7D
    
from IPython.core.display import display, HTML
display(HTML("""<a href="https://google.at">text</a>"""))
But it does not take the type and also it's mostly districts, human settlements etc.
# This query will give items around the rescue place
SELECT ?place ?location ?distance ?placeLabel WHERE {
    SERVICE wikibase:around { 
      ?place wdt:P625 ?location . 
      bd:serviceParam wikibase:center "Point(LONG LAT)"^^geo:wktLiteral .
      bd:serviceParam wikibase:radius "5"  
      bd:serviceParam wikibase:distance ?distance .
    } 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?distance LIMIT 100
SELECT ?place ?location ?distance ?placeLabel ?type ?typeLabel WHERE {
    SERVICE wikibase:around { 
      ?place wdt:P625 ?location . 
      bd:serviceParam wikibase:center "Point(76.3230197 10.0021295)"^^geo:wktLiteral .
      bd:serviceParam wikibase:radius "5" . 
      bd:serviceParam wikibase:distance ?distance .
    } 
    ?place wdt:P31 ?type .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?distance LIMIT 100
Gives the layers in the map by typelabel
SELECT ?place ?location ?distance ?placeLabel ?type ?layer WHERE {
    SERVICE wikibase:around { 
      ?place wdt:P625 ?location . 
      bd:serviceParam wikibase:center "Point(76.3230197 10.0021295)"^^geo:wktLiteral .
      bd:serviceParam wikibase:radius "5" . 
      bd:serviceParam wikibase:distance ?distance .
    } 
    ?place wdt:P31 ?type .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?type rdfs:label ?layer }
} ORDER BY ?distance LIMIT 100
data_c.location.unique()
array(['East kadangallur', 'Test', 'Muvattupuzha', ...,
       'Cheriya Pallamthuruth', 'Thottappuzhassery, Near MTLP School',
       'Alua , East kodungaloor, near Rajasree school'], dtype=object)
ll = data_c[['location','lat','long']]
coordsperlocation = ll.groupby(['location'])['lat','long'].size()
coordsperlocation.head()
location
"Mennu". Kairali Junction. Chendamangalam                                                                                          1
#15 M-T Link road, Malikampeedia-Thrivaloor, Alangad, Alwaye                                                                       1
(10.1214301,76.3535502) - Siddhi Vinayaka Apartments, Temple road, Thottakattukara, Aluva.                                         1
(100 members} cheruvallur post office ,phasarical temple,nss  high school ground,south trapped at second floor house.Chalakudy.    1
(9.3316841,76.6719234), Paradayil Manohara, Edayaranmula.                                                                          1
dtype: int64
there is a tableau public
https://public.tableau.com/profile/jithesh4829#!/vizhome/MissionKeralaRescue/MissionKeralaRescue?publish=yes