Top

geodata.GeoUtil module

Utilities

Module variables

var default

var feature_mapping

var feature_names

var successful_match

Functions

def capwords(

text)

Change text to Title Case. Fixes the apostrophe handling problem with title()

def get_cache_directory(

dirname)

Returns: directory for geodata cache files including DB

def get_directory_name(

)

Returns: Name of geodata data directory where geonames.org files are

def get_feature_group(

location)

If any word in location is in feature list, return the word found and the feature group Args: location:

Returns: (word, group) - feature word found, feature group it is in

def get_soundex(

txt)

Returns: Phonetics Double Metaphone Soundex code for text.

def remove_matching_sequences(

text1, text2, min_len)

Find largest sequences that match between text1 and 2. Remove them from text1 and text2. Matches will NOT include commas

Args:

text1:
text2:
min_len: minimum length of match that will be removed

Returns: text 1 and 2 with the largest text sequences in both removed

def set_debug_logging(

msg)

Set up logging configuration for debug level

Args:

msg: Initial message to log

def set_info_logging(

msg)

Set up logging configuration for info level

Args:

msg: Initial message to log

Classes

class Entry

Ancestors (in MRO)

Class variables

var ADM1

var ADM2

var FEAT

var ID

var ISO

var LAT

var LON

var MAX

var NAME

var PREFIX

var SCORE

var SDX

class Query

Query(where, args, result)

Ancestors (in MRO)

  • Query
  • builtins.tuple
  • builtins.object

Instance variables

var args

Alias for field number 1

var result

Alias for field number 2

var where

Alias for field number 0

class Result

Ancestors (in MRO)

Class variables

var DELETE

var MULTIPLE_MATCHES

var NOT_SUPPORTED

var NO_COUNTRY

var NO_MATCH

var PARTIAL_MATCH

var SOUNDEX_MATCH

var STRONG_MATCH

var WILDCARD_MATCH

var WORD_MATCH