{ "info": { "author": "Mike Kittridge", "author_email": "mullenkamp1@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "PyCRSx\r\n=======\r\n\r\nPyCRSx is a modified clone of the `PyCRS package `_ to make it compatible on Python 3.5 and 3.6.\r\n\r\nPyCRSx is a pure Python GIS package for reading, writing, and converting\r\nbetween various common coordinate reference system (CRS) string and data\r\nsource formats.\r\n\r\nBelow is the description from the original PyCRS package.\r\n\r\nIntroduction\r\n-------------\r\n\r\nPython should have a standalone GIS library focused solely on coordinate\r\nreference system metadata. That is, a library focused on the various\r\nformats used to store and represent crs definitions, including OGC WKT,\r\nESRI WKT, Proj4, and various short-codes defined by organizations like\r\nEPSG, ESRI, and SR-ORG. Correctly parsing and converting between these\r\nformats is essential in many types of GIS work. For instance when trying\r\nto use PyProj to transform coordinates from a non-proj4 crs format. Or\r\nwhen wanting to convert the crs from a GeoJSON file to a .prj file. Or\r\nwhen simply adding a crs definition to a file that was previously\r\nmissing one.\r\n\r\nWhen I created PyCRS, the only way to read and convert between crs\r\nformats was to use the extensive Python GDAL suite and its srs\r\nsubmodule, but the requirements of some applications might exclude the\r\nuse of GDAL. There have also been some online websites/services, but\r\nthese only allow partial lookups or one-way conversion from one format\r\nto another. I therefore hope that PyCRS will make it easier for\r\nlightweight applications to read a broader range of data files and\r\ncorrectly interpret and possibly transform their crs definitions.\r\nWritten entirely in Python I also hope it will help clarify the\r\ndifferences between the various formats, and make it easier for more\r\npeople to help keep it up-to-date and bug-free.\r\n\r\nStatus\r\n------\r\n\r\nCurrently, the supported formats are OGC WKT (v1), ESRI WKT, Proj4, and\r\nany EPSG, ESRI, or SR-ORG code available from spatialreference.org. In\r\nthe future I hope to add support for OGC URN identifier strings, and\r\nGeoTIFF file tags.\r\n\r\nThe package is still in alpha version, so it will not perfectly parse or\r\nconvert between all crs, and it is likely to have several (hopefully\r\nminor) differences from the results of other parsers like GDAL. In the\r\nsource repository there is a tester.py script, which uses a barrage of\r\ncommonly used crs as listed on\r\nhttp://www.remotesensing.org/geotiff/proj\\_list/. Currently, the overall\r\nsuccess rate for loading as well as converting between the three main\r\nformats is 70-90%, and visual inspections of rendering the world with\r\neach crs generally look correct. However, whether the converted crs\r\nstrings are logically equivalent to each other from a mathematical\r\nstandpoint is something that needs a more detailed quality check.\r\n\r\nPlatforms\r\n---------\r\n\r\nPython 2 and 3, all systems (Windows, Linux, and Mac).\r\n\r\nDependencies\r\n------------\r\n\r\nPure Python, no dependencies.\r\n\r\nInstalling it\r\n-------------\r\n\r\nPyCRSx is installed with pip from the commandline:\r\n\r\n::\r\n\r\n pip install pycrsx\r\n\r\nIt also works to just place the \"pycrsx\" package folder in an importable\r\nlocation like \"PythonXX/Lib/site-packages\".\r\n\r\nPyCRSx can also be installed via conda:\r\n\r\n::\r\n\r\n conda install -c mullenkamp pycrsx\r\n\r\nExample Usage\r\n-------------\r\n\r\nBegin by importing the pycrs module:\r\n\r\n::\r\n\r\n import pycrsx\r\n\r\nReading\r\n~~~~~~~\r\n\r\nThe first point of action when dealing with a data source's crs is that\r\nyou should be able to parse it correctly. In most situations this will\r\nmean reading the ESRI .prj file that accomponies a shapefile or some\r\nother file. PyCRS has a convenience function for doing that:\r\n\r\n::\r\n\r\n fromcrs = pycrsx.loader.from_file(\"path/to/shapefilename.prj\")\r\n\r\nThe same function also supports reading the crs from GeoJSON files:\r\n\r\n::\r\n\r\n fromcrs = pycrsx.loader.from_file(\"path/to/geojsonfile.json\")\r\n\r\nIf your crs is not defined in a file there are also functions for that.\r\nFor instance if you know the url where the crs is defined you can do:\r\n\r\n::\r\n\r\n fromcrs = pycrsx.loader.from_url(\"www.somesite.com/someproj\")\r\n\r\nOr if you are provided with the actual string representation of the crs,\r\ngiven by a web service for instance, you can load it using the\r\nappropriate function from the parser module or let PyCRS autodetect and\r\nload the crs type for you:\r\n\r\n::\r\n\r\n fromcrs = pycrsx.parser.from_unknown_text(somecrs_string)\r\n\r\nConverting\r\n~~~~~~~~~~\r\n\r\nOnce you have read the crs of the original data source, you may want to\r\nconvert it to some other crs format. A common reason for wanting this\r\nfor instance, is if you want to reproject the coordinates of your\r\nspatial data. In Python this is typically done with the PyProj module\r\nwhich only takes proj4 strings, so you would have to convert your\r\ndatasource's crs to proj4:\r\n\r\n::\r\n\r\n fromcrs_proj4 = fromcrs.to_proj4()\r\n\r\nYou can then use PyCRS to define your target projection in the string\r\nformat of your choice, before converting it to the proj4 format that\r\nPyProj expects:\r\n\r\n::\r\n\r\n tocrs = pycrsx.parser.from_esri_code(54030) # Robinson projection from esri code\r\n tocrs_proj4 = tocrs.to_proj4()\r\n\r\nWith the source and target projections defined in the proj4 crs format,\r\nyou are ready to transform your data coordinates with PyProj, which is\r\nnot covered here.\r\n\r\nWriting\r\n~~~~~~~\r\n\r\nAfter you transform your data coordinates you may also wish to save the\r\ndata back to file along with the new crs. With PyCRS you can do this in\r\na variety of crs format. For instance:\r\n\r\n::\r\n\r\n with open(\"shapefile.prj\", \"w\") as writer:\r\n writer.write(tocrs.to_esri_wkt())\r\n\r\nPyCRS also gives access to each crs element and parameter that make up a\r\ncrs in the \"elements\" subpackage, so you could potentially also build a\r\ncrs from scratch and then save it to a format of your choice. Inspect\r\nthe parser submodule source code for inspiration on how to go about\r\nthis.\r\n\r\nMore Information:\r\n-----------------\r\n\r\nThis tutorial only covered some basic examples. For the full list of\r\nfunctions and supported crs formats, check out the API Documentation.\r\n\r\n- `Home Page `__\r\n- `API Documentation `__\r\n\r\nLicense:\r\n--------\r\n\r\nThis code is free to share, use, reuse, and modify according to the MIT\r\nlicense, see license.txt\r\n\r\nCredits:\r\n--------\r\n\r\n- Karim Bahgat\r\n- Micah Cochrain\r\n- Wassname\r\n\r\nChanges\r\n-------\r\n\r\n0.1.3 (2016-06-25)\r\n~~~~~~~~~~~~~~~~~~\r\n\r\n- Fixed various bugs\r\n- Pip install fix for Mac and Linux\r\n- Python 3 compatability\r\n\r\n0.1.2 (2015-08-05)\r\n~~~~~~~~~~~~~~~~~~\r\n\r\n- First official release\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mullenkamp/PyCRSx", "keywords": "GIS spatial CRS coordinates format", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pycrsx", "package_url": "https://pypi.org/project/pycrsx/", "platform": "", "project_url": "https://pypi.org/project/pycrsx/", "project_urls": { "Homepage": "https://github.com/mullenkamp/PyCRSx" }, "release_url": "https://pypi.org/project/pycrsx/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "GIS package for reading, writing, and converting between CRS formats.", "version": "1.0.2" }, "last_serial": 4130503, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e30d04df892e1f40bff003780275e510", "sha256": "c3dacf98e3e860d936d67bcb427f990d1a99de89bfa8c51be4a24f3f40e212fe" }, "downloads": -1, "filename": "pycrsx-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e30d04df892e1f40bff003780275e510", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24281, "upload_time": "2018-08-02T21:42:36", "url": "https://files.pythonhosted.org/packages/f5/b8/1388063d77366c221abb5ef9a0f909ae1f7d39efbb83e1f3d9cfc4b5c2e8/pycrsx-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "b764485d50628ac249f095e39af026c1", "sha256": "1a0dce7d1c05c35dd27fe8fa5d1ba33df2ebe190e43835a8db199144608601ab" }, "downloads": -1, "filename": "pycrsx-1.0.1.tar.gz", "has_sig": false, "md5_digest": "b764485d50628ac249f095e39af026c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24521, "upload_time": "2018-08-02T21:48:47", "url": "https://files.pythonhosted.org/packages/d5/d7/3024f1816b8ddc4ab51d3e082edbf03bd32c5f39b2d1987f6218db4ff745/pycrsx-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "828f8992cdae1b73d7e1c8a86183eff0", "sha256": "f5759da682294d1008388b8b917d33bedfbf85540456680bf55590980175e20f" }, "downloads": -1, "filename": "pycrsx-1.0.2.tar.gz", "has_sig": false, "md5_digest": "828f8992cdae1b73d7e1c8a86183eff0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25549, "upload_time": "2018-08-02T22:07:08", "url": "https://files.pythonhosted.org/packages/3f/e8/3c3637dd8341f957005d7df1125760755f7b3d30b41d32f3e674e1590265/pycrsx-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "828f8992cdae1b73d7e1c8a86183eff0", "sha256": "f5759da682294d1008388b8b917d33bedfbf85540456680bf55590980175e20f" }, "downloads": -1, "filename": "pycrsx-1.0.2.tar.gz", "has_sig": false, "md5_digest": "828f8992cdae1b73d7e1c8a86183eff0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25549, "upload_time": "2018-08-02T22:07:08", "url": "https://files.pythonhosted.org/packages/3f/e8/3c3637dd8341f957005d7df1125760755f7b3d30b41d32f3e674e1590265/pycrsx-1.0.2.tar.gz" } ] }