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")) {
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
Fixed in svn revision 413.
"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
Discussion should be continued by mail (sent you a PM with my address).
Closed comment posting for bug.