{
"info": {
"author": "Cory Mollet",
"author_email": "contact@corymollet.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 2",
"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 :: 3.6",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Utilities"
],
"description": "sridentify\n===========\n\nOverview\n--------\n\n``sridentify`` is a command-line utility and Python API for quickly\nidentifying the `EPSG Registry Code `__\nfrom a ``.prj`` file typically associated with `ESRI\nShapefiles `__. It ships with an\nSQLite database containing mappings of `Well-known\nText `__ strings to EPSG\ncodes, the bulk of which was manually sourced and cleaned from `an ESRI\nwebsite `__.\nIt's not complete, however, and in the event you test it against a WKT\nstring not in the database it can optionally search the\n`prj2epsg.org `__ API. If the API returns an exact\nmatch, that code is returned and saved to the SQLite database. Handling\nseveral partial matches is currently planned, but not yet implemented. This feature can be disabled with the ``-n`` or ``--no-remote-api`` flags when running ``sridentify`` on the command line, or by instantiating with ``call_remote_api=False`` when using the Python API.\n\n``sridentify`` is written in Python, 2- and 3-compatible, and has no external dependencies.\n\n\nInstallation\n------------\n\nLinux, OS X, other *nixes\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n``pip install --user sridentify``\n\nThe ``--user`` is important if installing system-wide (i.e., not in a virtualenv), because the\nuser running ``sridentify`` must have write permissions on the SQLite database in the event that\n``sridentify`` tries to save a new result fetched from the ``prj2epsg`` API to the database.\n\nOn most Linux systems ``pip install --user`` will install to ``$HOME/.local`` and place the executable script\nin ``$HOME/.local/bin``. You should add this to your ``$PATH`` if you want to run ``sridentify``\nwithout having to specify the full location to the executable. On OS X ``pip install --user`` should install it to somewhere already in your ``$PATH``, but this may depend on how Python and/or pip was installed.\n\nWindows\n^^^^^^^\n\n`Anaconda `_ is your best bet for installing ``sridentify`` on Windows. Assuming you have installed Anaconda, then launching an Anaconda prompt (should be available in the Start menu under Anaconda) and running ``pip install sridentify`` should work and make the ``sridentify`` executable available on your ``%PATH%``. If you don't want to or cannot use Anaconda you should also be able to build and install ``sridentify`` systemwide or in any virtual environment with `setuptools `_.\n\nQuickstart\n----------\n\nCommand-Line usage\n------------------\n\n::\n\n usage: sridentify [-h] [-n] prj\n\n Identify an EPSG code from a .prj file\n\n positional arguments:\n prj The .prj file\n\n optional arguments:\n -h, --help show this help message and exit\n -n, --no-remote-api Do not call the prj2epsg.org API if no match found in\n the database\n\nCookbook\n^^^^^^^^\n\nGet the EPSG code from a ``.prj`` file\n\n.. code:: bash\n\n $ sridentify seattle_land_use.prj\n 2285\n\nExample use in conjunction with the ``shp2pgsql`` command-line utility that ships with `PostGIS `__. Assuming you have a PostGIS-enabled database named ``seattle``, and you have a shapefile called ``seattle_land_use`` that you want to import into that database but you're not sure what spatial projection the shapefile uses::\n\n $ shp2pgsql -s $(sridentify seattle_land_use.prj) -g the_geom -ID seattle_land_use.shp | psql -d seattle\n\nDo not call the prj2epsg.org API if no match found in the database (e.g., if running in a script or if the API is unresponsive)::\n\n $ sridentify --no-remote-api seattle_land_use.prj\n\nLet's say you have a directory full of shapefiles of different projections that you want to bulk import into PostGIS. You could use ``sridentify -n`` in a script to skip calling the API for those that don't match anything in the database for speed's sake (and politeness of not hammering away at the free prj2epsg.org service!). For example:\n\n.. code:: bash\n\n #!/usr/bin/env bash\n\n for p in $(find . -name \"*.prj\")\n do\n epsg=\"$(sridentify -n $p)\"\n if [[ ! -z \"$epsg\" ]]\n then\n shp2pgsql -s $epsg -g the_geom -ID \"${p/prj/shp}\" | psql -d my_db_name\n else\n # log the unmatched prjs to a file\n echo \"no EPSG code found for $p\" >> bulk_import.log\n fi\n done\n\nPython API usage\n-------------------\n\n.. code:: python\n\n >>> from sridentify import Sridentify\n\n >>> # Read .prj file from the filesystem\n >>> ident = Sridentify()\n >>> ident.from_file('/path/to/seattle_land_use.prj')\n >>> ident.get_epsg()\n 2285\n\n >>> # Paste in Well-Known Text string directly\n >>> ident = Sridentify(prj=\"\"\"PROJCS[\"NAD_1983_StatePlane_Washington_North_FIPS_4601_Feet\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Lambert_Conformal_Conic\"],PARAMETER[\"False_Easting\",1640416.666666667],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-120.8333333333333],PARAMETER[\"Standard_Parallel_1\",47.5],PARAMETER[\"Standard_Parallel_2\",48.73333333333333],PARAMETER[\"Latitude_Of_Origin\",47.0],UNIT[\"Foot_US\",0.3048006096012192]]\"\"\")\n >>> ident.get_epsg()\n 2285\n \n >>> # Do not call the prj2epsg.org API if no match found\n >>> ident = Sridentify(call_remote_api=False)\n >>> ident.from_file('foo.prj')\n >>> ident.get_epsg() # would return None\n >>>\n\n >>> # Instantiate with strict=False to log errors and return None\n >>> # instead of raising Exceptions when trying to read in problematic files.\n >>> ident = Sridentify(strict=False)\n >>> # example: accidentally trying to read in a binary file\n >>> ident.from_file('seattle_land_use.shp') # this would log an error message\n >>> ident.get_epsg() # would return None\n >>> ident = Sridentify(strict=True) # the default\n >>> ident.from_file('seattle_land_use.shp')\n >>> # Will raise UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 10: invalid start byte\n\n >>> # Write out a WKT string in the database to a file\n >>> ident = Sridentify()\n >>> ident.from_epsg(4269)\n >>> ident.to_prj('/path/to/4269.prj')\n\n\n\nBackground\n----------\n\nMore and more governments and organizations are making their GIS data available to the public on\nopen data portals. Local governments typically store and use GIS data in the `map projection `__ most appropriate for their location on planet Earth. For the United States, this is typically the `State Plane Coordinate System `__. Other common systems are `Universal Transverse Mercator `__, or a highly localized system that is accurate only within the geographic boundaries of the entity's jusrisdiction.\n\nESRI Shapefiles are a common format for publishing GIS data, although a \"shapefile\" with the ``.shp`` extension is really just data describing the geometry. Shapefiles are typically bundled with a ``dBase`` file ( ``.dbf`` extension ) which contains data attributes about the geometry and a small text file describing the spatial reference system of the geomtry in WKT format.\n\n``sridentify`` is not meant to be a full-fledged client library to the actual\nEPSG database. If that's what you need, you're probably looking for something like `python-epsg `__.\n\nRather, ``sridentify`` is for those looking to quickly identify the EPSG code\nof a shapefile, especially when `importing into PostGIS `__. Of course, you could use `ogr2ogr `__\nto convert everything into a web-friendly projection, like:\n\n.. code:: bash\n\n $ ogr2ogr -f PostgreSQL -t_srs EPSG:4326 PG:dbname=seattle seattle_land_use.shp\n\nBut transforming spatial data from one projection to another is a lossy operation\nand can result in coordinate drift. Ideally, you would store the original data\nin its original coordinate system and then transform copies as needed.",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/cmollet/sridentify",
"keywords": "epsg,gis,shapefile,cli",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "sridentify",
"package_url": "https://pypi.org/project/sridentify/",
"platform": "",
"project_url": "https://pypi.org/project/sridentify/",
"project_urls": {
"Homepage": "https://github.com/cmollet/sridentify"
},
"release_url": "https://pypi.org/project/sridentify/0.8.0/",
"requires_dist": null,
"requires_python": "",
"summary": "Identify the EPSG code from a .prj file",
"version": "0.8.0"
},
"last_serial": 5197498,
"releases": {
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "7947b8067192a036eba57c786fd5503c",
"sha256": "b01e2a994c97f778e5fb487804058975fae60464e7ec17b2eb37f9d6894de2a5"
},
"downloads": -1,
"filename": "sridentify-0.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "7947b8067192a036eba57c786fd5503c",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 6937,
"upload_time": "2018-02-17T18:47:51",
"url": "https://files.pythonhosted.org/packages/1b/ec/14e34833624f8401e72306ca987b7f1e6755f66c483fb95f4d5700482646/sridentify-0.2.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b3c180b3105d0ec435fb3338f850da55",
"sha256": "230bc2c1f34fe49a605909361931ebcfed16585cdb7541bea0662635d3c3bfc9"
},
"downloads": -1,
"filename": "sridentify-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "b3c180b3105d0ec435fb3338f850da55",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3919,
"upload_time": "2018-02-17T18:47:53",
"url": "https://files.pythonhosted.org/packages/4d/9f/c23440336a19fd56abe66b627288f3dd3faa340d59e5b5cea005d7215fb0/sridentify-0.2.0.tar.gz"
}
],
"0.3.0": [
{
"comment_text": "",
"digests": {
"md5": "8e4451938e0235381c3f6b8444d887ed",
"sha256": "37c5566a5be0be6624fe738141b0cb4e5a5df8eb90a1f74267ed3c4eb431d782"
},
"downloads": -1,
"filename": "sridentify-0.3.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "8e4451938e0235381c3f6b8444d887ed",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 397902,
"upload_time": "2018-02-17T21:35:47",
"url": "https://files.pythonhosted.org/packages/04/7f/3687da651ce6e20ecc2802a713f0780706cd3615af28348e578cbdb14fbd/sridentify-0.3.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "fb51dc91cbdb78d2ea5359201fb2ba6a",
"sha256": "e304418331d360579a2b33fa4ef43f4e89cedb60c802a700d620df126af23a44"
},
"downloads": -1,
"filename": "sridentify-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "fb51dc91cbdb78d2ea5359201fb2ba6a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 379973,
"upload_time": "2018-02-17T21:35:49",
"url": "https://files.pythonhosted.org/packages/25/1f/8e25bafb1617745c6ea9335187fa758faf3b4c966ad251343f305ef4bf40/sridentify-0.3.0.tar.gz"
}
],
"0.4.0": [
{
"comment_text": "",
"digests": {
"md5": "99b29bee07c9497dc8872d972f4d7c5b",
"sha256": "9154b4b23229b0a40c49431f5e436c886bf0968a19206f8191d706e262f21fd8"
},
"downloads": -1,
"filename": "sridentify-0.4.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "99b29bee07c9497dc8872d972f4d7c5b",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 398194,
"upload_time": "2018-06-11T01:09:26",
"url": "https://files.pythonhosted.org/packages/1b/a2/aa476f8425fe38c1993bd9eafc6a275754da170b4a602b7cd5a965fcac46/sridentify-0.4.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "dbb2dc1b3fdde35a0a7c6995290519e1",
"sha256": "168e9b4d4e6701b651a026d43e06e049fee9697266e7040d3033e8f86021c714"
},
"downloads": -1,
"filename": "sridentify-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "dbb2dc1b3fdde35a0a7c6995290519e1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 382111,
"upload_time": "2018-06-11T01:09:33",
"url": "https://files.pythonhosted.org/packages/0d/e8/4c80983ca2895a7843a04e1a7687b7698093f069341a7a8d80bd82ff76bf/sridentify-0.4.0.tar.gz"
}
],
"0.5.0": [
{
"comment_text": "",
"digests": {
"md5": "64ee07b7bab2e90cdbb2dbae92cf199e",
"sha256": "4c8abf1535b9edcd0a14cfdd9ac6962c57b0a4d44faa8cd5499bb3413457b4bf"
},
"downloads": -1,
"filename": "sridentify-0.5.0-py3.6.egg",
"has_sig": false,
"md5_digest": "64ee07b7bab2e90cdbb2dbae92cf199e",
"packagetype": "bdist_egg",
"python_version": "3.6",
"requires_python": null,
"size": 397740,
"upload_time": "2018-12-16T15:26:43",
"url": "https://files.pythonhosted.org/packages/02/43/22a405fa1519a07884c449cb4a6e99a2f0580d31b0484c4300f4d37c2208/sridentify-0.5.0-py3.6.egg"
},
{
"comment_text": "",
"digests": {
"md5": "c73a33739ae73dc7bb52b1d2af73bab2",
"sha256": "45c18e00828590e290fe30a7246e33fa19810e6899b4f1a498edceada29366e5"
},
"downloads": -1,
"filename": "sridentify-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "c73a33739ae73dc7bb52b1d2af73bab2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 382147,
"upload_time": "2018-12-16T15:26:45",
"url": "https://files.pythonhosted.org/packages/26/97/78f3cc9e952f239e38f725150b73acde8d336434de70c037a758ca7a69d2/sridentify-0.5.0.tar.gz"
}
],
"0.6.0": [
{
"comment_text": "",
"digests": {
"md5": "f3606826d70db7ca9e198957a3b78c72",
"sha256": "1050de2219ca8707a01b63b3b6391660d7d84a569dbe80eda03eafb7d300b0e1"
},
"downloads": -1,
"filename": "sridentify-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "f3606826d70db7ca9e198957a3b78c72",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 383721,
"upload_time": "2019-03-07T05:04:55",
"url": "https://files.pythonhosted.org/packages/ce/e8/391321b87b7a0058a3557cc9f5f1b39485a9e3119bc600c7036b2cafefed/sridentify-0.6.0.tar.gz"
}
],
"0.6.1": [
{
"comment_text": "",
"digests": {
"md5": "5c12ce6510d41ddd71770a7b4f0f24ad",
"sha256": "da5879953aa78528ab3e648dd9a756c9b76a0b0cf09bb692fd04fdcdf3349038"
},
"downloads": -1,
"filename": "sridentify-0.6.1.tar.gz",
"has_sig": false,
"md5_digest": "5c12ce6510d41ddd71770a7b4f0f24ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 383721,
"upload_time": "2019-03-07T12:46:20",
"url": "https://files.pythonhosted.org/packages/a1/79/1487db2cf3759b812404f2928f22eef9a92db54c802aba20869c9d04ff45/sridentify-0.6.1.tar.gz"
}
],
"0.6.2": [
{
"comment_text": "",
"digests": {
"md5": "7b2710a5c4c261d895296b23251a57ac",
"sha256": "fcdfe71d02bd85a2842cdc2553697f336588a5ec8f6d35dc37c0ef549b9f2780"
},
"downloads": -1,
"filename": "sridentify-0.6.2.tar.gz",
"has_sig": false,
"md5_digest": "7b2710a5c4c261d895296b23251a57ac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 383751,
"upload_time": "2019-03-07T12:52:53",
"url": "https://files.pythonhosted.org/packages/39/24/16714b0dbfb4bb1acb9ac00a29500564bf9c364a8b9df4e0ea71d34628c6/sridentify-0.6.2.tar.gz"
}
],
"0.7.0": [
{
"comment_text": "",
"digests": {
"md5": "cb0645de1e149b7931fdfd9e418f01b6",
"sha256": "04403662723fd81fa034b222ba246b9b76a09764860617eac3f163c84ca02b56"
},
"downloads": -1,
"filename": "sridentify-0.7.0.tar.gz",
"has_sig": false,
"md5_digest": "cb0645de1e149b7931fdfd9e418f01b6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 381465,
"upload_time": "2019-03-14T01:00:33",
"url": "https://files.pythonhosted.org/packages/34/17/47cae92cdb0ef40d9826e8d010f019f3c77d342e4820d889f1894a990a68/sridentify-0.7.0.tar.gz"
}
],
"0.8.0": [
{
"comment_text": "",
"digests": {
"md5": "a2ce6cd8f9a407fac2e51ef9d967d401",
"sha256": "4fff6ed32f27ccb2c7d4bc839bfa4c5e5792f25b37cad835c027b5afafa94be2"
},
"downloads": -1,
"filename": "sridentify-0.8.0.tar.gz",
"has_sig": false,
"md5_digest": "a2ce6cd8f9a407fac2e51ef9d967d401",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 385544,
"upload_time": "2019-04-27T19:32:20",
"url": "https://files.pythonhosted.org/packages/ad/07/0b7eeffee0332b77d9ebc05c6f07b6b007b097b50ebdcc5c88fcf8d2b4d2/sridentify-0.8.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "a2ce6cd8f9a407fac2e51ef9d967d401",
"sha256": "4fff6ed32f27ccb2c7d4bc839bfa4c5e5792f25b37cad835c027b5afafa94be2"
},
"downloads": -1,
"filename": "sridentify-0.8.0.tar.gz",
"has_sig": false,
"md5_digest": "a2ce6cd8f9a407fac2e51ef9d967d401",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 385544,
"upload_time": "2019-04-27T19:32:20",
"url": "https://files.pythonhosted.org/packages/ad/07/0b7eeffee0332b77d9ebc05c6f07b6b007b097b50ebdcc5c88fcf8d2b4d2/sridentify-0.8.0.tar.gz"
}
]
}