Page 1 of 1

Faulty Distribution map display for Corydoras schwartzi

Posted: 07 Nov 2015, 20:15
by bekateen
Hi Jools,

When I click on the link (a tiny icon of a map) to display the distribution map for , the screen opens up a larger area for the map, but no map displays in the area (all I see is a blank field; see photo 1). This doesn't occur for other species I tested, whether Corydoras or other genera; for those, the map worked normally (photo 2).

Once the open area appears for schwartzi, if I then click again on the same small map icon (now displayed below the bigger map area) in order to make the map not display, this works. But if I then try once more to make the map appear by clicking on the same map-area icon link one more time, I get an error message (see photo 3).

Cheers, Eric

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 16 Nov 2015, 20:20
by bekateen
Hmmm. I encountered the same problem with . Both this species and schwartzi have the Purus as their only locality. I wonder if that might be part of the problem - maybe it's not the species giving us issues, but it's the Purus as a single location.

By comparison, I clicked on some other cats which also have the Purus as a location, but they ALSO have other localities. And in their CLOGs, the map appeared normally, and the Purus marker also appeared.

The mystery deepens. :-)

Cheers, Eric

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 16 Nov 2015, 23:03
by bekateen
Okay, eventually I clicked on the maps for all 22 fish listed along the Purus and here is what I found:

