{ "info": { "author": "Christian Ledermann", "author_email": "christian.ledermann@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Scientific/Engineering :: GIS" ], "description": "Introduction\n============\n\nPyGeoIf provides a GeoJSON-like protocol for geo-spatial (GIS) vector data.\n\nsee https://gist.github.com/2217756\n\nOther Python programs and packages that you may have heard of already\nimplement this protocol:\n\n* ArcPy http://help.arcgis.com/en/arcgisdesktop/\n* descartes https://bitbucket.org/sgillies/descartes/\n* geojson http://pypi.python.org/pypi/geojson/\n* PySAL http://pysal.geodacenter.org/\n* Shapely https://github.com/Toblerity/Shapely\n* pyshp https://pypi.python.org/pypi/pyshp\n\nSo when you want to write your own geospatial library with support\nfor this protocol you may use pygeoif as a starting point and build\nyour functionality on top of it\n\nYou may think of pygeoif as a 'shapely ultralight' which lets you\nconstruct geometries and perform **very** basic operations like\nreading and writing geometries from/to WKT, constructing line strings\nout of points, polygons from linear rings, multi polygons from\npolygons, etc. It was inspired by shapely and implements the\ngeometries in a way that when you are familiar with shapely\nyou feel right at home with pygeoif\n\nIt was written to provide clean and python only geometries for\nfastkml_\n\n.. _fastkml: http://pypi.python.org/pypi/fastkml/\n\nPyGeoIf is continually tested with *Travis CI*\n\n.. image:: https://api.travis-ci.org/cleder/pygeoif.png\n :target: https://travis-ci.org/cleder/pygeoif\n\n.. image:: https://coveralls.io/repos/cleder/pygeoif/badge.png?branch=master\n :target: https://coveralls.io/r/cleder/pygeoif?branch=master\n\n\n\n\nExample\n========\n\n\n >>> from pygeoif import geometry\n >>> p = geometry.Point(1,1)\n >>> p.__geo_interface__\n {'type': 'Point', 'coordinates': (1.0, 1.0)}\n >>> print p\n POINT (1.0 1.0)\n >>> p1 = geometry.Point(0,0)\n >>> l = geometry.LineString([p,p1])\n >>> l.bounds\n (0.0, 0.0, 1.0, 1.0)\n >>> dir(l)\n ['__class__', '__delattr__', '__dict__', '__doc__', '__format__',\n '__geo_interface__', '__getattribute__', '__hash__', '__init__',\n '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',\n '__setattr__', '__sizeof__', '__str__', '__subclasshook__',\n '__weakref__', '_coordinates', '_geoms', '_type', 'bounds', 'coords',\n 'geom_type', 'geoms', 'to_wkt']\n >>> print l\n LINESTRING (1.0 1.0, 0.0 0.0)\n\n\nYou find more examples in the\n`test_main.py `_\nfile which cover every aspect of pygeoif or in fastkml_.\n\nClasses\n========\n\nAll classes implement the attribute:\n\n* __geo_interface__: as dicussed above\n\nAll geometry classes implement the attributes:\n\n* geom_type: Returns a string specifying the Geometry Type of the object\n* bounds: Returns a (minx, miny, maxx, maxy) tuple (float values) that bounds the object.\n* wkt: Returns the 'Well Known Text' representation of the object\n\n\nand the method:\n\n* to_wkt which also prints the object\n\nGeoObject\n----------\nBase class for Geometry, Feature, and FeatureCollection\n\nGeometry\n--------\nBase class for geometry objects.\nInherits from Geoobject.\n\n\nPoint\n-----\nA zero dimensional geometry\n\nA point has zero length and zero area.\n\nAttributes\n~~~~~~~~~~~\nx, y, z : float\n Coordinate values\n\nExample\n~~~~~~~~\n\n >>> p = Point(1.0, -1.0)\n >>> print p\n POINT (1.0000000000000000 -1.0000000000000000)\n >>> p.y\n -1.0\n >>> p.x\n 1.0\n\n\n\nLineString\n-----------\n\nA one-dimensional figure comprising one or more line segments\n\nA LineString has non-zero length and zero area. It may approximate a curve\nand need not be straight. Unlike a LinearRing, a LineString is not closed.\n\nAttributes\n~~~~~~~~~~~\ngeoms : sequence\n A sequence of Points\n\n\n\nLinearRing\n-----------\n\nA closed one-dimensional geometry comprising one or more line segments\n\nA LinearRing that crosses itself or touches itself at a single point is\ninvalid and operations on it may fail.\n\nA Linear Ring is self closing\n\n\n\nPolygon\n--------\n\nA two-dimensional figure bounded by a linear ring\n\nA polygon has a non-zero area. It may have one or more negative-space\n\"holes\" which are also bounded by linear rings. If any rings cross each\nother, the geometry is invalid and operations on it may fail.\n\nAttributes\n~~~~~~~~~~~\n\nexterior : LinearRing\n The ring which bounds the positive space of the polygon.\ninteriors : sequence\n A sequence of rings which bound all existing holes.\n\n\nMultiPoint\n----------\nA collection of one or more points\n\nAttributes\n~~~~~~~~~~~\n\ngeoms : sequence\n A sequence of Points\n\nMultiLineString\n----------------\nA collection of one or more line strings\n\nA MultiLineString has non-zero length and zero area.\n\nAttributes\n~~~~~~~~~~~\n\ngeoms : sequence\n A sequence of LineStrings\n\nMultiPolygon\n-------------\n\nA collection of one or more polygons\n\nAttributes\n~~~~~~~~~~~~~\ngeoms : sequence\n A sequence of `Polygon` instances\n\n\nGeometryCollection\n-------------------\nA heterogenous collection of geometries (Points, LineStrings, LinearRings\nand Polygons)\n\nAttributes\n~~~~~~~~~~~\ngeoms : sequence\n A sequence of geometry instances\n\nPlease note:\nGEOMETRYCOLLECTION isn't supported by the Shapefile format.\nAnd this sub-class isn't generally supported by ordinary GIS sw (viewers and so on).\nSo it's very rarely used in the real GIS professional world.\n\nExample\n~~~~~~~~\n\n >>> from pygeoif import geometry\n >>> p = geometry.Point(1.0, -1.0)\n >>> p2 = geometry.Point(1.0, -1.0)\n >>> geoms = [p, p2]\n >>> c = geometry.GeometryCollection(geoms)\n >>> c.__geo_interface__\n {'type': 'GeometryCollection', 'geometries': [{'type': 'Point', 'coordinates': (1.0, -1.0)},/\n {'type': 'Point', 'coordinates': (1.0, -1.0)}]}\n >>> [geom for geom in geoms]\n [Point(1.0, -1.0), Point(1.0, -1.0)]\n\nFeature\n-------\nAggregates a geometry instance with associated user-defined properties.\n\nAttributes\n~~~~~~~~~~~\ngeometry : object\n A geometry instance\nproperties : dict\n A dictionary linking field keys with values associated with with geometry instance\n\nExample\n~~~~~~~~\n\n >>> p = Point(1.0, -1.0)\n >>> props = {'Name': 'Sample Point', 'Other': 'Other Data'}\n >>> a = Feature(p, props)\n >>> a.properties\n {'Name': 'Sample Point', 'Other': 'Other Data'}\n >>> a.properties['Name']\n 'Sample Point'\n\nFeatureCollection\n-----------------\nA heterogenous collection of Features\n\nAttributes\n~~~~~~~~~~~\nfeatures: sequence\n A sequence of feature instances\n\nExample\n~~~~~~~~\n\n >>> from pygeoif import geometry\n >>> p = geometry.Point(1.0, -1.0)\n >>> props = {'Name': 'Sample Point', 'Other': 'Other Data'}\n >>> a = geometry.Feature(p, props)\n >>> p2 = geometry.Point(1.0, -1.0)\n >>> props2 = {'Name': 'Sample Point2', 'Other': 'Other Data2'}\n >>> b = geometry.Feature(p2, props2)\n >>> features = [a, b]\n >>> c = geometry.FeatureCollection(features)\n >>> c.__geo_interface__\n {'type': 'FeatureCollection', 'features': [{'geometry': {'type': 'Point', 'coordinates': (1.0, -1.0)},/\n 'type': 'Feature', 'properties': {'Other': 'Other Data', 'Name': 'Sample Point'}},/\n {'geometry': {'type': 'Point', 'coordinates': (1.0, -1.0)}, 'type': 'Feature',/\n 'properties': {'Other': 'Other Data2', 'Name': 'Sample Point2'}}]}\n >>> [feature for feature in c]\n [, ]\n\nFunctions\n=========\n\nas_shape\n--------\n\nCreate a pygeoif feature from an object that provides the __geo_interface__\n\n\n >>> from shapely.geometry import Point\n >>> from pygeoif import geometry\n >>> geometry.as_shape(Point(0,0))\n \n\n\nfrom_wkt\n---------\n\nCreate a geometry from its WKT representation\n\n\n >>> p = geometry.from_wkt('POINT (0 1)')\n >>> print p\n POINT (0.0 1.0)\n\n\nsigned_area\n------------\n\nReturn the signed area enclosed by a ring using the linear time\nalgorithm at http://www.cgafaq.info/wiki/Polygon_Area. A value >= 0\nindicates a counter-clockwise oriented ring.\n\norient\n-------\n\nReturns a copy of the polygon with exterior in counter-clockwise and\ninteriors in clockwise orientation for sign=1.0 and the other way round\nfor sign=-1.0\n\n\nmapping\n-------\n\nReturns the __geo_interface__ dictionary\n\n\nDevelopment\n===========\n\nInstallation\n------------\n\nYou can install PyGeoIf from pypi using pip::\n\n pip install pygeoif\n\nTesting\n-------\n\nIn order to provide a Travis-CI like testing of the PyGeoIf package during\ndevelopment, you can use tox (``pip install tox``) to evaluate the tests on\nall supported Python interpreters which you have installed on your system.\n\nYou can run the tests with ``tox --skip-missin-interpreters`` and are looking\nfor output similar to the following::\n\n ______________________________________________________ summary ______________________________________________________\n SKIPPED: py26: InterpreterNotFound: python2.6\n py27: commands succeeded\n SKIPPED: py32: InterpreterNotFound: python3.2\n SKIPPED: py33: InterpreterNotFound: python3.3\n py34: commands succeeded\n SKIPPED: pypy: InterpreterNotFound: pypy\n SKIPPED: pypy3: InterpreterNotFound: pypy3\n congratulations :)\n\nYou are primarily looking for the ``congratulations :)`` line at the bottom,\nsignifying that the code is working as expected on all configurations\navailable.\n\nChangelog\n=========\n\n0.7 (2017/05/04)\n-----------------\n\n- fix broken multipolygon [mindflayer]\n- add \"bbox\" to `__geo_interface__` output [jzmiller1]\n\n0.6 (2015/08/04)\n-----------------\n\n- Add id to feature [jzmiller1]\n\n0.5 (2015/07/13)\n-----------------\n\n- Add __iter__ method to FeatureCollection and GeometryCollection [jzmiller1].\n- add pypy and pypy3 and python 3.4 to travis.\n- Add tox configuration for performing local testing [Ian Lee].\n- Add Travis continuous deployment.\n\n0.4 (2013/10/25)\n-----------------\n\n- after a year in production promote it to `Development Status :: 5 - Production/Stable`\n- MultiPolygons return tuples as the __geo_interface__\n\n0.3.1 (2012/11/15)\n------------------\n\n- specify minor python versions tested with Travis CI\n- fix for signed area\n\n\n0.3 (2012/11/14)\n-------------------\n\n- add GeometryCollection\n- len(Multi*) and len(GeometryCollection) returns the number of contained Geometries\n- add orient function to get clockwise or counterclockwise oriented poygons\n- add signed_area function\n- add _set_orientation method to lineStrings, Polygons and MultiPolygons\n\n\n0.2.1 (2012/08/02)\n-------------------\n\n- as_shape also accepts an object that is neither a dictionary nor has a __geo_interface__ but can be converted into a __geo_interface__ compliant dictionary\n\n\n0.2 (2012/08/01)\n-----------------\n\n- change license to LGPL\n- add wkt as a property\n- as_shape also accepts a __geo_interface__ compliant dictionary\n- test with python3\n\n\n0.1 (2012/07/27)\n-----------------\n\n- initial release", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cleder/pygeoif/", "keywords": "GIS Spatial WKT", "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "pygeoif", "package_url": "https://pypi.org/project/pygeoif/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pygeoif/", "project_urls": { "Homepage": "https://github.com/cleder/pygeoif/" }, "release_url": "https://pypi.org/project/pygeoif/0.7/", "requires_dist": null, "requires_python": null, "summary": "A basic implementation of the __geo_interface__", "version": "0.7" }, "last_serial": 2851643, "releases": { "0.1dev": [ { "comment_text": "", "digests": { "md5": "92aeec297a514eb2a51acea33a300e01", "sha256": "844fb294eaf820edc985693d43fad94a31dd569ebe208c38970db31eb9d52d46" }, "downloads": -1, "filename": "pygeoif-0.1dev.tar.gz", "has_sig": false, "md5_digest": "92aeec297a514eb2a51acea33a300e01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23315, "upload_time": "2012-07-27T14:36:45", "url": "https://files.pythonhosted.org/packages/e8/5e/d80632c63e48896247f97b289e5989cf55b367c1fce065f608d55642e571/pygeoif-0.1dev.tar.gz" } ], "0.2.1dev": [ { "comment_text": "", "digests": { "md5": "870bcc87eca5f694bb08e8ce7cbd8bbe", "sha256": "8521cf8e32dc4aeaa584629edbcdaf242afa5e91fbfb03e30989c593f9dc6a63" }, "downloads": -1, "filename": "pygeoif-0.2.1dev.tar.gz", "has_sig": false, "md5_digest": "870bcc87eca5f694bb08e8ce7cbd8bbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24260, "upload_time": "2012-08-02T14:39:24", "url": "https://files.pythonhosted.org/packages/7c/0d/68120d117100893a31d2785cb66334b42ef7a7fdb15de031004b7cefcb16/pygeoif-0.2.1dev.tar.gz" } ], "0.2dev": [ { "comment_text": "", "digests": { "md5": "efc937f25a39e0a84de6b22571641068", "sha256": "79357afc98ebaef52aa340681f16dc20a94bab2898b1fd3cceadfca48a00eabe" }, "downloads": -1, "filename": "pygeoif-0.2dev.tar.gz", "has_sig": false, "md5_digest": "efc937f25a39e0a84de6b22571641068", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24012, "upload_time": "2012-08-01T17:38:15", "url": "https://files.pythonhosted.org/packages/9c/23/51f89688908a233f2795984f9367f527e8e38615b08ce5ac154d512b326c/pygeoif-0.2dev.tar.gz" } ], "0.3.0dev": [ { "comment_text": "", "digests": { "md5": "1358056d6f881396f23130eadbef88cf", "sha256": "b563214bcf657bf72b5a3c220fdee705414857f26f3a991a63a7abd4a03385ee" }, "downloads": -1, "filename": "pygeoif-0.3.0dev.tar.gz", "has_sig": false, "md5_digest": "1358056d6f881396f23130eadbef88cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26706, "upload_time": "2012-11-14T09:29:06", "url": "https://files.pythonhosted.org/packages/48/53/68c7fdc56047f08e7446f4d7c0d3a92c3a34ca15baac848645fba4cc3faf/pygeoif-0.3.0dev.tar.gz" } ], "0.3.1dev": [ { "comment_text": "", "digests": { "md5": "68bab0f3d0c73595d41c1faaa811f395", "sha256": "a66ba04041859e0832634488e8b7abb690a716ebfcc25cd30433b1dfeb24139b" }, "downloads": -1, "filename": "pygeoif-0.3.1dev.tar.gz", "has_sig": false, "md5_digest": "68bab0f3d0c73595d41c1faaa811f395", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27385, "upload_time": "2012-11-15T12:15:54", "url": "https://files.pythonhosted.org/packages/75/11/0a1098274a50144edf425c947899166503ef352ac238856c2e4092117148/pygeoif-0.3.1dev.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "9f9ea7ff5e845121c1734d674195b5ef", "sha256": "8f1f2761da2f9f6fc5947761c4f8f3642fb3702126bccf68ef5f84a3cdb0feb0" }, "downloads": -1, "filename": "pygeoif-0.4.tar.gz", "has_sig": false, "md5_digest": "9f9ea7ff5e845121c1734d674195b5ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27691, "upload_time": "2013-10-25T10:32:34", "url": "https://files.pythonhosted.org/packages/46/13/deb76794b36cd70fa1575fae1195a81e4a76181b9ea54fc993aa6dd48a4a/pygeoif-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "dfd6dc50f8b145867bf555e2a685bedc", "sha256": "1bbfe75c3234bb2a9a8fc4865aec048e16834e7a07dc8c49dc1a961152af728e" }, "downloads": -1, "filename": "pygeoif-0.4.1.tar.gz", "has_sig": false, "md5_digest": "dfd6dc50f8b145867bf555e2a685bedc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27851, "upload_time": "2013-10-25T13:04:51", "url": "https://files.pythonhosted.org/packages/5d/19/f66258e3056a7d9b3e3d076a8437e4070dcdd21a7d987311d4ad41502c52/pygeoif-0.4.1.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "f5b8927cdd8225d357cad78fa381b2c8", "sha256": "61d8f3e63770a13d93f9393f9a0259ad11c1d8017023dc6afc3d98a4a0366f08" }, "downloads": -1, "filename": "pygeoif-0.5.tar.gz", "has_sig": false, "md5_digest": "f5b8927cdd8225d357cad78fa381b2c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28633, "upload_time": "2015-07-16T12:58:29", "url": "https://files.pythonhosted.org/packages/fd/4a/3ad6d86e127d4ae1b3b0e3625df1b942f4b1ea317ea6e1c476124bdfb490/pygeoif-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "e5d423724f9894aa2b2a1a8eb2314051", "sha256": "4fb9ebe63711b9cfc4d33ecfba62b6331a019d6984e1c917b3e0b0dfc0780cd1" }, "downloads": -1, "filename": "pygeoif-0.6.tar.gz", "has_sig": false, "md5_digest": "e5d423724f9894aa2b2a1a8eb2314051", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28800, "upload_time": "2015-08-04T09:52:37", "url": "https://files.pythonhosted.org/packages/be/33/ebda098a7f1f59593d1d5b842c2917a815e9ca09af684738cd8f4b3c151a/pygeoif-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "6cf541970ab9dbd4ada12eff02602b96", "sha256": "11aa0c071d38befa4af3bd123efa834abe0823a873f3744f0a070a44025afe04" }, "downloads": -1, "filename": "pygeoif-0.7.tar.gz", "has_sig": false, "md5_digest": "6cf541970ab9dbd4ada12eff02602b96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34773, "upload_time": "2017-05-04T15:46:54", "url": "https://files.pythonhosted.org/packages/f0/a7/fc5df91be602a66aaae21213e6eb9b9b8039c8074b6515c570b5110b9108/pygeoif-0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6cf541970ab9dbd4ada12eff02602b96", "sha256": "11aa0c071d38befa4af3bd123efa834abe0823a873f3744f0a070a44025afe04" }, "downloads": -1, "filename": "pygeoif-0.7.tar.gz", "has_sig": false, "md5_digest": "6cf541970ab9dbd4ada12eff02602b96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34773, "upload_time": "2017-05-04T15:46:54", "url": "https://files.pythonhosted.org/packages/f0/a7/fc5df91be602a66aaae21213e6eb9b9b8039c8074b6515c570b5110b9108/pygeoif-0.7.tar.gz" } ] }