Skip to content

Commit e754e2e

Browse files
authored
Merge pull request #695 from kshittijagrawal/geocordinate
Added geocordinate_locating_tool directory with 3 files.
2 parents 3a1626b + 0ea0e4a commit e754e2e

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

geocordinate_locating_tool/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Geocordinates Locating Tool
2+
This script asks the user to enter any location and returns the latitudinal and longitudinal coordinates specific to the address entered.
3+
4+
## Requirements
5+
There's a file provided in the repository named `requirements.txt`. Run the following command after changing to the local folder holding the files.
6+
7+
```
8+
pip install -r requirements.txt
9+
```
10+
This should download any necessary library required for running the tool.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
from tkinter import Label, StringVar, Button, END, Entry, Tk
2+
from geopy.geocoders import ArcGIS
3+
import clipboard
4+
5+
6+
def f():
7+
s = e1.get()
8+
nom = ArcGIS()
9+
n = nom.geocode(s)
10+
x = n.latitude
11+
y = n.longitude
12+
t.delete(first=0, last=len(t1.get()))
13+
u.delete(first=0, last=len(u1.get()))
14+
t.insert(END, str(x))
15+
u.insert(END, str(y))
16+
17+
18+
def g():
19+
x = t1.get()
20+
y = u1.get()
21+
s = ""
22+
s = s + "Latitude=> " + x
23+
s = s + " "
24+
s = s + "Longitude=> " + y
25+
# print(s)
26+
clipboard.copy(s)
27+
28+
29+
window = Tk()
30+
window.title("Geocordinate Detector")
31+
window.resizable(0, 0)
32+
33+
l1 = Label(window, text="Enter your Address")
34+
l1.grid(row=0, column=0)
35+
36+
e1 = StringVar()
37+
e = Entry(window, textvariable=e1, width=50)
38+
e.grid(row=0, column=1)
39+
40+
b1 = Button(window, text="Locate Me!", width=40, command=f)
41+
b1.grid(row=1, column=0, columnspan=2)
42+
43+
l2 = Label(window, text="Latitude")
44+
l2.grid(row=2, column=0)
45+
46+
l3 = Label(window, text="Longitude")
47+
l3.grid(row=3, column=0)
48+
49+
t1 = StringVar()
50+
t = Entry(window, textvariable=t1, width=50)
51+
t.grid(row=2, column=1)
52+
53+
u1 = StringVar()
54+
u = Entry(window, textvariable=u1, width=50)
55+
u.grid(row=3, column=1)
56+
57+
b2 = Button(window, text="Copy", width=40, command=g)
58+
b2.grid(row=4, column=0, columnspan=2)
59+
60+
window.mainloop()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tkinter==8.6.10
2+
geopy==2.0.0
3+
clipboard==8.6.10

0 commit comments

Comments
 (0)