{ "info": { "author": "NPR Visuals", "author_email": "nprapps@npr.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "# mapturner\n\nA command line utility for generating consolidated [TopoJSON](https://github.com/mbostock/topojson/wiki/Command-Line-Reference) from various data sources. Used for making fast vector maps with D3.\n\nImportant links:\n\n* Repository: https://github.com/nprapps/mapturner\n* Issues: https://github.com/nprapps/mapturner/issues\n\n## Install\n\nYou will need to have the following non-Python dependencies installed:\n\n* ogr2ogr (GDAL): `brew install ogr2ogr`\n* topojson@1.6.27: (topojson 2+ does not work)\n\nmapturner itself can be installed with pip:\n\n```\npip install mapturner\n```\n\nNote: Since `mapturner` relies on topojson 1.x (old version of topojson), we recommend installing this version of topojson inside your project root folder by running:\n\n```\nnpm install -g topojson@1.6.27 --prefix node_modules\n```\n\nTo install topojson@1.6.27 globally instead run:\n\n```\nnpm install -g topojson@1.6.27\n```\n\n`mapturner` will search first for the topojson binaries installed within the project and fallback to searching the topojson binary on your $PATH.\n\n\nDeveloper install process:\n\n```\ngit clone git://github.com/nprapps/mapturner.git\ncd mapturner\nmkvirtualenv mapturner\n\npip install -r requirements.txt\n\npython setup.py develop\n```\n\n## Usage\n\nDefine a YAML configuration file, such as the following example. The complete list of valid options is further on in this documentation.\n\n```\nbbox: '77.25 24.28 91.45 31.5'\nlayers:\n countries:\n type: 'shp'\n path: 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip'\n id-property: 'NAME'\n properties:\n - 'country=NAME'\n\n cities:\n type: 'shp'\n path: 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places_simple.zip'\n id-property: 'name'\n properties:\n - 'featurecla'\n - 'city=name'\n where: adm0name = 'Nepal' AND scalerank < 8\n\n quakes:\n type: 'csv'\n path: 'examples/nepal.csv'\n all-properties: True\n```\n\nThen run it!\n\n```\nmapturner input.yaml output.json\n```\n\nThe following layer types are currently supported:\n\n* ESRI Shapefile (`shp`)\n* GeoJSON or TopoJSON (`json`)\n* CSV (`csv`)\n\n## How it works\n\nFor each layer defined in the configuration file:\n\n* If path is a URL the file will be downloaded and cached locally. (It will not be redownloaded on subsequent runs.)\n* If path is to a zipped file it will be unzipped.\n* All layers will be clipped to the specified bounding box (using ogr2ogr).\n* For each layer, if a `where` attribute is specified, the layer data will be filtered by that clause.\n* For each layer, all fields in the layer *not* specified in the `properties` array will be removed (to reduce file size), unless `all-properties` is specified, in which case all will be kept.\n* For each layer, if an `id-property` is set, data from that property will be set as the identifier for the features in the layer.\n* The layer will be converted to [TopoJSON](https://github.com/mbostock/topojson/wiki/Command-Line-Reference).\n\nAfter each layer has been processed all of them will be concatenated into a single TopoJSON file. Each layer's key name will be used to identify it in the output.\n\n## Complete list of configuration options\n\nFor all layer types:\n\n* `type`: The type of layer. Valid types are `shp`, `json` (GeoJSON or TopoJSON), and `csv`. **(Required)**\n* `path`: The path (relative or absolute) to the layer data file. **(Required)**\n* `id-property`: A property from the data file to use as the unique identifier for features. See also, [the TopoJSON command-line documentation](https://github.com/mbostock/topojson/wiki/Command-Line-Reference).\n* `properties`: A list of properties from the data to be kept in the output. All other properties are dropped.\n* `all-properties`: If true, then all properties are kept for this layer.\n* `where`: A SQL-like query predicate that will filter the feature data. This This uses exactly the same query syntax as [ogr2ogr](http://www.gdal.org/ogr2ogr.html).\n\nCSV layers only:\n\n* `latitude`: The name of a column in the data containing the latitude of the point/feature.\n* `longitude`: The name of a column in the data containing the longitude of the point/feature.\n\n## Cached data\n\nCached shapefiles are stored in `~/.mapturner`. You may wish to clear this folder periodically to free up space and ensure updated shapefiles are redownloaded.", "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/nprapps/mapturner", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "mapturner", "package_url": "https://pypi.org/project/mapturner/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mapturner/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/nprapps/mapturner" }, "release_url": "https://pypi.org/project/mapturner/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "A command line utility for compiling map data.", "version": "0.2.1" }, "last_serial": 2939244, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b0aad852ac37d0c9becca8fc28d20c12", "sha256": "43562d3f71549d660281b7bceaaccbbe9d58fdf8180cffae7379223ca9130b7e" }, "downloads": -1, "filename": "mapturner-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b0aad852ac37d0c9becca8fc28d20c12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4309, "upload_time": "2015-05-14T20:04:18", "url": "https://files.pythonhosted.org/packages/8c/75/42d326dbe168f7884c5521ac8d47a64c061e4430d5fbcd4f614282c962b2/mapturner-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "40780052baaa41649c47faf928be2691", "sha256": "1b7f402e419006fe2d496cd6769ff0de078074633c29fd561102051aa513ee27" }, "downloads": -1, "filename": "mapturner-0.1.1.tar.gz", "has_sig": false, "md5_digest": "40780052baaa41649c47faf928be2691", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4429, "upload_time": "2015-05-14T20:07:31", "url": "https://files.pythonhosted.org/packages/1e/d6/b1e444b8e18d9d5f53d6ae5b691a89e9017b00ae224b827b0b9fdc2baca9/mapturner-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "05b8fe53fa83ea1a96f2ff147885b556", "sha256": "f58357d92527274b96468180418414cfea5f2e0bbd2011e553fe479774155b88" }, "downloads": -1, "filename": "mapturner-0.1.2.tar.gz", "has_sig": false, "md5_digest": "05b8fe53fa83ea1a96f2ff147885b556", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4474, "upload_time": "2015-05-14T20:14:22", "url": "https://files.pythonhosted.org/packages/ef/2a/a8f10d7326c6c5faf5e3de05292906f66fbcbbd0e27b0d00b97523292e2e/mapturner-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "b094278fc8f22792c2b396212285301b", "sha256": "5ee072e70735f84d6ec6cfb3e60263a82142fa82e37ecbbf5d42f0af655b5d1e" }, "downloads": -1, "filename": "mapturner-0.1.3.tar.gz", "has_sig": false, "md5_digest": "b094278fc8f22792c2b396212285301b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4672, "upload_time": "2015-05-14T20:39:49", "url": "https://files.pythonhosted.org/packages/5f/3d/38402bc112a124df20092b1efdc6e50a6d8693c9e4e04b8f68d213ffe955/mapturner-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "3bd0ebe098ef02c4766038f46cefc785", "sha256": "7d5c329d32fbebf50a0e0f67136988b602105ba9043afdd2deddf892e37c84a4" }, "downloads": -1, "filename": "mapturner-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3bd0ebe098ef02c4766038f46cefc785", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5460, "upload_time": "2015-05-15T19:16:23", "url": "https://files.pythonhosted.org/packages/5e/53/a32a2d77d995cb3bf2a62a2ea35c1cb1b49df20f0d68d75dbc81dde3dea7/mapturner-0.1.4.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "8cdfef28247c135dfbd73325c37e8773", "sha256": "65e0e8db129953987fe44b015fefd5c75a7350a41fd7119f0a0b624f94918080" }, "downloads": -1, "filename": "mapturner-0.2.1.tar.gz", "has_sig": false, "md5_digest": "8cdfef28247c135dfbd73325c37e8773", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6889, "upload_time": "2017-06-09T20:50:47", "url": "https://files.pythonhosted.org/packages/7e/1c/5efa20803f564b82b4a06d6500f447ed49d6fa3b4976162a15c060180119/mapturner-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8cdfef28247c135dfbd73325c37e8773", "sha256": "65e0e8db129953987fe44b015fefd5c75a7350a41fd7119f0a0b624f94918080" }, "downloads": -1, "filename": "mapturner-0.2.1.tar.gz", "has_sig": false, "md5_digest": "8cdfef28247c135dfbd73325c37e8773", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6889, "upload_time": "2017-06-09T20:50:47", "url": "https://files.pythonhosted.org/packages/7e/1c/5efa20803f564b82b4a06d6500f447ed49d6fa3b4976162a15c060180119/mapturner-0.2.1.tar.gz" } ] }