Tuesday, February 1, 2011

Backstepping leads to confident crawling


I finally made some pivotal improvements to my road path drawing algorithm. All is not yet right, but the code is certainly prettier!  I'm posting a generated mess of paths with the hopes that I'll soon draw the same place clearly. Some significant problems that remain:

  • I'm drawing the center line of all the paths and roads. It might be useful to know where the center is, but it's not worth the confusion. I want to give users blank roads and paths so they can make the maximal use of them, even if that means a non-symmetric use.
  • Some sidewalk and crosswalk data often exists and I treat them as paths, which makes a mess when I'm guessing how wide the roads are. Notice the arced sidewalks on the bridge and my road that is wider than them. I need to probably ignore all sidewalks that aren't dedicated paths. The path that goes under the railroad tracks in the bottom left corner is actually separated from the road by barriers, but I should probably ignore it anyway with the exception that the user will find a better way of allocating the entire right-of-way.
  • Rendering errors still exist for some shapes. Notice the three Os in front of the building that represent the lanes of a parking lot. The one on the right has an erroneous loop, as do other roads shown here. I have to tack these one at a time and hope that one fix cures many problems without creating new ones.
  • How should foot paths meet streets. Notice that the foot path in the bottom right meet the parking lot lands at their center lines. This is because I haven't told the paths to have any intersection relationship with the roads. I need to introduce the concept of a "neighborly intersection", so that different types of right of way can respect each others side boundaries. Paths and roads need to respect each other, while railroad tracks probably will never share an end node with a road or path, since they are fully incompatible modes of travel. Even a streetcar that went off street and back on could ignore the sides of the streets and render as if the sides of the street didn't exist.

I feel a lot better about my progress since I stepped back and made some fundamental fixes and simplifications to my code. It's still slow go, but my movement is forward again, after some necessary back stepping.

No comments: