This repository has been archived by the owner on Jun 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Quickstart
alexprengere edited this page Mar 11, 2013
·
6 revisions
You can install the project using easy_install:
$ sudo easy_install -U GeoBases
Test the command line right away with:
$ GeoBase --fuzzy international --map
This should display a map containing points for each airport whose name contains international.
A more programmer friendly usage would be:
$ GeoBase --near BOD --quiet --show name
Bordeaux-Mérignac
Bordeaux
Gare de Bordeaux-Saint-Jean
Libourne
Arcachon - La Teste-de-Buch
Arcachon
--quiet
gives you the CSV display, and you can control the output using --show
.
In this example, BOD is the airport code for Bordeaux, so we are asking which point of reference are close to this airport.
If you want to learn more about the possibilities, use the learning mode:
$ GeoBase --ask
After installation, import the class and create the object:
>>> from GeoBases import GeoBase
>>> g = GeoBase(data='ori_por', verbose=False)
Then you can have information access:
>>> g.get('ORY', 'name')
'Paris-Orly'
Perform a geographical search:
>>> sorted(g.findNearPoint((48.85, 2.35)))[0] # Paris
(0.389, 'PAR')
Now you can read the Python examples, the Command line examples, or get to know more about the Data sources!