-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when the center of a geohash's bounding box is 0,0 dataLaer fails -- 0,0 is a valid lat/lng #115
Comments
Actually, this will fail anytime the center of a geohash falls on the Equator or the Prime Meridian. |
@tlhampton13 good catch. Should be fixed soon. |
Giving this some more thought, I don't believe this scenario will ever happen, or is it actually happening for you? The geohash of 0, 0 is s0, s00, s000, s0000, and so on. If you calculate the center of any of those geohashes, it's never 0, 0. In order for it to actually be 0, 0, you'd have to have a super long geohash string. In general, that code could probably use some refactoring/cleanup, but I don't believe it will fail with geohashes of realistic length. @tlhampton13 What do you think? |
You are correct. No geohashes actually span the Equator or Prime Meridian. These lines would fall along a bounding edge of the adjacent geohashes. I am getting a failure in the GEOHASH function though because the bounds is undefined. But the reason is not as I originally described. In some of my records the geohash fields is empty string.
When this happens the GeoHash.decodeGeoHash() method actually returns location information for the empty string. Notice that the third element in the arrays (center point) is missing.
then the if condition fails because the center point is not present.
I can change the data so that the geohashField is not present if it is "", but then records without a field fail. So I add a filter to the dataLayer, but that fails because the _loadRecords method lookups the geocode before checking includeLayer value. |
@tlhampton13 apologies for the delayed response. Did you make any progress with this? For now, my suggestion would be to either remove records that have a blank |
In leaflet.dvf.datalayer.js GEOHASH function.
The following condition fails if the center of the bounding box evaluates to 0,0 witch is a valid lat/lng location. Specifically, this is the location that the Equator and the Prime Meridian intersect.
a little farther down, since the bounds is undefined this line fails
This will cause an entire dataLayer to fail if a single center point is 0,0.
The text was updated successfully, but these errors were encountered: