{ "info": { "author": "Karim Bahgat", "author_email": "karim.bahgat.norway@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", "License :: OSI Approved", "Programming Language :: Python", "Topic :: Scientific/Engineering :: GIS" ], "description": "PyGeoj\n======\n\nPyGeoj is a simple Python GeoJSON file reader and writer intended for\nend-users. It exposees dictionary structures as high level objects with\nconvenience methods, so the user does not have to get caught up in the\ndetails of the format specification.\n\nPlatforms\n---------\n\nPython 2 and 3.\n\nDependencies\n------------\n\nPure Python, no dependencies.\n\nInstalling it\n-------------\n\nPyGeoj is installed with pip from the commandline:\n\n::\n\n pip install pygeoj\n\nIt also works to just place the \"pygeoj\" package folder in an importable\nlocation like \"PythonXX/Lib/site-packages\".\n\nExample Usage\n-------------\n\nBegin by importing the pygeoj module:\n\n::\n\n import pygeoj\n\nReading\n~~~~~~~\n\nReading geojson formatted GIS files is a simple one-liner (requires the\ngeojson file to be a \"FeatureCollection\"):\n\n::\n\n testfile = pygeoj.load(filepath=\"testfile.geojson\")\n # or\n testfile = pygeoj.load(data=dict(...))\n\nBasic information about the geojson file can then be extracted, such as:\n\n::\n\n len(testfile) # the number of features\n testfile.bbox # the bounding box region of the entire file\n testfile.crs # the coordinate reference system\n testfile.all_attributes # retrieves the combined set of all feature attributes\n testfile.common_attributes # retrieves only those field attributes that are common to all features\n\nIndividual features can be accessed by their index in the features list:\n\n::\n\n testfile[3]\n # or\n testfile.get_feature(3)\n\nOr by iterating through all of them:\n\n::\n\n for feature in testfile: \n # do something\n\nA feature can be inspected in various ways:\n\n::\n\n feature.properties\n feature.geometry.type\n feature.geometry.coordinates\n feature.geometry.bbox\n\nEditing\n~~~~~~~\n\nThe standard Python list operations can be used to edit and swap around\nthe features in a geojson instance, and then saving to a new geojson\nfile:\n\n::\n\n testfile[3] = testfile[8]\n # or testfile.replace_feature(3, testfile[8])\n del testfile[8]\n # or testfile.remove_feature(8)\n testfile.save(\"test_edit.geojson\")\n\nAn existing feature can also be tweaked by using simple\nattribute-setting:\n\n::\n\n # set your own properties\n feature.properties = {\"newfield1\":\"newvalue1\", \"newfield2\":\"newvalue2\"}\n\n # borrow the geometry of the 16th feature\n feature.geometry = testfile[16].geometry\n\nNote that when changing geometries or coordinates, you must remember to\nupdate its bbox to clear away any older stored bbox information.\n\n::\n\n feature.geometry.update_bbox()\n\nConstructing\n~~~~~~~~~~~~\n\nCreating a new geojson file from scratch is also easy:\n\n::\n\n newfile = pygeoj.new()\n\n # The data coordinate system defaults to long/lat WGS84 or can be manually defined:\n newfile.define_crs(type=\"link\", link=\"http://spatialreference.org/ref/epsg/26912/esriwkt/\", link_type=\"esriwkt\")\n\nThe new file can then be populated with new features:\n\n::\n\n newfile.add_feature(properties={\"country\":\"Norway\"},\n geometry={\"type\":\"Polygon\", \"coordinates\":[[(21,3),(33,11),(44,22)]]} )\n newfile.add_feature(properties={\"country\":\"USA\"},\n geometry={\"type\":\"Polygon\", \"coordinates\":[[(11,23),(14,5),(66,31)]]} )\n\nFinally, some useful additional information can be added to top off the\ngeojson file before saving it to file:\n\n::\n\n newfile.add_all_bboxes()\n newfile.update_bbox()\n newfile.add_unique_id()\n newfile.save(\"test_construct.geojson\")\n\nMore Information:\n-----------------\n\n- `Home Page `__\n- `API Documentation `__\n\nLicense:\n--------\n\nThis code is free to share, use, reuse, and modify according to the MIT\nlicense, see license.txt\n\nCredits:\n--------\n\n- Karim Bahgat\n- Mec-iS\n\nChanges\n-------\n\n1.0.0 (2018-09-13)\n~~~~~~~~~~~~~~~~~~\n\n- Bump to stable version\n- Officially support Python 3\n\n0.2.5 (2017-02-19)\n~~~~~~~~~~~~~~~~~~\n\n- Fixed more robust validation to avoid unexpected errors\n- Added skiperror option\n- Fixed feat type missing when add\\_feature()\n- Fixed crs not saving\n- Added fixerror option when loading and validating\n- Fix bug to allow null geometries and empty properties, and correctly\n represent them in json as null\n\n0.2.4 (2015-07-11)\n~~~~~~~~~~~~~~~~~~\n\n- Fixed bug with add\\_all\\_bboxes() not updating existing bboxes\n- Fixed bug with GeojsonFile bbox sometimes being calculated wrong.\n- Added update\\_bbox() on individual Geometry objects.\n", "description_content_type": "", "docs_url": "https://pythonhosted.org/PyGeoj/", "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/karimbahgat/PyGeoj", "keywords": "GIS spatial file format GeoJSON", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "PyGeoj", "package_url": "https://pypi.org/project/PyGeoj/", "platform": "", "project_url": "https://pypi.org/project/PyGeoj/", "project_urls": { "Homepage": "http://github.com/karimbahgat/PyGeoj" }, "release_url": "https://pypi.org/project/PyGeoj/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "A simple Python GeoJSON file reader and writer.", "version": "1.0.0" }, "last_serial": 4267596, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "2831731e9e4c0510d8430cc5d900e98c", "sha256": "226b9b6d322faef1cc0e7426900e7f45bd07d2bded56b9133c84117a3af47a58" }, "downloads": -1, "filename": "PyGeoj-0.2.zip", "has_sig": false, "md5_digest": "2831731e9e4c0510d8430cc5d900e98c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12908, "upload_time": "2015-06-08T05:09:34", "url": "https://files.pythonhosted.org/packages/a5/d6/a26c7e6bdb579c81c259816b4196bda1535751ca5b9fcd69d1ed3d5d47cb/PyGeoj-0.2.zip" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "9ab899a331067e7aca4564b69da036e4", "sha256": "8c3cdaaa1bfe7113c5bc10ed1665be26a7706b9a16f35ac572aeb40cd404ab6b" }, "downloads": -1, "filename": "PyGeoj-0.2.3.zip", "has_sig": false, "md5_digest": "9ab899a331067e7aca4564b69da036e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13645, "upload_time": "2015-06-22T18:03:48", "url": "https://files.pythonhosted.org/packages/39/f0/192c5844040c02a6e91667f0047175b6fcea1ca920ae55bd76c5ba526bf5/PyGeoj-0.2.3.zip" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "c1469b89f056a8c1d4b090a6c70a19d7", "sha256": "03c86a4454f43b900e40fc3af8b45c7e70c674c77fb5ee54bf4356478eaf76a3" }, "downloads": -1, "filename": "PyGeoj-0.2.4.zip", "has_sig": false, "md5_digest": "c1469b89f056a8c1d4b090a6c70a19d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14284, "upload_time": "2015-07-10T22:15:08", "url": "https://files.pythonhosted.org/packages/ae/cb/74f78b83af5b8111cee4cf3b93940337c0228ff0ac764066958c6a865424/PyGeoj-0.2.4.zip" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "5622446bd9d29c67334406ef1b3925af", "sha256": "a184eaf76c306e35ddd95208833fc1ddfae15b44fc35ed3a0dd260e20f2d9ee1" }, "downloads": -1, "filename": "PyGeoj-0.2.5.zip", "has_sig": false, "md5_digest": "5622446bd9d29c67334406ef1b3925af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15542, "upload_time": "2017-02-19T15:22:42", "url": "https://files.pythonhosted.org/packages/d5/0a/abfd247a017c377d221c99582ef7fe39b38e490cb0a4deb65d82bab805ae/PyGeoj-0.2.5.zip" } ], "0.21": [ { "comment_text": "", "digests": { "md5": "49b8e041e5ba39f7aae6e0d413f50e35", "sha256": "010166894d8246fadcbc63c714157c5eb1c04af6833548486c054ae079565be2" }, "downloads": -1, "filename": "PyGeoj-0.21.zip", "has_sig": false, "md5_digest": "49b8e041e5ba39f7aae6e0d413f50e35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13471, "upload_time": "2015-06-18T15:19:55", "url": "https://files.pythonhosted.org/packages/85/dd/45e06fcd36855e365cc0b6a56715ef514611375c4c1b745210e9f1f4325d/PyGeoj-0.21.zip" } ], "0.22": [ { "comment_text": "", "digests": { "md5": "7ca6305b4f8e9fb464cf1241e2d33a30", "sha256": "b738a304207302251df41abe18f8e65a0b6280fa1981c95d60acc7c9f672dfd5" }, "downloads": -1, "filename": "PyGeoj-0.22.zip", "has_sig": false, "md5_digest": "7ca6305b4f8e9fb464cf1241e2d33a30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13475, "upload_time": "2015-06-18T15:23:22", "url": "https://files.pythonhosted.org/packages/7a/c2/340a3b5144c9476bf34292226b794a198fe6e222b8859a00efeb852f98d5/PyGeoj-0.22.zip" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "b0c7a4823f1ec024e1fa4e51398a98d7", "sha256": "a17b8d6661fa98959151092844b54850cafdb97d729d516a1c00479fbd2a19b1" }, "downloads": -1, "filename": "PyGeoj-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b0c7a4823f1ec024e1fa4e51398a98d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9654, "upload_time": "2018-09-13T06:07:48", "url": "https://files.pythonhosted.org/packages/f6/6c/c569e49b24beeef47dd15e02f583fb0ab0b3c95fffae71e8f5fe50a8297e/PyGeoj-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b0c7a4823f1ec024e1fa4e51398a98d7", "sha256": "a17b8d6661fa98959151092844b54850cafdb97d729d516a1c00479fbd2a19b1" }, "downloads": -1, "filename": "PyGeoj-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b0c7a4823f1ec024e1fa4e51398a98d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9654, "upload_time": "2018-09-13T06:07:48", "url": "https://files.pythonhosted.org/packages/f6/6c/c569e49b24beeef47dd15e02f583fb0ab0b3c95fffae71e8f5fe50a8297e/PyGeoj-1.0.0.tar.gz" } ] }