Конвертер OSM -> MP

может быть и проще, осталось понять, как это сделать? через --tt у меня не получилось оставить только роутинг и не поломать его…

оставить только *-roads

Надо не через --tt а через --tf. Оставить только нужные линии highway + отношения type=restriction и все точки, на которые они ссылаются.

Типа такого: --tf accept-ways highway=* --tf accept-relations type=restriction --used-node --used-way

Типы highway можно перечислять через запятую: --tf accept-ways highway=motorway,motorway_link,trunk,trunk_link

я имел в виду tf, конечно. пробовал, не получилось.

Непонятная ошибка при операции “Processing ways”. Выскакивает куча подобных и меняется только номер линии (как видно).

Use of uninitialized value $chain[0] in hash element at C;.…\osm2mp.pl line 1040, <$[…]> line 2192553.
Use of uninitialized value in concatenation (.) or string at C:.…\osm2mp.pl line 1040, <$
[…]> line 2192553.
Use of uninitialized value $chain[0] in hash element at C;.…\osm2mp.pl line 1040, <$[…]> line 2203568.
Use of uninitialized value in concatenation (.) or string at C:.…\osm2mp.pl line 1040, <$
[…]> line 2203568.

Потихоньку начал глобальный рефакторинг конвертера, а то там полный ужос-ужос.
Уже сделано:

  • единый скрипт развален на модули (уже давно перерос тот формат)
  • исходный .osm теперь читается стандартным xml-парсером в один проход - должно стать быстрее, и можно подавать вход на stdin
  • поменялся формат мастер-конфига, теперь это обычный ini, и в него вынесены дефолтные опции; остальное осталось в yaml
  • сильно поменялись внутренности обработки фич-конфигов (должно стать побыстрее и построже), но внешне они остались почти такими же
  • остальное (в том числе генерация роутинга) по возможности оставлено нетронутым, хотя там ещё разгребать и разгребать…
  • и это только начало :slight_smile:

Новые фичи пока все в статусе беты, использовать с осторожностью.

getbound.pl RU-MOS > RU-MOS.poly
Downloading RelID=51490…Failed

таймаут 900 поставил, не помогло. Хотя ID верный. :expressionless:
И ещё в aliases.yml неверно указаны ID Мурманской и Тверской областей, должно быть 2099216 и 2095259 соответственно.

Это апи падает, внешним таймаутом тут не поможешь.
http://www.openstreetmap.org/api/0.6/relation/51490/full
Если не вылечится, придётся что-то придумывать.

спасибо, поменял

Уже пора придумывать, ибо есть релейшены, которые не качаются хронически. У Gryphon есть некий питоновский скрипт, который качает как-то подругому и потом скармливает результат твоему скрипту. Может их как-то объединить в единый инструмент?

Придумать-то несложно, но по-хорошему надо лечить апи, а не навешивать ещё одно кольцо костылей.
/full - вполне официальный метод, ограничения у него не описаны - значит, должен работать.

liosha
С причинами разобрались, а как быть то?

Я ж говорю, по-хорошему надо пинать админов со словами “чё за фигня, почему апи падает?!”

Пнул, вот ответ:

Да кто б сомневался, что это таймаут…
То есть, я так понимаю, чинить это они не собираются.

Ну может надо как то по особому пинать, я в английском не силён. Писал на webmaster@openstreetmap.org

Добавил возможность скачать большие релейшены по частям.
getbound теперь вынесен в самостоятельный проект: http://code.google.com/p/osm-getbound/

This project currently has no downloads.

Kostik, http://code.google.com/p/osm-getbound/source/browse/#svn%2Ftrunk

liosha
У меня почему то не работает и выдаёт кучу ошибок:


C:\OSM\getbound>getbound.pl RU-MOS  1>RU-MOS.poly
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 8, ne
ar ""Content-Type" content"
        (Missing operator before content?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 40, n
ear "" rel="stylesheet"
        (Missing operator before stylesheet?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 40, nea
r "stylesheet" href=""
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 40, n
ear "" href="http"
        (Missing operator before http?)
Having no space between pattern and following word is deprecated at C:\OSM\getbo
und\getbound.pl line 40.
String found where operator expected at C:\OSM\getbound\getbound.pl line 42, nea
r "<link type=""
  (Might be a runaway multi-line "" string starting on line 40)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 42, n
ear "<link type="text"
        (Missing operator before text?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 42, nea
r "css" rel=""
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 42, n
ear "" rel="stylesheet"
        (Missing operator before stylesheet?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 42, nea
r "stylesheet" href=""
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 42, n
ear "" href="http"
        (Missing operator before http?)
Having no space between pattern and following word is deprecated at C:\OSM\getbo
und\getbound.pl line 42.
String found where operator expected at C:\OSM\getbound\getbound.pl line 45, nea
r "<link type=""
  (Might be a runaway multi-line "" string starting on line 42)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 45, n
ear "<link type="text"
        (Missing operator before text?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 45, nea
r "css" rel=""
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 45, n
ear "" rel="stylesheet"
        (Missing operator before stylesheet?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 45, nea
r "stylesheet" href=""
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 45, n
ear "" href="http"
        (Missing operator before http?)
Having no space between pattern and following word is deprecated at C:\OSM\getbo
und\getbound.pl line 45.
String found where operator expected at C:\OSM\getbound\getbound.pl line 50, nea
r "<link type=""
  (Might be a runaway multi-line "" string starting on line 45)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 50, n
ear "<link type="text"
        (Missing operator before text?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 50, nea
r "css" rel=""
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 50, n
ear "" rel="stylesheet"
        (Missing operator before stylesheet?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 50, nea
r "stylesheet" href=""
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 50, n
ear "" href="http"
        (Missing operator before http?)
Having no space between pattern and following word is deprecated at C:\OSM\getbo
und\getbound.pl line 50.
String found where operator expected at C:\OSM\getbound\getbound.pl line 52, nea
r "<style type=""
  (Might be a runaway multi-line "" string starting on line 50)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 52, n
ear "<style type="text"
        (Missing operator before text?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 120, ne
ar "<body class=""
  (Might be a runaway multi-line "" string starting on line 52)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 120,
near "<body class="t4"
        (Missing operator before t4?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 121, ne
ar "<script type=""
  (Might be a runaway multi-line "" string starting on line 120)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 121,
near "<script type="text"
        (Missing operator before text?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 128, ne
ar "<script type=""
  (Might be a runaway multi-line "" string starting on line 121)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 128,
near "<script type="text"
        (Missing operator before text?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 131, ne
ar "{var po = document.createElement(""
  (Might be a runaway multi-line "" string starting on line 128)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 131,
near "{var po = document.createElement("script"
        (Missing operator before script?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 132, ne
ar "po.type = ""
  (Might be a runaway multi-line "" string starting on line 131)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 132,
near "po.type = "text"
String found where operator expected at C:\OSM\getbound\getbound.pl line 132, ne
ar "javascript"; po.async = true;po.src = ""
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 132,
near ""; po.async = true;po.src = "https"
        (Missing operator before https?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 133, ne
ar "var s = document.getElementsByTagName(""
  (Might be a runaway multi-line "" string starting on line 132)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 133,
near "var s = document.getElementsByTagName("script"
        (Do you need to predeclare var?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 137, ne
ar "<div class=""
  (Might be a runaway multi-line "" string starting on line 133)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 137,
near "<div class="headbg"
        (Missing operator before headbg?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 139, ne
ar "<div id=""
  (Might be a runaway multi-line "" string starting on line 137)
        (Missing semicolon on previous line?)
Bareword found where operator expected at C:\OSM\getbound\getbound.pl line 139,
near "<div id="gaia"
        (Missing operator before gaia?)
String found where operator expected at C:\OSM\getbound\getbound.pl line 144, ne
ar "<a href=""
  (Might be a runaway multi-line "" string starting on line 139)
        (Missing semicolon on previous line?)
syntax error at C:\OSM\getbound\getbound.pl line 6, near "html>"
syntax error at C:\OSM\getbound\getbound.pl line 24, near ""profileUrl":"
syntax error at C:\OSM\getbound\getbound.pl line 34, near "title>"
Excessively long <> operator at C:\OSM\getbound\getbound.pl line 145.

Что-то ты явно не то запускаешь. Больше похожее на html :slight_smile: