{ "info": { "author": "Danil Gusev", "author_email": "gusev.danil@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Utilities" ], "description": "========\nGeoIndex\n========\n\nSimple library for perform quick nearby search for geo spatial data.\n\nRequirements\n------------\n\n* python-geohash\n\nIt was written and tested on Python 2.7.\n\nInstallation\n------------\n\nGet it from `pypi `_::\n\n pip install geoindex\n\nor `github `_::\n\n pip install -e git://github.com/gusdan/geoindex.git#egg=geoindex\n\n\nSimple use\n----------\n\nIf we have 100000 geo coordinates and we have to find some nearby location\nto given point and with given radius we can do something like this::\n\n from geoindex import GeoGridIndex, GeoPoint\n\n geo_index = GeoGridIndex()\n for _ in range(10000):\n lat = random.random()*180 - 90\n lng = random.random()*360 - 180\n index.add_point(GeoPoint(lat, lng))\n\n center_point = GeoPoint(37.7772448, -122.3955118)\n for distance, point in index.get_nearest_points(center_point, 10, 'km'):\n print(\"We found {0} in {1} km\".format(point, distance))\n\n\nSearch with associated data\n---------------------------\nWhen we fill index we can pass ref to GeoPoint as reference to some object\nand use it after::\n\n from geoindex import GeoGridIndex, GeoPoint\n\n index = GeoGridIndex()\n for airport in get_all_airports():\n index.add_point(GeoPoint(lat, lng, ref=airport))\n\n center_point = GeoPoint(37.7772448, -122.3955118)\n for distance, point in index.get_nearest_points(center_point, 10, 'km'):\n print(\"We airport {0} in {1} km\".format(point.ref, distance))\n\n\nPerformance\n-----------\n\nCreating index with 10000 random points and nearby search for each point took\nabout 400ms. See tests/test_performance.py for more details.\n\n\nHow does it work\n----------------\n\nFor perform quick search GeoGridIndex uses\n`Geohash `_ for each point and store it\nin internal dictionary. When we initialize GeoGridIndex we pass precision to\nconstructor, based on it we divide all spaces with grid and store each point\ninside that grid.\nWhen we search nearest points we define cell with center point and 8 neighbors\nand check all points from these cells for distance to center.\n\nEach cell has size dependent on precision, bellow you can find grid's cell size\nand precision.\n\n\n+-----------+------------+\n| Precision | Cell size |\n+===========+============+\n| 1 | 5000 |\n+-----------+------------+\n| 2 | 1260 |\n+-----------+------------+\n| 3 | 156 |\n+-----------+------------+\n| 4 | 40 |\n+-----------+------------+\n| 5 | 4.8 |\n+-----------+------------+\n| 6 | 1.22 |\n+-----------+------------+\n| 7 | 0.152 |\n+-----------+------------+\n| 8 | 0.038 |\n+-----------+------------+\n\n\nIf you have created GeoGridIndex with precision = 4 it means what all points\nwill be assign to grid with cell size = 40 km. And we can run search with\nradius less than 40/2km. If we'd like to make bigger radius we should create\nindex with less precision 3.\n\nBut in other side if we create index with smallest precision (1) and will run\nsearch (get_nearest_points) with small radius (1km for example) it will works\nfine, but it will check all points inside 9 grid cells with size 5000km and it\ncan be not so fast.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/gusdan/geoindex", "keywords": "geo index spatial geohash indexer grid", "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "geoindex", "package_url": "https://pypi.org/project/geoindex/", "platform": "any", "project_url": "https://pypi.org/project/geoindex/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/gusdan/geoindex" }, "release_url": "https://pypi.org/project/geoindex/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Simple library for perform quick nearby search for geo spatial data.", "version": "0.0.1" }, "last_serial": 1015529, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b4c8eeefdd08c8c7e298e21d6d5c6e62", "sha256": "ba4d6a5c0f8716adfa31b33f1773e1b8f81342d9aacb31ced5100807f34ebd91" }, "downloads": -1, "filename": "geoindex-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b4c8eeefdd08c8c7e298e21d6d5c6e62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4708, "upload_time": "2014-03-01T03:55:08", "url": "https://files.pythonhosted.org/packages/99/b5/020117b2986a6229e52fdfaa80f0e164ec733b71c59c680ea672c8d5a331/geoindex-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b4c8eeefdd08c8c7e298e21d6d5c6e62", "sha256": "ba4d6a5c0f8716adfa31b33f1773e1b8f81342d9aacb31ced5100807f34ebd91" }, "downloads": -1, "filename": "geoindex-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b4c8eeefdd08c8c7e298e21d6d5c6e62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4708, "upload_time": "2014-03-01T03:55:08", "url": "https://files.pythonhosted.org/packages/99/b5/020117b2986a6229e52fdfaa80f0e164ec733b71c59c680ea672c8d5a331/geoindex-0.0.1.tar.gz" } ] }