اوپن سٹریٹ میپ لوگو OpenStreetMap

Newcastle nearing completion; Merkaator hacking

19 August 2009 کوں English وچ c-j-b دی طرفوں پوسٹ کیتا ڳیا.

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
ای میل آئیکان بلو سکائی دا آئیکن فیس بُک دا آئیکن لنکڈ اِن دا آئیکن میسٹوڈون دا آئیکن ٹیلی گرام دا آئیکن ایکس دا آئیکن

بحث مباحثہ

کمنٹ کرݨ کیتے لاگ ان تھیوو