2

I'm script challenged and trying to repair a shapefile with a missing .shx. This tool sounds ideal: https://code.google.com/p/pyshp/, but the four step instructions are not enough. Can someone give me a quick walk through how you would run this tool.

Martin
  • 4,928
  • 10
  • 40
  • 57
gorddev
  • 25
  • 3

1 Answers1

3

You need to paste the file in your Python installation folder. For me, I want it in my ArcGIS installation of Python so I would paste it in the folder C:\Python27\ArcGIS10.1. Then you can import it from the command prompt with

import shapefile

To set the directory, type:

import arcpy
from arcpy import env
env.workspace = r"C:/.../folder with shapefiles"

After that you are all set to use the function, try some of the examples at the bottom of the page you linked to in your question. It also links to http://geospatialpython.com/, which has got more examples and use cases.

Martin
  • 4,928
  • 10
  • 40
  • 57