An issue I had with osm2pgsql was missing nodes when looking at road ways. It revolved around non ID-ordered data that I was trying to use. This was also an issue in previous posts, I had neglected to use the –slim arguement while importing the data set. To see this in action, I imported Brooklyn, NY data and exported road nodes with –slim and without as shown below:
For both with/out slim arguement the following SQL command was used to output data:
As you can tell, quite a lot of data was missing without using slim.