Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a descriptor of the Earth's polygons in GeoJSON format.
For correct operation, DB must be created using the constructor (New) based on the required parameters and optional components. After successful creation, The DB is immediately ready to work through API.
func New ¶
New creates a new instance of the DB.
Panics if at least one value of the parameters is invalid.
The created DB does not require additional initialization and is completely ready for work.
func (*DB) PointContinent ¶
PointContinent goes through all polygons, and returns continent in which point is located.
Returns locodedb.ContinentUnknown if no entry matches.
All GeoJSON feature are parsed from file once and stored in memory.
type Prm ¶
type Prm struct { // Path to polygons of Earth's continents in GeoJSON format. // // Must not be empty. Path string }
Prm groups the required parameters of the DB's constructor.
All values must comply with the requirements imposed on them. Passing incorrect parameter values will result in constructor failure (error or panic depending on the implementation).