-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmaptile_geolist.ado
43 lines (30 loc) · 1.13 KB
/
maptile_geolist.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, stepner@mit.edu
/*** 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_geolist
version 11
set more off
syntax [, geofolder(string)]
* Set default directory
if (`"`geofolder'"'=="") local geofolder `c(sysdir_personal)'maptile_geographies
* Check that the specified directory exists (based on confirmdir.ado code by Dan Blanchette)
local current_dir `"`c(pwd)'"'
quietly capture cd `"`geofolder'"'
if _rc!=0 {
di as error `"unable to load directory `geofolder'"'
exit 198
}
quietly cd `"`current_dir'"'
* Store all relevant files in local
local geos : dir `"`geofolder'"' files "*_maptile.ado"
* Output geo_names
if (`"`geos'"'=="") di as text "no geography templates found"
else {
di `: subinstr local geos "_maptile.ado" " ", all'
}
end