*! version 8.0 23 Agust 2014

help goelevation

Title

goelevation -- Elevation for langitude and longidute from google

Syntax

goelevation
[, options]

Main
lat latitude variable.

lng longitude variable.

saving Save data in memory to file in Stata format.

replace Replace current data set from elevation data.

ptah Path from latitude and longitude.

samples Number of sample points to mesaure elevation. Default size is 100.

nograph Without drawing elevation profile graphs.

map Map type to draw the path on google map. Default map is terrain map.

Description

goelevation The program can be used for two purposes. 1- If the location has gps codes from latitude and longitude this program will calculate the elevation for each point using google map data (API). 2. If two locations specify usign latitude and longitude this will calculate elevation for straight line between these two (or more than two) locations. This program has been tested with decimal degrees.

Internet connection is necessary in order to run this program. User limitation and rectriction of the google map API 3 is avaiable at "https://developers.google.com/maps/documentation/elevation/"

Options

Main

lat	- Latitude varaible should be specify when calculating elevation for location.

lng	- Longitude varaible should be specify when calculating elevation for location.

saving	- Saving option can be used to save the elevation data. Either saving or replace should be use in order to execute goelevation command.

replace	- Replace option drop the current data and keep the elevation data on Stata. Either saving or replace should be use in order to execute goelevation command.

path	- When calculating elevation for specific two location path should be specify. Path should be given in decimal degrees and it should be correct order(latitude,longitude) and separated by comma ",". Spaces does not allow anywhere in the path.

samples	- Samples uses to indicate number of points for elevation between two locations. Default value is 100.

nograph	- Nograph option ignore the elevation profile graphs.

map	- User can define which type of map should be used to show the path on google map. The default map is terrain. Currently roadmap is support with this option.

Examples

1. To calculate elevation for a data file with gps locaitons:

clear
. set obs 3
. gen latitude =.
. gen longitude=.
. replace latitude=6.925928 in 1
. replace longitude=79.902935 in 1
. replace latitude=7.307487 in 2
. replace longitude=80.603313 in 2
. replace latitude=7.292503 in 3
. replace longitude=80.229778 in 3
. list
. goelevation, lat(latitude) lng(longitude) replace
. list

. goelevation, lat(latitude) lng(longitude) replace
(click to run)

2. To create elevation profile for two locations

. goelevation,path(6.926014,79.850750|5.950742,80.532074) replace
(click to run)

3. To create elevation profile for 3 locations with sample points of 200

. goelevation,path(45.420543,-75.709620|43.649001,-79.399679|51.085205,-114.082395)replace samples(200)map(roadmap)
(click to run)

Authors

K. Chamara Anuranga

Institute for Health Policy

Sri Lanka

J.V. Jayanthan

University of Calgary

Canada

jvjayant@gmail.com