Digital Geography

Attribute Updating using ArcPy

After my first attempt in Python scripting using opensource Geospatial Data Abstraction Library (GDAL), I wanted to use ArcPy  in my second trial. The following code is so simple. You can use it to update the attribute table of a shapefile based on another shapefile/table. Let me break it down using this pseudo-code: Choose the first shapefile (the source). Identify the unique ID field in that shapefile. Write down all the values from the desired field (to replace the old values). Choose the second shapefile (the destination). Search for the unique ID records which meet that unique ID field in (step 2). Update…

importing shapefiles in Python

Python is a very common scripting language which seems like a swiss knife for programming. This is the reason to use it as a framework for the program “where are your customers“. In this context I need to import the shapefile into Python. Therefore the guys at geospatialpython present a nice module to import shapefiles into python. First install the file using easy-install/pip. Therefore open the terminal: