This Python script retrieves address coordinates data from the Kinmen Urban Development Bureau website.
- Retrieves town, road, lane, alley, and door information from the Kinmen Urban Development Bureau website.
- Uses multi-threading to process multiple towns concurrently.
- Converts coordinates from TWD97 to WGS84.
- Logs information about the retrieval process.
- Writes the retrieved coordinates to a CSV file.
- Python 3.x
- requests
- loguru
- pyproj
- beautifulsoup4
-
Clone the repository:
git clone https://github.com/skyksl066/getKinmenAddressCoordinates.git
-
Install dependencies:
pip install -r requirements.txt
-
Run the script:
python app.py
-
The retrieved coordinates will be saved in a CSV file named
data.csv
.
MAX_RETRIES
: Maximum number of retries for failed requests.API
: URL for the API used to retrieve data.LOG_PATH
: Path to the log file.CSV_FILE
: Path to the CSV file to save coordinates.FIELDNAMES
: Names of the fields in the CSV file.RESUME_FILE
: Path to the file to store processed locations.BATCH_SIZE
: Number of towns to process concurrently.
The index.html
file in this project serves as the user interface for displaying the retrieved data. It offers the following functionality:
- Bootstrap Integration: Utilizes Bootstrap 5 for consistent styling and responsive layout.
- DataTables Integration: Incorporates DataTables to enable interactive table features.
- Theme Detection: Detects the system's preferred color scheme and applies it to the UI for a cohesive user experience.
- Ensure internet connectivity for the program to work.
- The program may take some time to complete processing, depending on the number of towns and roads.