I am starting with a shapefile of census tracts and a shapefile of counties. I am trying to calculate the shortest distance from the centroid of every census tract to every county bordering the county containing the census tract. For example, say County A borders 4 other counties (B, C, D, and E), and suppose census tract X is in County A. The output table will have four rows for census tract X. One row will have the shortest distance from the centroid of tract X to the border of county B. There will be three additional rows for X to C, X to D, and X to E. This will be the case for every census tract in the US. I will need generate the same file for census blocks as well. Does anyone have a python script that could be useful for this or advice for a GIS newcomer with this complex task?

closed as off-topic by mgri, Mapperz Mar 30 '17 at 16:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – mgri, Mapperz
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Your question might attract answers if you amend your question and include an image of what you are asking. – Hornbydd Mar 30 '17 at 15:32