Fixes a translation bug
This commit is contained in:
		
							parent
							
								
									1f7ddc865f
								
							
						
					
					
						commit
						4f78634994
					
				| @ -328,7 +328,9 @@ public: | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void FindNearestPointOnEdge(const _Coordinate& inputCoordinate, _Coordinate& outputCoordinate) { |     void FindNearestPointOnEdge(const _Coordinate& inputCoordinate, _Coordinate& outputCoordinate) { | ||||||
|         unsigned fileIndex = GetFileIndexForLatLon(100000*(lat2y(static_cast<double>(inputCoordinate.lat)/100000.)), inputCoordinate.lon); |         _Coordinate startCoord(100000*(lat2y(static_cast<double>(inputCoordinate.lat)/100000.)), inputCoordinate.lon); | ||||||
|  |         unsigned fileIndex = GetFileIndexForLatLon(startCoord.lat, startCoord.lon); | ||||||
|  | 
 | ||||||
|         std::vector<_Edge> candidates; |         std::vector<_Edge> candidates; | ||||||
|         for(int j = -32768; j < (32768+1); j+=32768) { |         for(int j = -32768; j < (32768+1); j+=32768) { | ||||||
|             for(int i = -1; i < 2; i++) { |             for(int i = -1; i < 2; i++) { | ||||||
| @ -339,7 +341,7 @@ public: | |||||||
|         double dist = numeric_limits<double>::max(); |         double dist = numeric_limits<double>::max(); | ||||||
|         for(std::vector<_Edge>::iterator it = candidates.begin(); it != candidates.end(); it++) { |         for(std::vector<_Edge>::iterator it = candidates.begin(); it != candidates.end(); it++) { | ||||||
|             double r = 0.; |             double r = 0.; | ||||||
|              double tmpDist = ComputeDistance(inputCoordinate, it->startCoord, it->targetCoord, tmp, &r); |             double tmpDist = ComputeDistance(startCoord, it->startCoord, it->targetCoord, tmp, &r); | ||||||
|             if(tmpDist < dist) { |             if(tmpDist < dist) { | ||||||
|                 dist = tmpDist; |                 dist = tmpDist; | ||||||
|                 outputCoordinate.lat = round(100000*(y2lat(static_cast<double>(tmp.lat)/100000.))); |                 outputCoordinate.lat = round(100000*(y2lat(static_cast<double>(tmp.lat)/100000.))); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user