Giter Site home page Giter Site logo

idone / coorzip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevmuko/coorzip

0.0 2.0 0.0 5.84 MB

CoorZip is a utility that imports CSV (Excel documents) that contain latitude/longitude coordinates or individual coordinates and converts them to U.S. Postal Zipcodes through Google's & Yahoo's Reverse Geocoding API by JSON or XML parsing.

Home Page: http://uhelios.com

coorzip's Introduction

CoorZip (made by: Kevin Ko aka uhelios)
http://uhelios.com

UPDATE 2:
- Saves Result in a Text File
- More efficient

UPDATE 3:
- Enables individual coordinate conversion
- Added Icon

UPDATE 4:
- Made cool-down faster
- Minor bug fixed

UPDATE 5:
- Compatible with 10.6+
- Fixed memory leak (now much faster)

UPDATE 6:
- Added XML (uses yahoo's)

UPDATE 7: 
- Parsing error in CSV fixed

UPDATE 8:
- Added option to stop the conversoin (XML only)
- Garbage Collection enabled (XML only)
- Increased Speed (XML only)

CoorZip is a utility that imports CSV (Excel documents) that contain latitude/longitude coordinates or individual
coordinates and converts them to U.S. Postal Zipcodes through Google's & Yahoo's Reverse Geocoding API by JSON or XML parsing.

Example of a CSV document that can be used:

48.85,-92.55
48.85,-92.45
48.75,-123.65
48.75,-123.55
48.75,-123.45
48.75,-123.35
48.75,-123.25
48.75,-123.15
48.75,-123.05
48.75,-122.95

CSV documents are basically text files that contain a comma as a separator between each column.
Thus, you can just make a simple text file and rename the extension to .csv to fit your needs.
*Note: This utility only reads CSV documents as floats, NOT STRINGS/TEXT! So get rid of the quotation marks!*

As CoorZip imports the data, you are able to execute these coordinates to be converted into zipcodes based
on Google's Reverse Geocoding API found here: http://code.google.com/apis/maps/documentation/geocoding/
and Yahoo's PlaceFinder API found here: http://developer.yahoo.com/geo/placefinder/

The format for the URL, as shown in the documentation, is as so:

(google) http://maps.googleapis.com/maps/api/geocode/json?latlng={latitude},{longitude}&sensor=true

Replacing {latitude} & {longitude} with the appropriate coordinate values.
By loading this URL through CoorZip and finding the return value, it provides us with all the necessary
information to find the postal zip code.

The return value is in JSON or XML format, which is preferred because of its quick and easy
parsing methods. To parse the JSON, CoorZip uses the yajl-objc framework. 

A NSArray is formed by taking the raw JSON and using [json YAJL_JSON];
Where json is the return value from the Google API.

For XML, we simply ignore everything except between the <postal></postal> tags. This is only for
Yahoo's API.

From this we can easily search the NSArray and the sub-arrays for the postal_code.
We loop this until the CSV document has reached its end and leaving 4/10 of a second to "cool off" and
prevent a memory-overload (for cases if you have over 1,000 pairs in the CSV document).

*Note: Google's Reverse Geocoding only allows 2,500 queries per day!!*
*Note: Yahoo's PlaceFinder allows 50,000 queries per day!!*

Finally, we make it so that it saves the result into a text file on the desktop named coorzip.txt.

coorzip's People

Watchers

James Cloos avatar YoungDone 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.