|
|
@@ -67,9 +67,17 @@ class bialePlamy {
|
|
|
private $joins_asText = array(), $ways_asText = array(), $xpoints_asText = array(), $points_asText = array(), $przylacza_asText = array();
|
|
|
private $ways2drogi = array(), $ways2joins = array(), $joins2ways = array(), $points2xpoints = array(), $xpoints2points = array(), $przylacza2joins = array(), $przylacza2points = array();
|
|
|
|
|
|
- public function __construct($punktyAdresoweTable, $drogiTable) {
|
|
|
- $this->punktyAdresoweTable = $punktyAdresoweTable;
|
|
|
- $this->drogiTable = $drogiTable;
|
|
|
+ public function __construct($sourceTables) {
|
|
|
+ $tables = array('pointsTable' => 'punktyAdresoweTable', 'origWaysTable' => 'drogiTable');
|
|
|
+ try {
|
|
|
+ if (!is_array($sourceTables)) throw new Exception("bialePlamy :: Wrong parameters");
|
|
|
+ foreach ($tables as $arg => $table) {
|
|
|
+ if (!isset($sourceTables[$arg])) throw new Exception("bialePlamy :: Missing parameter {$arg}");
|
|
|
+ $this->$table = $sourceTables[$arg];
|
|
|
+ }
|
|
|
+ } catch (Exception $e) {
|
|
|
+ throw $e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function enableShowProgress() {
|
|
|
@@ -445,15 +453,15 @@ class bialePlamy {
|
|
|
|
|
|
}
|
|
|
|
|
|
-$test = new bialePlamy("Rozdzielcza_test2_bzyk_punkty_adresowe", "Rozdzielcza_test2_bzyk_drogi");
|
|
|
-$test->enableShowProgress();
|
|
|
+//$test = new bialePlamy(array("pointsTable"=>"Rozdzielcza_test2_bzyk_punkty_adresowe", "origWaysTable"=>"Rozdzielcza_test2_bzyk_drogi"));
|
|
|
+//$test->enableShowProgress();
|
|
|
//$test->loadCache();
|
|
|
-$test->generateWays();
|
|
|
-$test->generateXpoints();
|
|
|
-$test->generatePrzylacza();
|
|
|
-$test->saveCache();
|
|
|
-$test->saveXML();
|
|
|
-$test->saveWaysTable("Rozdzielcza_test2_bzyk_ways");
|
|
|
-$test->saveJoinsTable("Rozdzielcza_test2_bzyk_joins");
|
|
|
-$test->savePrzylaczaTable("Rozdzielcza_test2_bzyk_przylacza");
|
|
|
+//$test->generateWays();
|
|
|
+//$test->generateXpoints();
|
|
|
+//$test->generatePrzylacza();
|
|
|
+//$test->saveCache();
|
|
|
+//$test->saveXML();
|
|
|
+//$test->saveWaysTable("Rozdzielcza_test2_bzyk_ways");
|
|
|
+//$test->saveJoinsTable("Rozdzielcza_test2_bzyk_joins");
|
|
|
+//$test->savePrzylaczaTable("Rozdzielcza_test2_bzyk_przylacza");
|
|
|
|