OpenStreetMap 로고 OpenStreetMap

Newcastle nearing completion; Merkaator hacking

c-j-b님이 English로 2009년 8월 19일에 게시함.

Go have a look-- the Newcastle is almost close to complete, with really only the Wickham and Carrington areas left to streetmap. It's obvious however that most of the areas that Bio, 'Mysterious German Carthography Student' and myself weren't responsible for will need a go-over survey to collect amenities, laneways, and such..

Merkaator users might be happy to hear that I solved the "Align Nodes" bug.. At the heart of it there was an 32-bit integer overflow issue. The Trac system seems to be down, and I've tried posting the findings and patches to the Merkaator mailing list, but in summary:

src/Maps/Coord.cpp:angle()
Problem code:
return sqrt((double)Lat*Lat+Lon*Lon));

Noob fix:
return sqrt((double)((long)Lat*(long)Lat+(long)Lon*(long)Lon));

I refactored and clarified some other code while I was working on it:

src/Maps/Coord.cpp:
double angle(Coord p1)
{
if (p1.length() == 0)
return 0;
double adjacent = (double)p1.lon() / p1.length();
if (p1.lat() > 0)
return acos(adjacent);
return -acos(adjacent);
}

src/Maps/FeatureManipulations.cpp:alignNodes():
void alignNodes(MapDocument* theDocument, CommandList* theList, PropertiesDock
* theDock)
{
[..]
double slope = angle(p2);
for (int i=2; iposition()-p1;
rotate(pos,-slope);
pos.setLat(0);
rotate(pos,slope);
pos=pos+p1;
theList->add(new MoveTrackPointCommand( Nodes[i], pos, theDocume
nt->getDirtyOrOriginLayer(Nodes[i]->layer()) ));
}
}

With now-working road alignment happening, the map of Newcastle is looking a lot prettier now. :-)

위치: New Lambton, Newcastle, Newcastle-Maitland, City of Newcastle, New South Wales, 2305, Australia
이메일 아이콘 Bluesky 아이콘 Facebook 아이콘 LinkedIn 아이콘 마스토돈 아이콘 텔레그램 아이콘 X 아이콘

토론

댓글을 남기려면 로그인하세요