Giter Club home page Giter Club logo

lla's Introduction

Latitude and Longitude to Address

import from coding

Introduction

LLA(Latitude and longitude to Address) is a little script convert latitude and longitude position to address using baidu API, which uses a tool to convert Latitude and Longitude to Mercator Coordinate, and then get data from Baidu. All the injected logic is based on saitjr's blog and his repo. The command line interface is done by myself.

It may only enable address in Mainland China.

Requirement

  1. Python3 or later version (As for the setup.sh script, it may disable in other system exclude macOS)
  2. pip dependency:
    1. xlrd
    2. xlwt
    3. requests
    4. gcc or clang

A depressing stuff is, the setup srcipt doesnot work most of the time. You should install dependencies manually.

Instant method

  1. Interactive mode: input a longitude and latitude, which is seperated by space, and then output a address.
    Notes: both space and comma are okey. Because it is parsed by regex At this moment interactive is ready to be used
    $python3 lla.py -i
    113.658023 23.098621
    广东省东莞市东莞市市辖区觉华路32
    113.658023,23.098621
    广东省东莞市东莞市市辖区觉华路32
    113.800681,23.039038
    广东省东莞市东莞市市辖区振兴路100号
    
    You could input any other thing causing an error to quit. :(
  2. TXT mode: input a directory of a txt file, which is formatted into particular format. Output to a file or append it to the back of each line. format:
    longitude latitude
    123 55
    
    The first line must include header, if not, it will cause an error and exit.
  3. xls mode: read ll from xls, then output address. The xls should include two colums, which refer to longitude and latitude. format:
        (A)   	  (B)
    (1) longitude latitude
    (2) 123       55
    
    Format is important!
  4. Both txt mode and xls mode should give param "file", or "-a" regard appending to each line.

Usage

Install dependency

Before using this script, you should install python3.5 or later version. Then run script setup.sh

chmod a+x setup.sh
./setup.sh

This script will compile the dynamic lib and check your dependency of python module. If it can't be used, you could install module manually, including requests, json, xlrd, xlwt.

python3 -m pip install MODULE
Usage
usage: python3 lla.py [-h] [-i] [-rt TXT] [-rx XLS] [-ox XLSDEST] [-ot TXTDEST] [-a] [-v]

Latitude and Longitude to Address

optional arguments:
  -h, --help          show this help message and exit
  -i, --intereactive  Interactive mode. Input 'q' to quick
  -rt TXT, --txt TXT  Read from txt(see docs for format)
  -rx XLS, --xls XLS  Read from xls
  -ox XLSDEST         Write to xls
  -ot TXTDEST         Write to txt
  -a                  Appending mode(write out only)
  -v, --version       show program's version number and exit

Notes

  • xlsx is currently not supported.
  • Three args of -i, -rt and -ox could be parsed with one. Otherwise, they are relevantly exclusive.
  • ox, ot are obay the same rule as above.
  • If you have any suggestions, please open an issue or PR.
  • Feel free to fork it.

Help wantted and might being implemented

  1. Fix bug and function implementation
  2. Let me see.....
  3. setup script is not very okey.

Help wantted but does not plan to implement

  1. Convert address to Latitude and Longitude using the baidu API
  2. Mercator Coordinate to Latitude and Longitude
  3. Suspecious api filter by Burp Suite: Here It response a lot of message, but only a Mercator Point is our target

lla's People

Contributors

wxk6b1203 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.