This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # update <username> with your linux username | |
| # mkdir -p ~/.local/bin | |
| # touch ~/.local/bin/wcle | |
| # put this line in the file ~/.local/bin/wcle | |
| python3 /home/<username>/.local/bin/wcle.py $1 | |
| # chmod +x ~/.local/bin/wcle | |
| # copy the file wcle.py to ~/.local/bin/ | |
| # enjoy! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| id,name,amount | |
| 109,"building",1456894 | |
| 164,"house",1383613 | |
| 7,"Shopping and services",839415 | |
| 17,"store / shop",831628 | |
| 203,"school",676869 | |
| 4,"dining and leisure",671035 | |
| 74,"restaurant",385073 | |
| 194,"park",283545 | |
| 163,"sport venue",274433 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """A demo to classify image.""" | |
| import argparse | |
| from edgetpu.classification.engine import ClassificationEngine | |
| from PIL import Image | |
| # Function to read labels from text files. | |
| def ReadLabelFile(file_path): | |
| with open(file_path, 'r') as f: | |
| lines = f.readlines() | |
| ret = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I followed these two blogs to install server | |
| 1. http://koo.fi/blog/2015/03/19/openstreetmap-nominatim-server-for-geocoding/#Compile_Nominatim | |
| This explains ( and is the main blog which I followed) various steps | |
| 2. https://www.linuxbabe.com/linux-server/openstreetmap-tile-server-ubuntu-16-04 | |
| This explains how to setup swap files and install tiles if needed. | |
| I will use Ubuntu 14.04 LTS as the platform. Just a basic install with ssh server. We will install Apache to serve http requests. Make sure you have enough disk space and RAM to hold the data and serve it efficiently. I used the Finland extract, which was about a 200 MB download. The resulting database was 26 GB after importing, indexing and adding Wikipedia data. The Wikipedia data probably actually took more disk space than the OSM data. My server has 4 GB RAM, which seems to be enough for this small data set. | |
| 1. Sofware requirements |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from redis import Redis | |
| import simplejson | |
| class Resque(object): | |
| """Dirt simple Resque client in Python. Can be used to create jobs.""" | |
| redis_server = 'localhost:6379' | |
| def __init__(self): | |
| host, port = self.redis_server.split(':') | |
| self.redis = Redis(host=host, port=int(port)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bufio" | |
| "log" | |
| "os" | |
| ) | |
| var concurrency = 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| reload(sys) | |
| sys.setdefaultencoding("utf-8") | |
| import quadtree | |
| def main(): | |
| #adopted from https://github.com/hkwi/python-geohash | |
| #set up spatial coordinate system |