ustroetz/cost_model — pull request #20 by perrygeo (2013-07-13 00:15:52+00:00)
Title: Additional changes for forest planner integration

Here are some additional changes that will make it much easier to use the cost model as an external module (e.g. using it from the forest planner or other projects):

* Put python code into a python package directory `forestcost`
- Users can run standard installation methods like `python setup.py install` or eventually upload package to pypi
- Code can be imported using package namespacing like `from forestcost import routing` , etc.

* Numerous changes to routing including
- function signature uses keyword arguments for cleaner code; you specify either the mill_shp OR the mill_coords keyword depending on which method you want.
- generalized the filter mechanism so that you can filter on any attribute field (e.g. look only for mills in Curry county, OR)
- removed the routing_main function which was confusing the API
- pass in shapefile path instead of ogr layer object for thread safety
- use an exponentially expanding bbox for quicker searching
- ability to set thresholds, i.e. keep expanding the bbox until you get at least 3 mills
- smarter caching; saves cache files in a temporary directory so it doesn't clutter the root directory

and a few other minor tweaks to the test_forestplanner script.