错误:安装OSM-nominatim API时,函数make_standard_name(未知)不存在

时间:2012-05-21 06:35:38

标签: postgresql centos openstreetmap nominatim

我使用http://wiki.openstreetmap.org/wiki/Nominatim/Installation ...

的指导在我自己的服务器上安装nominatim

但是在向我的pgsql DB添加国家/地区短语/代码时遇到问题。 我正在使用以上链接中给出的以下命令执行此操作:

psql -d nominatim -f specialphrases_countries.sql

但是,我收到了以下错误:

psql:specialphrases_countries.sql:1: ERROR:  function make_standard_name(unknown) does not exist
LINE 1: select getorcreate_country(make_standard_name('uk'), 'gb');
                                   ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:specialphrases_countries.sql:2: ERROR:  function make_standard_name(unknown) does not exist
LINE 1: select getorcreate_country(make_standard_name('united states...
                                   ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:specialphrases_countries.sql:3: ERROR:  relation "country_name" does not exist
LINE 1: ...e_standard_name(country_code), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:4: ERROR:  relation "country_name" does not exist
LINE 1: ...try_name.name,ARRAY['name'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:5: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:af'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:6: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:ar'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:7: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:br'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:8: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:ca'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:9: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:cs'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:10: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:de'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:11: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:en'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:12: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:es'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:13: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:et'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:14: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:eu'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:15: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:fa'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:16: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:fi'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:17: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:fr'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:18: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:gl'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:19: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:hr'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:20: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:hu'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:21: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:ia'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:22: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:is'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:23: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:it'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:24: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:ja'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:25: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:mk'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:26: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:nl'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:27: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:no'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:28: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:pl'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:29: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:ps'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:30: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:pt'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:31: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:ru'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:32: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:sk'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:33: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:sv'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:34: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:uk'])), country_code) from country_na...
                                                             ^
psql:specialphrases_countries.sql:35: ERROR:  relation "country_name" does not exist
LINE 1: ..._name.name,ARRAY['name:vi'])), country_code) from country_na...
                                                             ^

我不知道什么是“make_standard_name(未知)”,如何创建它来解决“错误:函数make_standard_name(未知)不存在”...

请建议。

2 个答案:

答案 0 :(得分:2)

安装过程中的后续步骤将函数make_standard_name(text)添加到数据库中:http://wiki.openstreetmap.org/wiki/Nominatim/Installation#Import_and_index_OSM_data

如果缺少此功能,则错过该步骤或在该步骤中发生错误。在导入额外的国家/地区名称数据之前,您需要成功运行它。

您可以尝试./util/setup.php --create-functions来生成函数(而不是./util/setup.php --all),但是如果错误,您的数据库几乎肯定无效,如果继续,您将遇到其他问题。

答案 1 :(得分:1)

我说这实际上不是你得到的第一个错误。尝试重新运行创建并将输出发送到文件。寻找第一个错误。一种方法是告诉psql在发生错误后中止,在unix / linux上是:

ON_ERROR_STOP=1 psql -d nominatim -f specialphrases_countries.sql

在Windows上我认为是:

set ON_ERROR_STOP=1
psql -d nominatim -f specialphrases_countries.sql

由于您已经部分加载了数据,但这可能效果不佳,因为它可能会尝试创建已存在的数据。您可能需要运行程序包提供的任何清除/删除脚本,或者(如果可能)在新的干净数据库上运行它。

要进行测试,请尝试创建一个新的空白数据库并尝试使用以下内容加载数据:

ON_ERROR_STOP=1 psql -d mytestdb -1 -f specialphrases_countries.sql

注意那里的-1,告诉psql在单个事务中运行作业。这通常是一个好主意,因为它确保创建/加载脚本总是成功或失败。