Menu

#43 Oneway

V 0.2.4
closed-fixed
OSM2POWM (15)
5
2010-03-24
2010-03-21
iiizio
No

Maybe is not the right place to talk about this, but I don't know where...

I tried to add oneway visualization with this code added in CXMapPainter2D.cpp after line 325:
// chech if oneway
if(pWay->GetOneway() != e_Oneway_None) {
size_t NodeCount = pWay->GetNodeList()->GetNodeCount();
// get first node
CXNode *pNode = pWay->GetNodeList()->GetNode(0);
int x0 = pNode->GetDisplayX();
int y0 = pNode->GetDisplayY();
// now iterate through segments
for(size_t j=1; j<NodeCount; j++) {
pNode = pWay->GetNodeList()->GetNode(j);
int x1 = pNode->GetDisplayX();
int y1 = pNode->GetDisplayY();
// check if long enough
if(sqrt((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1)) > 20) {
int x = (x0+x1)/2;
int y = (y0+y1)/2;
// check if we have to draw
if((x >= 0) && (x <= Width) && (y >= 0) && (y <= Height)) {
// just for test, todo directional arrow
pBMP->DrawCircle(x, y, 3, CXRGB(0x00, 0x00, 0x00), CXRGB(0x00, 0x00, 0xFF));
}
}
x0 = x1;
y0 = y1;
}
}

but the test if(pWay->GetOneway() != e_Oneway_None) always fail.
If I force it to true all the other code work fine.

What's wrong? Is it not the right way to check the Oneway flag? Is the flag already in the map files?

iiizio

PS: I found a possible bug in OSM2POWM file CXOSMMap.cpp line 136 (wrong word ONEVAY):
if(!pOSMWay->HasKey("ONEVAY")) {

Discussion

  • Julian Bugariu

    Julian Bugariu - 2010-03-22

    1. Oneway information is stored only for zoom level 0, where it works fine. Oneway is needed at the time only by the locator thread.
    2. The bug in OSM2POWM is confirmed and will be fixed in the next version.

    Moved to tracker bugs.

    Thanx,
    Julian

     
  • Julian Bugariu

    Julian Bugariu - 2010-03-22
    • labels: 1032206 --> 1033859
     
  • Julian Bugariu

    Julian Bugariu - 2010-03-22
    • milestone: --> V 0.2.4
     
  • Julian Bugariu

    Julian Bugariu - 2010-03-22
    • labels: 1033859 --> OSM2POWM
     
  • Julian Bugariu

    Julian Bugariu - 2010-03-22

    Fixed in svn revision 413.

     
  • Julian Bugariu

    Julian Bugariu - 2010-03-22
    • status: open --> closed-fixed
     
  • iiizio

    iiizio - 2010-03-23

    "1. Oneway information is stored only for zoom level 0, where it works fine."

    Ok for zoom level 0, but it seems work only with motorway:
    http://img213.imageshack.us/img213/7894/onewayonlyonmotorway.jpg

    iiizio

     
  • iiizio

    iiizio - 2010-03-23
    • status: closed-fixed --> open-fixed
     
  • Julian Bugariu

    Julian Bugariu - 2010-03-24

    Discussion should be continued by mail (sent you a PM with my address).
    Closed comment posting for bug.

     
  • Julian Bugariu

    Julian Bugariu - 2010-03-24
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.