Giter VIP home page Giter VIP logo

python-geohash's Introduction

* python-geohash
python-geohash is a fast, accurate python geohashing library.

** History
python-geohash 0.8 introduced uint64 representation.

python-geohash 0.7.1 starts supporting python3k.

python-geohash 0.3 can create C extension. If you want to use python-geohash
without C extension, simply copy geohash.py into your system. geohash.py will
work fine without C extension.

** LICENSE
Code is licensed under Apache License 2.0, MIT Licence and NEW BSD License.
You can choose one of these licences. Declarations follow:

*** Apache License 2.0
   Copyright 2011 Hiroaki Kawai

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

*** MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*** New BSD License
Copyright (c) 2011, Hiroaki Kawai
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the python-geohash nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Hiroaki Kawai BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

python-geohash's People

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  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  avatar

python-geohash's Issues

It seems like there is a reasonably high level of inaccuracy compared to geohasher

What steps will reproduce the problem?

>>> import geohash
>>> geohash.encode_uint64(51.566141,-0.009434)
15006294212117284100L
>>> geohash.decode_uint64(15006294212117284100L)
(51.56614095903933, 0.0)

>>> geohash.encode(51.566141,-0.009434)
'u10j2524812h'
>>> geohash.decode('u10j2524812h')
(51.56614095903933, 1.6763806343078613e-07)


>>> from geohasher import hasher
>>> hasher.encode(51.566141,-0.009434)
8857379509972789038
>>> hasher.decode(8857379509972789038)
(51.56614095903933, -0.0094340834766626358)


What is the expected output? What do you see instead?
I would expect that the decoded code would be within a hundred meters or so of 
the encoded distance.  The geohasher module seems to do this.

What version of the product are you using? On what operating system?
0.83.  Reproduced on Ubuntu 10.10 and Mac OS X 10.6.7

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 4 Jun 2011 at 3:36

Raise specific exception

What steps will reproduce the problem?
1. Provide invalid longitude (i.e 90) to encode
2. Check exception type

What is the expected output? 
I expect a specific exception type to catch

What do you see instead?
General exception of Exception type which caught might prevent me from seeing 
other issues.


What version of the product are you using? On what operating system?
python-geohash 0.8.5

Original issue reported on code.google.com by [email protected] on 3 Mar 2015 at 11:17

geohash.encode returns different results if c library is used

What steps will reproduce the problem?
1. Try the geohash.encode method on the same coordinates with the _geohash c
library present and without

What is the expected output? What do you see instead?

Without _geohash C library:

>>> geohash.encode(63.537551615736049, -135.59328029278211)
'bgr96qxvpd46'

With _geohash C library:

>>> geohash.encode(63.537551615736049, -135.59328029278211)
'bgr96qsj0444'

What version of the product are you using? On what operating system?

python-geohash 0.6, python 2.6.1, OS X 10.6

Please provide any additional information below.

I'm pretty sure the response when using pure Python is the correct one (as the 
result when decoding has the least error). When I decode both of these 
responses, it looks like the error is in the longitude only (as the latitudes 
match):

>>> geohash.decode('bgr96qxvpd46')
(63.537551583722234, -135.59327999129891)
>>> geohash.decode('bgr96qsj0444')
(63.537551583722234, -135.59875203296542)

Original issue reported on code.google.com by [email protected] on 25 Aug 2010 at 11:47

pip install on Windows 10 Python 3.6.6 FAILS

