Skip to content

lib-geo 库参考 ​

原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793259306/FIN+5.3.1+lib-geo 中文整理基于 FIN 5.3.1

导读: 地理位置功能库

以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。


目录(导读) ​

  • lib
  • meta
  • docs
  • funcs
  • Overview
  • Model
  • geoCountryCode(name, checked: true)
  • geoCountryName(code, checked: true)
  • geoTz(val)
  • geoUsStateCode(name, checked: true)
  • geoUsStateName(code, checked: true)

概述(中译) ​

地理位置功能库


API 正文(英文) ​

docs ​

Overview • Model


funcs ​

geoCountryCodeNormalize a country name into its two letter ISO-3166 code
geoCountryNameGiven a two ISO-3166 country code or country name, return a country name
geoTzGiven a dict/row that contains primary geo tags such as geoCountry, geoState, and geoCity return ideal timezone name
geoUsStateCodeNormalize a US state name into its standard two letter postal code
geoUsStateNameGiven a two letter postal code or state name, return a US state name

lib geo ​

Overview ​

The GeoExt is used to define the basic model of geographical information and geo-coding functions.

Model ​

The following are the key tags to assocaite a record with a geographic location:

  • geoAddr: full geographic address
  • geoStreet: street number and name
  • geoCity: city name
  • geoState: region or US two-letter state code
  • geoCountry: ISO 3166-1 two letter country code
  • geoPostalCode: US zip code or country specific postal code
  • geoCoord: geographic coordinate as latitude, longitude

Here is an example of a site entity fully tricked out with geolocation tags:

dis: "White House"
site
area: 55,000 ft²
tz: "New_York"
weatherStationRef: <Weather in Washington, DC>
geoAddr: "1600 Pennsylvania Avenue NW, Washington, DC"
geoStreet: "1600 Pennsylvania Ave NW"
geoCity: "Washington D.C."
geoCountry: "US"
geoPostalCode: "20500"
geoState: "DC"
geoCoord: C(38.898,-77.037)


def ​

func:geoCountryCode ​

geoCountryCode(name, checked: true) ​

Normalize a country name into its two letter ISO-3166 code. If the country is not recognized, then return null or throw exception based on checked flag.


meta ​

deffunc:geoCountryCode
isfunc
liblib:geo
namegeoCountryCode

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:geoCountryName ​

geoCountryName(code, checked: true) ​

Given a two ISO-3166 country code or country name, return a country name. If the country is not recognized, then return null or throw exception based on checked flag.


meta ​

deffunc:geoCountryName
isfunc
liblib:geo
namegeoCountryName

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:geoTz ​

geoTz(val) ​

Given a dict/row that contains primary geo tags such as geoCountry, geoState, and geoCity return ideal timezone name.

NOTE: if your city or country is not correctly modeled by this function then please let us know and we can update our database.


meta ​

deffunc:geoTz
isfunc
liblib:geo
namegeoTz
overridable✓

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:geoUsStateCode ​

geoUsStateCode(name, checked: true) ​

Normalize a US state name into its standard two letter postal code. If the state is not recognized, then return null or throw exception based on checked flag.


meta ​

deffunc:geoUsStateCode
isfunc
liblib:geo
namegeoUsStateCode

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:geoUsStateName ​

geoUsStateName(code, checked: true) ​

Given a two letter postal code or state name, return a US state name. If the state is not recognized, then return null or throw exception based on checked flag.


meta ​

deffunc:geoUsStateName
isfunc
liblib:geo
namegeoUsStateName

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function