Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

# Reshaper

Project Description

# Reshaper

Splits and recombines shapefiles based on lat-long data.

## Installation

conda install -c conda-forge gdal pip install reshaper

## Usage

To split a state map based on a branch list, use:

reshaper state.shp branch.csv output.shp –id branchname –lat lat_col –lng lng_col

This takes 3 arguments:

  • state.shp: path to the original shapefile
  • branch.csv: path to the CSV file with points data. The output shapefile will have one shape per row of this file
  • output.shp: path to the output shapefile

branch.csv should have at least these 3 indicators:

  • –id branchname: indicates that the branchname column holds the branch identifier. The values in this column must be unique
  • –lat lat_col: the lat_col column holds the latitude in degrees
  • –lng lng_col: the lng_col column holds the longitude in degrees

The program splits and re-combines shapes based the following logic:

  • If a state does not have a branch, assign it fully to the nearest branch
  • If a state has only one branch, assign it fully to that branch
  • If a state has multiple branches, split it between the branches and assign each broken state to the respective branch

The output shapefile has an id column holding the –id value.

## Release

Change the “version” in setup.py to “x.x.x”, commit and tag:

git commit . -m”Describe features / bug fixes” git tag -a vx.x.x -m”one-line summary of release”

To [distribute](https://packaging.python.org/en/latest/distributing.html), run:

rm -rf build dist flake8 . python setup.py test python setup.py sdist bdist_wheel –universal twine upload dist/*
Release History

Release History

This version
History Node

1.1.0

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
reshaper-1.1.0-py2.py3-none-any.whl (6.3 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Aug 28, 2017
reshaper-1.1.0.tar.gz (4.2 kB) Copy SHA256 Checksum SHA256 Source Aug 28, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting