-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmaptile_install.ado
43 lines (30 loc) · 1.14 KB
/
maptile_install.ado
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
*! version 1.0.5 22june2017 Michael Stepner, [email protected]
/*** Unlicence (abridged):
This is free and unencumbered software released into the public domain.
It is provided "AS IS", without warranty of any kind.
For the full legal text of the Unlicense, see <http://unlicense.org>
*/
* Why did I include a formal license? Jeff Atwood gives good reasons:
* http://blog.codinghorror.com/pick-a-license-any-license/
program define maptile_install
version 11
syntax using/, [replace]
* Ensure that the directories exist
cap mkdir "`c(sysdir_personal)'"
cap mkdir "`c(sysdir_personal)'maptile_geographies"
* Copy/download the specified geography
qui copy `"`using'"' `"`c(sysdir_personal)'maptile_geographies/temp.zip"', replace
* Change to the target directory
local cwd `c(pwd)'
di as text ""
cd `"`c(sysdir_personal)'maptile_geographies"'
* Extract the geography
unzipfile temp.zip, `replace'
erase temp.zip
* Change back to original directory
qui cd `"`cwd'"'
* Suggest reading help file
di as text ""
di as text "To see the help file of the geography template, run:"
di as text " {cmd:maptile_geohelp} {it:geoname}"
end