[OpenMap Users] TMSMapTileCoordinateTransform not calculating getTileBoundsForProjection correctly

From: Kevin Pfarr <kevin.pfarr_at_asolutions.com>
Date: Thu, 22 Mar 2012 08:19:52 -0500

Ran into an issue with the MapTileLayer using a data set generated from
GDAL. The TMSMapTileCoordinateTransform.getTileBoundsForProjection() is
returning the following values;

[28, 0, 2147483647, 4]

The third parameter is causing a loop to take a long time looking up tiles.

The parameters for getTileBoundsForProjection() are;

upperLeft = LatLonPoint.Double[lat=90.0,lon=-179.99999564141046]
lowerRight = LatLonPoint.Double[lat=-90.0,lon=179.64843314992333]
zoomLevel = 2

So I'm not sure where the problem is but here are a few ideas.

First; In the method latLonToTileUV() for lowerRight is returning
Point2D.Double[3.996093701665815, -Infinity]. So is -Infinity wrong?

Next; In getTileBoundsForProjection() where uvlr is processed, First
Math.floor(-Infinity) returns -Infinity, then it is casted to an int,
then subtract one resulting in Integer.MAX_VALUE. The causes the if
check not to set it to 0. So are there missing parentheses; -Infinity -
1 then cast it to an int as below?

int uvbottom = (int) (Math.floor(uvlr.getY()) - 1);

Kevin

-- 
Kevin Pfarr  Senior Software Engineer
Asynchrony Solutions, Inc.
1701 Washington Avenue
Saint Louis, Missouri 63103
www.asolutions.com
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Mar 22 2012 - 09:21:03 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT