-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
GeolocationTags.ts
64 lines (62 loc) · 1.97 KB
/
GeolocationTags.ts
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
export const GeolocationTagNames = [
"GeolocationBearing",
"GeolocationCity",
"GeolocationCountry",
"GeolocationCountryCode",
"GeolocationDistance",
"GeolocationFeatureCode",
"GeolocationFeatureType",
"GeolocationPopulation",
"GeolocationPosition",
"GeolocationRegion",
"GeolocationSubregion",
"GeolocationTimeZone",
] satisfies (keyof GeolocationTags)[]
/**
* Is the given tag name intrinsic to the content of a given file? In other
* words, is it not an artifact of a metadata field?
*/
export function isGeolocationTag(name: string): name is keyof GeolocationTags {
return GeolocationTagNames.includes(name as any)
}
/**
* These tags are only available if {@link ExifToolOptions.geolocation} is true
* and the file has valid GPS location data.
*
* @see https://exiftool.org/geolocation.html#Read
*/
export interface GeolocationTags {
/** ☆☆☆☆ ✔ Example: 99 */
GeolocationBearing?: number
/** ☆☆☆☆ ✔ Example: "Zürich" */
GeolocationCity?: string
/** ☆☆☆☆ ✔ Example: "United States" */
GeolocationCountry?: string
/** ☆☆☆☆ ✔ Example: "US" */
GeolocationCountryCode?: string
/** ☆☆☆☆ ✔ Example: "9.60 km" */
GeolocationDistance?: string
/**
* ☆☆☆☆ ✔ Example: "PPLL"
* @see http://www.geonames.org/export/codes.html#P
*/
GeolocationFeatureCode?: string
/** ☆☆☆☆ ✔ Example: "Populated Place" */
GeolocationFeatureType?: string
/** ☆☆☆☆ ✔ Example: 95000 */
GeolocationPopulation?: number
/** ☆☆☆☆ ✔ Example: "7.3397, 134.4733" */
GeolocationPosition?: string
/** ☆☆☆☆ ✔ Example: "Île-de-France" */
GeolocationRegion?: string
/** ☆☆☆☆ ✔ Example: "Yokohama Shi" */
GeolocationSubregion?: string
/** ☆☆☆☆ ✔ Example: "Pacific/Saipan"
*
* IANA time zone name
*
* @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
*/
GeolocationTimeZone?: string
GeolocationWarning?: string
}