Code Monkey home page Code Monkey logo

citipy's People

Contributors

afhaque avatar collectionofatoms avatar mxashup avatar wingchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

citipy's Issues

citypy error - AttributeError: '_csv.reader' object has no attribute '__next__'

Getting an error when I try to use the command
from citipy import citipy

Already installed citipy using pip comamnd

12 # Incorporated citipy to determine city based on latitude and longitude
---> 13 from citipy import citipy
14
15
C:\Users\213062180\AppData\Local\Continuum\anaconda2\lib\site-packages\citipy\citipy.py in ()
24
25 # discard the headers
---> 26 cities.next()
27
28 # populate geo points into kdtree
AttributeError: '_csv.reader' object has no attribute 'next'

Data Set is flawed: Santa Monica, Philippines has incorrect location data.

I had latitude and longitude values that placed me right next to Manila, Philippines, but for some reason, citipy would return Santa Monica as the nearest city. Even though there is a Santa Monica in the Philippines, it is some 100+ miles away from Manila.

If you want to look into the citipy error I encountered, you can try to recreate it yourself:

lat = 15.325736570808928
lng = 120.73129576518153
print(f"{citipy.nearest_city(lat, lng).city_name}")

When I run this, it returns santa monica. Notice that Santa Monica, Philippines is located at approximately (10.12651, 126.04144). Off by about 5 degrees in both latitude and longitude. Citipy does not work as expected here, and I imagine it is due to some flaw in the data set that citipy is based off of. I haven't tested very many other data points and checked, because it's rather time consuming.

I checked the csv, and line 32940 has the following:

ph,santa monica,15.35771,120.72006

This is incorrect, unless google maps' location data cannot be trusted, which is how I verified this. Not sure if you want to make an explicit change to the csv itself considering you probably reload that data every so often, but I wanted to note this error. Perhaps it can be forwarded up the line.

Support for Python 3.5?

Great Library! Very handy. Worked well for a Python 2.7 project.

Unfortunately, not so well with a Python 3.5 project. Import doesn't seem to work. I'll look at your code to see if this a quick fix

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-b49a8be8dcc2> in <module>()
      9 
     10 # Incorporated citipy to determine city based on latitude and longitude
---> 11 from citipy import citipy
     12 
     13 # Output File (CSV)

C:\Users\Ahmed\Anaconda3\envs\PythonData\lib\site-packages\citipy\citipy.py in <module>()
     24 
     25     # discrad the headers
---> 26     cities.next()
     27 
     28     # populate geo points into kdtree

AttributeError: '_csv.reader' object has no attribute 'next'

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.