{ "info": { "author": "Jacob Wasserman", "author_email": "jwasserman@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "geog\n====\n\nA pure numpy implementation for geodesic functions. The interfaces are\nvectorized according to numpy broadcasting rules compatible with a variety of\ninputs including lists, numpy arrays, and\n[Shapely](http://toblerity.org/shapely/) geometries - allowing for 1-to-1,\nN-to-1, or the element-wise N-to-N calculations in a single call.\n\n`geog` uses a spherical Earth model (subject to change) with radius 6371.0 km.\n\n`geog` draws inspiration from [TurfJS](https://www.turfjs.org)\n\n\nOperations\n---------\n* `distance` - Compute the distance in meters between any number of longitude,latitude points\n* `course` - Compute the forward azimuth between points\n* `propagate` - Starting from some points and pointing azimuths, move some\ndistance and compute the final points.\n\n\nGetting Started\n---------------\n\nCompute the distance in meters between two locations on the surface of the\nEarth.\n```\n>>> import geog\n\n>>> boston = [-71.0589, 42.3601]\n>>> la = [-118.2500, 34.0500]\n\n>>> geog.distance(boston, la)\n4179393.4717019284\n\n\n>>> geog.course(boston, la)\n176.76437002826202\n\n```\n\n`geog` allows different sizes of inputs conforming to numpy broadcasting\nrules\n\nCompute the distances from several points to one point.\n```\n>>> dc = [-77.0164, 38.9047]\n>>> paris = [2.3508, 48.8567]\n>>> geog.distance([boston, la, dc], paris)\narray([ 5531131.56144631, 9085960.07227854, 6163490.48394848])\n\n```\n\nCompute the element-wise distance of several points to several points\n```\n>>> sydney = [151.2094, -33.865]\n>>> barcelona = [2.1833, 41.3833]\n>>> geog.distance([boston, la, dc], [paris, sydney, barcelona])\narray([ 5531131.56144631, 12072666.9425518 , 6489222.58111716])\n\n```\n\n`geog` functions can take numpy arrays as inputs\n```\n>>> import numpy as np\n>>> points = np.array([boston, la, dc])\n>>> points\narray([[ -71.0589, 42.3601],\n [-118.25 , 34.05 ],\n [ -77.0164, 38.9047]])\n>>> geog.distance(points, sydney)\narray([ 16239763.03982447, 12072666.9425518 , 15711932.63508411])\n```\n\n\n`geog` functions can also take Shapely geometries as inputs\n```\n>>> import shapely.geometry\n>>> p = shapely.geometry.Point([-90.0667, 29.9500])\n>>> geog.distance(points, p)\narray([ 2185738.94680724, 2687705.07260978, 1554066.84579387])\n\n```\n\n\nOther Uses\n----------------\nUse `propagate` to buffer a single point by passing in multiple angles.\n\n```\n>>> n_points = 6\n>>> d = 100 # meters\n>>> angles = np.linspace(0, 360, n_points)\n>>> polygon = geog.propagate(p, angles, d)\n\n```\n\nCompute the length of a line over the surface.\n```\n>>> np.sum(geog.distance(line[:-1,:], line[1:,:]))\n```\n\n\nQuick Documentation\n-------------\n`distance(p0, p1, deg=True)`\n\n`course(p0, p1, deg=True, bearing=False)`\n\n`propagate(p0, angle, d, deg=True, bearing=False)`\n\nFor all of the above, `p0` or `p1` can be:\n- single list, tuple, or Shapely Point of [lon, lat] coordinates\n- list of [lon, lat] coordinates or Shapely Points\n- N x 2 numpy array of (lon, lat) coordinates\n\nIf argument `deg` is False, then all angle arguments, coordinates and\nazimuths, will be used as radians. If `deg` is False in `course()`, then it's\noutput will also be radians.\n\nConsult the documentation on each function for more detailed descriptions of\nthe arguments.\n\n\nConventions\n-----------\n* All points, or point-like objects assume a longitude, latitude ordering.\n* Arrays of points have shape `N x 2`.\n* Azimuth/course is measured with 0 degrees as due East, increasing\n counter-clockwise so that 90 degrees is due North. The functions that\noperate on azimuth accept a `bearing=True` argument to use the more\ntraditional definition where 0 degrees is due North increasing clockwise such\nthat that 90 degrees is due East.\n\n\nInstallation\n-----------\ngeog is hosted on PyPI.\n\n```\npip install geog\n```\n\n\nSee also\n--------\n* `geog` is partly inspired by [TurfJS](https://www.turfjs.org)\n\n* [PostGIS](http://postgis.net/docs/manual-1.5/ch04.html#Geography_Basics) geography type\n* [Shapely](https://github.com/toblerity/shapely)\n* [Proj.4](https://trac.osgeo.org/proj/)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jwass/geog", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "geog", "package_url": "https://pypi.org/project/geog/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/geog/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jwass/geog" }, "release_url": "https://pypi.org/project/geog/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Numpy-based vectorized geospatial functions", "version": "0.0.2" }, "last_serial": 1939782, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "9f757403e250dfac1d54d9a0c9b0d529", "sha256": "9374f33e66f080d94194d76c68e0c1d116e2ec30589deab807c7b5bfb53b8c54" }, "downloads": -1, "filename": "geog-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9f757403e250dfac1d54d9a0c9b0d529", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6595, "upload_time": "2015-06-26T13:13:22", "url": "https://files.pythonhosted.org/packages/d5/bf/97d0ecad7a123919744fbf29285aae584a9a67990ca816dd52d9ba955acf/geog-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "28137dcf19f8f804a92e51e5736dd4ce", "sha256": "9b6b020b72bf135d49299115e5a4a751f2432def4d4cd87d10b48a5ae51ec643" }, "downloads": -1, "filename": "geog-0.0.2.tar.gz", "has_sig": false, "md5_digest": "28137dcf19f8f804a92e51e5736dd4ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4966, "upload_time": "2016-02-04T14:59:37", "url": "https://files.pythonhosted.org/packages/cd/04/5cee7294d377214811b7d4d56fbc3da38e9d68e7ec50e53c6fb583a93965/geog-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "28137dcf19f8f804a92e51e5736dd4ce", "sha256": "9b6b020b72bf135d49299115e5a4a751f2432def4d4cd87d10b48a5ae51ec643" }, "downloads": -1, "filename": "geog-0.0.2.tar.gz", "has_sig": false, "md5_digest": "28137dcf19f8f804a92e51e5736dd4ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4966, "upload_time": "2016-02-04T14:59:37", "url": "https://files.pythonhosted.org/packages/cd/04/5cee7294d377214811b7d4d56fbc3da38e9d68e7ec50e53c6fb583a93965/geog-0.0.2.tar.gz" } ] }