Every species with more than one "Distribution" occurrence works (i.e., displays occurrence data as markers on the Google Map): Every fish with only one Distribution occurrence, but has a more specific locality than simply "Purus" (i.e., not just Purus, but something which has the Purus as its parent body of water) also works, even though it has only one Distribution occurrence listed: Every fish with ONLY one "Distribution" value (Purus) does NOT work:
  • - No text for either its Type Locality or for its "Distribution" field (I submitted the Brazil, Rio Madeira, Humaitá for a Distribution text field to see if this matters, but I don't expect it will help. EDIT: After this Distribution text submission was accepted, nope, it didn't make a difference - it still doesn't display the map)
  • - Has text in both Type Locality and Distribution fields
  • - Has text in both Type Locality and Distribution fields
  • - Has text in both Type Locality and Distribution fields
  • - Has text in Distribution field but not in Type Locality field
  • - Has text in Distribution field but not in Type Locality field
  • - Has text in Distribution field but not in Type Locality field
  • - Has text in both Type Locality and Distribution fields
  • - Has text in Distribution field but not in Type Locality field
EXCEPT these two species: Even though they have only one Distribution occurrence (Purus), they still work (display Distribution occurrence markers on their maps): What seems odd about these two is that although they have only one Distribution occurrence, TWO locality markers appear on their maps! In each case, one marker for Purus, and the other is a gold star (which I presume signifies its Type Locality: For pulcher it's Lábrea, and for robustus it's Humaitá.)

The only thing I see different about these two last species is that their Type Locality data includes Lat/Long coordinates. All the other non-working links either have NO Type Locality data, or they contain Type Locality data without Lat/Long coordinates. Does one of the PlanetCatfish website bots search for Lat/Long coordinates and post these as occurrences on the map, even though these are not listed as Distribution occurrences?

I apologize if the list seems long; I'm just trying to trouble-shoot the error and characterize its behavior for you. Hopefully that will aid in diagnosis.

Cheers, Eric

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 03 Dec 2015, 12:25
by MatsP
I will have a look.

Note that it's not what it says in the distribution as such that matters, but what it says in the "occurrence" records for that species.

The coordinates in the database for Rio Purus should show this:
https://www.google.co.uk/maps/place/5%C ... :0x0?hl=en
(I hope that link works!)

I'm not sure why that particular "single occurrence" goes wrong.

--
Mats

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 03 Dec 2015, 13:56
by bekateen
MatsP wrote:Note that it's not what it says in the distribution as such that matters, but what it says in the "occurrence" records for that species.
Understood. I kept using the term distribution because that's the heading on the CLOG page where occurrences are reported.
MatsP wrote:I'm not sure why that particular "single occurrence" goes wrong.
It's not just the Rio Purus. I just found this problem again when looking at the profiles for and . They're from the Negro. But again, same circumstance - only one occurrence, nothing more specific than Negro, and no Lat/Long data for type locality. I haven't had time to check all other entries for the Rio Negro, so I don't know how broad that problem is.

Cheers, Eric

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 03 Dec 2015, 20:12
by MatsP
Yeah, I figured out what the problem is. When trying to figure out the "scale" to fit everything in, the code would divide by zero (or something like that) when there is only ONE entry on the map - which was leading to "weird" results in the remaining math. It works out SOMETIMES, but not always, so I changed the code to only try to calculate the scale if there is more than one place on the map, and just use the closest zoom level when there is a single entry on the map.

I can see the error with a little of debug code, and see that it is fixed in the updated code, so I'm pretty sure this is the right fix, and I have a tested a few different species with one and multiple entries.

@Jools: r1605 (1604 contains the main fix, but I left my debug "alert" in the code).

--
Mats

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 04 Dec 2015, 03:08
by bekateen
bekateen wrote:It's not just the Rio Purus. I just found this problem again when looking at the profiles for and . They're from the Negro. But again, same circumstance - only one occurrence, nothing more specific than Negro, and no Lat/Long data for type locality. I haven't had time to check all other entries for the Rio Negro, so I don't know how broad that problem is.
I stand corrected. The occurrences do appear on the map for these species on my old Windows 7 phone, but the map doesn't appear on my new Windows 10 phone. So that may be my phone's fault, or Microsoft's fault.

Cheers, Eric

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 04 Dec 2015, 08:20
by MatsP
bekateen wrote:
bekateen wrote:It's not just the Rio Purus. I just found this problem again when looking at the profiles for and . They're from the Negro. But again, same circumstance - only one occurrence, nothing more specific than Negro, and no Lat/Long data for type locality. I haven't had time to check all other entries for the Rio Negro, so I don't know how broad that problem is.
I stand corrected. The occurrences do appear on the map for these species on my old Windows 7 phone, but the map doesn't appear on my new Windows 10 phone. So that may be my phone's fault, or Microsoft's fault.

Cheers, Eric
I doubt it. It's probably more a case of "how does that particular version of web-browser deal with the bad math that we do" (either dividing by zero or taking square root of a negative number, or something else like that - I didn't go through the entire math-sequence to see what actually went wrong, just logically saw that we get zero somewhere, and that's not what the math is expecting).

Jools hasn't said that he's uploaded the new version, so it's still b0rked.

--
Mats

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 04 Dec 2015, 09:51
by Jools
I've done the upload now, however it's my first major upload from a new laptop, so would confirm it looks OK?

Jools

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 04 Dec 2015, 11:21
by MatsP
It seems to work, once I reloaded the page properly (Ctrl-F5).

--
Mats

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 04 Dec 2015, 13:42
by bekateen
Yes, it works on my Windows 10 phone too. Thanks guys, another great bug fix.

Cheers, Eric

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 04 Dec 2015, 13:52
by bekateen
P.S., I still get a similar error message ("out of stack space") in Windows 10 (phone) if I exit and then reenter the map for Schwartzi as described in the OP, but at least now the map works right the first time, and works again if I reload/refresh the page and try again.

I also tested the schwartzi page on my PC running Win 7. Got similar errors (in different phrasing) when entering/leaving/reentering the map using IE 11 ("e:Error: Out of stack space"), Firefox ("e:InternalError: Too much recursion") and Chrome ("e:RangeError: Maximum call stack size exceeded").

The maps work the first time, and I don't know how many people try to enter, leave, and enter the map again without first leaving the entire page and returning to it (which resets the map and doesn't cause an error as far as I can tell). So... Close enough in my book, but I'll let you guys decide if you want to pursue it further.

Cheers, Eric

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 05 Dec 2015, 18:11
by MatsP
Completely missed the stack overflow error. I will try to look into that. I can reproduce on my machine. Probably won't do anything on that until at least Monday.

--
Mats

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 21 Dec 2015, 20:41
by Jools
MatsP wrote:Completely missed the stack overflow error. I will try to look into that. I can reproduce on my machine. Probably won't do anything on that until at least Monday.
*bump* :-)

Jools

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 12 Jan 2021, 18:50
by Jools
Is this now fixed Eric?

Jools

Re: Faulty Distribution map display for Corydoras schwartzi

Posted: 12 Jan 2021, 22:18
by bekateen
I haven't noticed this again. Thanks.