Administrative areas of South America

I needed all first level administrative areas for  South America. That was my way of getting them:

# get admin 1 for south america
mkdir gadm_sa
cd gadm_sa

# download the data
for country in COL ECU BRA BOL ARG PER GUY GUF VEN SUR PRY URY CHL
do
wget http://www.gadm.org/data/shp/${country}_adm.zip
unzip ${country}_adm.zip
done

# merge them to one shapefile
ogr2ogr sa_adm1.shp COL_adm1.shp

for country in ECU BRA BOL ARG PER GUY GUF VEN SUR PRY URY CHL
do
ogr2ogr -update -append sa_adm1.shp ${country}_adm1.shp -nln sa_adm1
done
Advertisements
This entry was posted in BASH, GRASS. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s