(demo) (base) c:\superset\demo\Scripts>pip install python-geohash
Collecting python-geohash
Using cached https://files.pythonhosted.org/packages/9c/e2/1a3507af7c8f91f8a4975d651d4aeb6a846dfdf74713954186ade4205850/python-geohash-0.8.5.tar.gz
Building wheels for collected packages: python-geohash
Building wheel for python-geohash (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\superset\demo\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\username\AppData\Local\Temp\pip-install-2_q8h1nq\python-geohash\setup.py'"'"'; file='"'"'C:\Users\username\AppData\Local\Temp\pip-install-2_q8h1nq\python-geohash\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\username\AppData\Local\Temp\pip-wheel-8f2vkeqi' --python-tag cp37
cwd: C:\Users\username\AppData\Local\Temp\pip-install-2_q8h1nq\python-geohash
Complete output (22 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying geohash.py -> build\lib.win-amd64-3.7
copying quadtree.py -> build\lib.win-amd64-3.7
copying jpgrid.py -> build\lib.win-amd64-3.7
copying jpiarea.py -> build\lib.win-amd64-3.7
running build_ext
building '_geohash' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON_MODULE=1 -Ic:\programdata\anaconda3\include -Ic:\programdata\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /EHsc /Tpsrc/geohash.cpp /Fobuild\temp.win-amd64-3.7\Release\src/geohash.obj
geohash.cpp
src/geohash.cpp(383): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
src/geohash.cpp(428): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
src/geohash.cpp(429): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
src/geohash.cpp(528): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
c:\programdata\anaconda3\include\pyconfig.h(215): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

ERROR: Failed building wheel for python-geohash
Running setup.py clean for python-geohash
Failed to build python-geohash
Installing collected packages: python-geohash
Running setup.py install for python-geohash ... error
ERROR: Command errored out with exit status 1:
command: 'c:\superset\demo\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\lysak\AppData\Local\Temp\pip-install-2_q8h1nq\python-geohash\setup.py'"'"'; file='"'"'C:\Users\lysak\AppData\Local\Temp\pip-install-2_q8h1nq\python-geohash\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\lysak\AppData\Local\Temp\pip-record-i3ibyuj2\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\superset\demo\include\site\python3.7\python-geohash'
cwd: C:\Users\lysak\AppData\Local\Temp\pip-install-2_q8h1nq\python-geohash
Complete output (22 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying geohash.py -> build\lib.win-amd64-3.7
copying quadtree.py -> build\lib.win-amd64-3.7
copying jpgrid.py -> build\lib.win-amd64-3.7
copying jpiarea.py -> build\lib.win-amd64-3.7
running build_ext
building '_geohash' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON_MODULE=1 -Ic:\programdata\anaconda3\include -Ic:\programdata\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /EHsc /Tpsrc/geohash.cpp /Fobuild\temp.win-amd64-3.7\Release\src/geohash.obj
geohash.cpp
src/geohash.cpp(383): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
src/geohash.cpp(428): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
src/geohash.cpp(429): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
src/geohash.cpp(528): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
c:\programdata\anaconda3\include\pyconfig.h(215): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\superset\demo\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\lysak\AppData\Local\Temp\pip-install-2_q8h1nq\python-geohash\setup.py'"'"'; file='"'"'C:\Users\lysak\AppData\Local\Temp\pip-install-2_q8h1nq\python-geohash\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\lysak\AppData\Local\Temp\pip-record-i3ibyuj2\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\superset\demo\include\site\python3.7\python-geohash' Check the logs for full command output.

(demo) (base) c:\superset\demo\Scripts>

install error at python 3.6.5

Encountering below error when building wheel for geohash.

warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  sasl/saslwrapper.cpp:249:10: fatal error: 'string' file not found
  #include <string>
           ^~~~~~~~
  1 warning and 1 error generated.
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for sasl

I did cmd pip install python-geohash

Getting neighbors for encode_uint64

I think we need an extra method when you encode with encode_uint64 for getting neighbors. Right now it will only with work with character geohash implementation.

This is the code I am using

       ghash = gh.encode_uint64(lat,lon)
       neighbors = gh.neighbors(ghash)

This is the error I am getting -

Traceback (most recent call last):
  File "test4.py", line 123, in <module>
    main()
  File "test4.py", line 30, in main
    neighbors = gh.neighbors(ghash)
  File "/usr/local/lib/python3.6/dist-packages/python_geohash-0.8.5-py3.6-linux-x86_64.egg/geohash.py", line 239, in neighbors
    if _geohash and len(hashcode)<25:
TypeError: object of type 'int' has no len()

test: please uncomment main function invocation

The test scripts:
test/test_decode.py
test/test_encode.py
test/test_neighbors.py

all have the last two lines commented:
# if __name__=='__main__':
#       unittest.main()

This makes it difficult to automatically run the tests on package build (e.g. 
in the Debian packaging I had to patch the files to uncomment those lines). 
Could you please uncomment those lines, or suggest another way to 
programmatically run the tests?


Original issue reported on code.google.com by [email protected] on 14 Feb 2011 at 3:36

encode_uint64 / decode_uint64 cause unpredicted behavior

when encoding and then decoding a uint64 geohash, I'm seeing very strange 
behavoid:

What steps will reproduce the problem?
see example:
>>> x = geohash.encode_uint64(35,35)
>>> geohash.decode_uint64(x)
(35.000000009313219, 35.000000009313219)
>>> geohash.decode_uint64(x)
SystemError: ../Objects/longobject.c:992: bad argument to internal function
>>> geohash.decode_uint64(x)
(35.000000009313219, 35.000000009313219)
>>> geohash.decode_uint64(x)
SystemError: ../Objects/longobject.c:992: bad argument to internal function

and so on.....
this happens also if i just print x right after the decoding.
needless to say this makes the module very unpredictable...

This happens on ubuntu 10.10 64 bit, python 2.6, geohash freshly installed from 
pypi (0.8.1)

Original issue reported on code.google.com by [email protected] on 27 Mar 2011 at 5:00

python-geohash-0.2.tar.gz is gzipped twice

The file at
http://python-geohash.googlecode.com/files/python-geohash-0.2.tar.gz
appears to be gzipped twice. This prevents pip and easy_install from
working with python-geohash, and doing "tar xvfz" manually doesn't work:

$ tar xvfz python-geohash-0.2.tar.gz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors

However, if I gunzip the file first, then "tar xvfz" works:

$ gunzip python-geohash-0.2.tar.gz
$ tar xvfz python-geohash-0.2.tar   
python-geohash-0.2/
...

Original issue reported on code.google.com by [email protected] on 12 Nov 2009 at 6:53

Is this supported anymore?

if supported:
    `https://github.com/hkwi/python-geohash/pull/24`
else:
    `https://github.com/todogroup/guides/blob/master/shutting-down-an-open-source-project.md`

Order of items in geohash.neighbors does not match documentation.

The documentation shows:

>>> geohash.neighbors('ezs42')
['ezefr', 'ezs43', 'ezefx', 'ezs48', 'ezs49', 'ezefp', 'ezs40', 'ezs41']

I get the following when I run the same line in OSX on python-geohash==0.8.4:

Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin

>>> geohash.neighbors('ezs42')
['ezefr', 'ezs43', 'ezs40', 'ezefp', 'ezs41', 'ezs48', 'ezefx', 'ezs49']

If the order is indeterminate a dict would be a better choice so that you could 
predictably get a specific neighboring geohash.

Original issue reported on code.google.com by [email protected] on 18 Jul 2012 at 10:44

Doesn't get enough neighbors

I have two position: 
postion 1: 106.526802369906,10.952859455425 (longitude - latitude)
postion 2: 106.528055,10.958879

The distance between these position is about 600m. However, when I check 
neighbors of the first one, I couldn't find out the second one. Because their 
hashcodes are w3gy21 and w3gy25 which are not close each other.

Please help me explain this situation.

Thank you,
Hung

Original issue reported on code.google.com by [email protected] on 10 Apr 2012 at 12:34

C _geohash extension does not build on Windows

What steps will reproduce the problem?

Run python setup.py build in a cmd.exe Terminal on a Windows XP machine.

What is the expected output?

A successful build.

What do you see instead?

C:\python-geohash-0.5>python setup.py build
running build
running build_py
running build_ext
building '_geohash' extension
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox 
/MD /W3 /GS- /DNDEBUG -DPYTHON_MODULE=1 -Ic:\python26\include -
Ic:\python26\PC /Tcsrc/
geohash.c /Fobuild\temp.win32-2.6\Release\src/geohash.obj
geohash.c
src/geohash.c(3) : fatal error C1083: Cannot open include file: 'stdint.h': 
No such file or directory
error: command '"C:\Program Files\Microsoft Visual Studio 
9.0\VC\BIN\cl.exe"' failed with exit status 2

What version of the product are you using? On what operating system?

python-geohash 0.5 on Windows XP SP 3 (no Cygwin).

Please provide any additional information below.

Note that even if a 3rd-party stdint.h is installed (e.g. pstdint.h from 
http://www.azillionmonkeys.com/qed/pstdint.h), the build still fails on the 
include of sys/param.h, which is not present on Windows.

If you don't intend Windows to be a supported platform, then please feel 
free to just close this ticket. But you might want to mention the supported 
platforms on the Project Home page.

Original issue reported on code.google.com by [email protected] on 27 May 2010 at 8:17

Bad geohashes

1. Install geohash with C extension
2. check f.e. geohash.encode(51.519716,-0.0744654)
3. Result should be gcpvn6cu0g4s but is u10j04bh050h (0 as longitude)

Pure Python implementation is working fine.

Original issue reported on code.google.com by [email protected] on 20 Sep 2011 at 2:09

Latitude -90 is treated as invalid value

What steps will reproduce the problem?
1. Pass for example -90 to encode
2. Watch the exception being raised.


def encode(latitude, longitude, precision=12):
    if latitude >= 90.0 or latitude < -90.0:
        raise Exception("invalid latitude.")

What is the expected output? What do you see instead?
If I'm not wrong -90 is still correct value. it's south pole.


Original issue reported on code.google.com by [email protected] on 3 Mar 2015 at 11:24

Compatible with Py3k, fixed cpp code warning and styles

I was trying to use python-geohash on Python 3.4.0. But it didn't work.

So I updated the code for py2k and py3k compatible.

All the codes are hosted on Github: https://github.com/zonyitoo/python-geohash

I hope it can be merged into the main stream. Thanks.

Original issue reported on code.google.com by [email protected] on 17 May 2014 at 5:40

geohash.bbox returns different results if c library is used

What steps will reproduce the problem?
1. Try the geohash.bbox method on the same geohash with the _geohash c
library present and without

What is the expected output? What do you see instead?

Without _geohash C library:

>>> geohash.bbox('b')
{'e': -135.0, 'n': 90.0, 's': 45.0, 'w': -180.0}

With _geohash C Library:

>>> geohash.bbox('b')
{'e': -180.0, 'n': 90.0, 's': 45.0, 'w': -135.0}


What version of the product are you using? On what operating system?

python-geohash 0.3, python 2.6.1, OS X 10.6

Please provide any additional information below.

It looks like the 'e' and 'w' are just swapped, I believe the attached
patch is the correct fix.

Original issue reported on code.google.com by [email protected] on 6 May 2010 at 4:38

Attachments:

geohash.decode and geohash.bbox are broken in c library

It looks like there are some issues with the c extension added in 0.3 (the
problems persist up to the current release of 0.4)

Here is a quick example that proves the problem:

>>> geohash.decode('8') == geohash.decode('b')
True

In geohash 0.2:

>>> geohash.decode('8')
(22.5, -157.5)
>>> geohash.decode('b')
(67.5, -157.5)

In geohash 0.4:

>>> geohash.decode('8')
(22.5, -157.5)
>>> geohash.decode('b')
(22.5, -157.5)

Of note, this regression only occurs if the C Library _geohash is in use
(the default behavior).

I haven't been able to figure out what the problem is as the C code is hard
to decipher. I have attached a testcase which demonstrates the problem, so
hopefully this will help you narrow it down. The tests should pass once the
problem is fixed (it passes in 0.2)

Original issue reported on code.google.com by [email protected] on 16 May 2010 at 9:14

Attachments:

No python information found in registry --- when install python-geohash-0.8.4.win32-py2.7.exe on Win7-64bit

The installation problem. 
1.  Just run the python-geohash-0.8.4.win32-py2.7.exe, and got error message: 
Python 2.7 was required, which is not found in the registry.
2. In the setup up page, the "python directory" is null,  and is not allowed to 
input.


OS : Windows 7 ultimate 64bit
python:  Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit 
(AMD64)]

After some googling, I believed it's this problem:
the msg96921 on page:
                 http://bugs.python.org/issue6792


So, please provide the 64bit installation packet for windows, then it should 
works.

Original issue reported on code.google.com by [email protected] on 11 Mar 2012 at 2:40

__version__ not supported?

What steps will reproduce the problem?
1. geohash.__version__ should return the module version.
2.
3.

What is the expected output? What do you see instead?
'0.8.4', etc.

What version of the product are you using? On what operating system?
'0.8.4'

Please provide any additional information below.
This global module variable is a python convention.

Original issue reported on code.google.com by [email protected] on 20 Nov 2013 at 6:45

Vecinos

Es posible agregar a la función de 'Vecinos" dos parámetros, uno horizontal y otro vertical, es decir, si quiero dos hacia arriba y abajo y uno a la izquierda y otro a la derecha que se pueda hacer algo como geohash.neighbors("9g3mz3p", V=2, H=1), para hacer un análisis diferente.

¿Qué opinas?

pip install does not work with MacOS Mojave and XCode 10

With Xcode 10 installing python-geohash via pip install python-geohash fails.

Reason (in Xcode 10 release notes):

Building with libstdc++ was deprecated with Xcode 8 and is not supported in Xcode 10 when targeting iOS. C++ projects must now migrate to libc++ and are recommended to set a deployment target of macOS 10.9 or later, or iOS 7 or later. Besides changing the C++ Standard Library build setting, developers should audit hard-coded linker flags and target dependencies to remove references to libstdc++ (including -lstdc++, -lstdc++.6.0.9, libstdc++.6.0.9.tbd, and libstdc++.6.0.9.dylib). Project dependencies such as static archives that were built against libstdc++ will also need to be rebuilt against libc++. (40885260)

See here

install fails on redhat with python 3.6.8

ERROR: Command errored out with exit status 1:
command: /bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-i1evyzlt/setup.py'"'"'; file='"'"'/tmp/pip-req-build-i1evyzlt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-uyjvrxcn/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-req-build-i1evyzlt/
Complete output (19 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying geohash.py -> build/lib.linux-x86_64-3.6
copying quadtree.py -> build/lib.linux-x86_64-3.6
copying jpgrid.py -> build/lib.linux-x86_64-3.6
copying jpiarea.py -> build/lib.linux-x86_64-3.6
running build_ext
building '_geohash' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYTHON_MODULE=1 -I/usr/include/python3.6m -c src/geohash.cpp -o build/temp.linux-x86_64-3.6/src/geohash.o
src/geohash.cpp:538:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-i1evyzlt/setup.py'"'"'; file='"'"'/tmp/pip-req-build-i1evyzlt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-uyjvrxcn/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Integer representation of geohash

import geohash as gh

gLat = 62.54858
gLo = 179.95000000000002

geoh = gh.encode(gLat,gLo,26)

print(geoh)

geoh = geoh << 7


print(geoh)

The following code is not working for me. How do I get the integer representation of geohash from your package ? I want to be able to do range queries using geohash as a integer. In order to do this I would want to bit shift the geohash. But right now it is a character string. So I cannot what is the API call for that ?

Size of Geohash grids

What is the size of geohash grids corresponding to different precision levels? In meters??

please clarify python-geohash license

The licensing stanza in the README:
"** LICENSE
Code is licensed under Apache License 2.0, MIT Licence and NEW BSD License.
You can choose one of the licences above."

is ambiguous, especially "MIT Licence", which can actually refer to a number of 
different licenses (http://en.wikipedia.org/wiki/MIT_License). My suggestion is 
to add the actual text of the licenses you wish to use in the tarball (e.g. add 
a LICENSE file with the license texts, or add separate LICENSE.MIT, 
LICENSE.BSD, LICENSE.Apache files) and reference to that in the README.

Original issue reported on code.google.com by [email protected] on 14 Feb 2011 at 3:33

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.