This is an example of how to obtain and add elevation to a csv file. If starting with a shapefile, you can convert to CSV using the ogr2ogr command:
ogr2ogr -f CSV bars_sm.csv bars_sm.shp -lco GEOMETRY=AS_XY
Once you have a CSV file, run the python script points_elev.py in the same directory as the CSV file with python points_elev.py
. The script requires the python geocoder library to be installed.
The script should write out a new CSV file with an additional elevation column. If no elevation is found, the script will simply add a 0 in the elevation column.
The bars_sm.csv file included in this gist is a small subset of a much larger file, but I have no idea of the original source.