Skip to content

whosonfirst/py-mapzen-whosonfirst-names

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-mapzen-whosonfirst-names

Python tools for working with place names in Who's On First data

Install

sudo pip install -r requirements.txt .

Important

Note that as of this writing the naming conventions for wof data are not reflected in the whosonfirst-data repository.

Usage

mapzen.whosonfirst.names.labels

import mapzen.whosonfirst.names

lbl = mapzen.whosonfirst.names.labels()
names = ("fin_p", "eng_s", "unk_v")

for n in names:
	print n

	n2 = lbl.convert(n, 'geoplanet', 'wof')
	print n2

	n3 = lbl.convert(n2, 'wof', 'subtags')
	print n3

	n4 = lbl.convert(n3, 'subtags', 'wof')
	print n4

	n5 = lbl.convert(n4, 'wof', 'geoplanet')
	print n5

Would yield:

fin_p
fin_x_prefered
fin-x-prefered
fin_x_prefered
fin_p
eng_s
eng_x_colloquial
eng-x-colloquial
eng_x_colloquial
eng_s
unk_v
und_x_variant
und-x-variant
und_x_variant
unk_v

See also

About

Python tools for working with place names in Who's On First data

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages