New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActionView::Template::Error (undefined method `redacted?' for nil:NilClass) in app/views/browse/_relation_member.html.erb #1988
Comments
The extracts provided by Geofabrik are not "referentially complete" - that is, they contain relations with references to members which are not included in the extract. For example, the relation that you mention (2220322) has way 398377196 as a member, but that way is not included in the extract. The api and website code is not designed to cope with the database being in an inconsistent state - that's why you get the server error. The way to fix this is to pre-prepare the extract to avoid having any referential integrity problems. I'm not sure off the top of my head if there's a script available for this - suggestions welcome! |
@gravitystorm do I understand correctly that OSM is not supposed to work only on certain countries, but the whole planet? |
No that's not what he said. What he said is that it assumes the data is referentially correct - there are a number of ways you could load a single country and have if meet that definition:
You have used an extract which doesn't do either of those things (because they're hard to do) and hence you have a problem. In general the API database does not really make any special attempt to support imports at all - it assumes that you will start an empty database and that it will be in control of ensuring that referential integrity is maintained. There are, to my knowledge, no tools for easily importing a referentially correct extract. |
One way to make a given extract referentially complete is:
or you could simply add the The other method is creating a referentially complete extract to begin with. by starting from a planet file and cutting out the area of interest using either Osmosis with |
@woodpeck works like a charm. Thanks! |
@gabyshev I am currently working on this docker container. Could I refer to your configure.sh. Thanks! |
So I'm trying to run OSM in docker with latest master.
I downloaded and imported database for Monaco because it's small (http://download.geofabrik.de/europe/monaco-latest.osm.pbf)
I'm running it on top of
phusion/passenger
.Dockerfile looks like:
configure.sh
configuresdatabase.yml
andapplication.yml
andmigration.sh
create functions, extensions and migrate data using osmosis:I see an error when trying to open relation
/relation/2220322
:The error happening in
app/views/browse/_relation_member.html.erb
because helper methodapp/helpers/browse_helper.rb
trying to callredacted?
:_relation_member.html.erb
rendered by_relation.html.erb
:But in the console I found that not every
relation_member
has amember
:Which looks like a bug to me. I would be happy to send PR to fix it but I have no idea what is the logic should be.
Shall we just skip
relation_members
withoutmember
s ?The text was updated successfully, but these errors were encountered: