Containerizes application #12
moved files into subdirs
							
								
								
									
										4
									
								
								data_handler_python/Containerfile
									
										
									
									
									
										Normal file
									
								
							
							
						
						|  | @ -0,0 +1,4 @@ | ||||||
|  | FROM quay.io/fedora/fedora-minimal:43 | ||||||
|  | RUN microdnf install -y python-pip && microdnf clean all && pip install OSMPythonTools | ||||||
|  | 
 | ||||||
|  | COPY ./lookup_country.py /opt/ | ||||||
							
								
								
									
										7
									
								
								data_handler_python/lookup_country.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						|  | @ -0,0 +1,7 @@ | ||||||
|  | from OSMPythonTools.nominatim import Nominatim | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | nominatim = Nominatim() | ||||||
|  | heidelberg = nominatim.query(49.4093582, 8.694724, reverse=True, zoom=10) | ||||||
|  | 
 | ||||||
|  | print(heidelberg.address()['country_code']) | ||||||
							
								
								
									
										12
									
								
								data_handler_python/test.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						|  | @ -0,0 +1,12 @@ | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import xml.etree.cElementTree as ET | ||||||
|  | import gzip | ||||||
|  | import requests | ||||||
|  | 
 | ||||||
|  | r = requests.get('https://planet.openstreetmap.org/replication/minute/000/000/001.osc.gz') | ||||||
|  | 
 | ||||||
|  | data = gzip.decompress(r.content) | ||||||
|  | 
 | ||||||
|  | tree = ET.fromstring(data) | ||||||
|  | print(tree.findall("./.")) | ||||||
| After Width: | Height: | Size: 1.2 KiB | 
| After Width: | Height: | Size: 696 B | 
| After Width: | Height: | Size: 2.4 KiB | 
| After Width: | Height: | Size: 1.4 KiB | 
| After Width: | Height: | Size: 618 B | 
| Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB | 
| Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB | 
| Before Width: | Height: | Size: 1,003 B After Width: | Height: | Size: 1,003 B |