Topic: Detection of water by texture accuracy
I've been playing around with the DetectWaterByTextureExample script all morning, and it seems like an excellent idea, but I'm not sure I'm using it properly, because I keep getting pretty inaccurate results: according to the example, 2/3 of Ghana is water
My first thought is that I may have set something up incorrectly, but I've set it up exactly as the example directions indicate, but still no luck. The one big change I did was to make my map 2048 x 2048 (it was 1024x1024). I also played around with setting my Sprite size, using values of 256x256 and 512x512.
Looking at the code, we see the following:
private bool HasWater(float lat, float lng)
{
// Convert geo coordinates to tile coordinates
Vector2 tilef = OnlineMapsUtils.LatLongToTilef(lng, lat, 3);
const int countTileRowCol = 8;
That hard coded "3" is the zoom level according to the documentation...but what effect does that have on accuracy? I've tried a bunch of different levels, but it still seems to be very random if water is detected or not, even completely inland, in a desert region.
I've attached a screen shot in Editor of a map centered deep within Ghana that has no water in the images at all, and is well inland of the oceans, but is detecting water all over the place. This particular screenshot was set with the "zoom level" above set to 10, but I get similar results with any zoom level.
As an aside, the red box in the screenshot is a visual representation of the hasWater test, but even the pure example implementation reports "Has Water" in the debug line.
Any thoughts on why this might be happening?