-
Notifications
You must be signed in to change notification settings - Fork 88
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
Take into account the 180/-180 in FilterBox() #104
Comments
I think this is right :) return x.Latitude.Value <= left && x.Longitude <= top &&
x.Latitude.Value >= right && x.Longitude >= bottom; And I think your backwards, you mean increases |
Since our interactions have been limited, I'm having trouble judging if you're serious or not. I stair endlessly at that smiley face you added, hoping for it to reveal a secret, but its lips are sealed. |
Your picture was a upside down and thus your statement was incorrect as I assume it was based on that picture, when "Since longitudes increase when going left" I think you mean "Since longitudes decrease when going left". My smiley face was because my code contains a typo in its current form and should be the other way around for left and top but it's hard to tell since you say increase as you go left so you might find it correct as it is... |
Thank you for clarifying, I found my mistake. The reference image had the horizontal access labeled with 'W' and increased leftward. I didn't notice that 'W' is the negative of 'E'. I have revised my assumptions and I now agree that Longitudes increase to the right and the code is correct in the repo. And with my embarrassment in mind, would it be worth the effort to add an overload which accepts public static OsmStreamSource FilterBox(this IEnumerable<OsmGeo> source, Bounds bounds, bool completeWays = false)
{
....
} |
Maybe... E.g. if Bounds used a If nothing else I think I can buy an overload of public static OsmStreamSource FilterBox(this IEnumerable<OsmGeo> source, Bounds bounds, bool completeWays = false)
{
return FilterBox(source, bounds.MinLat, bounds.MinLong, bounds.MaxLat, bounds.MaxLng, completeWays)
} |
I don't like the bounds class, it defines MinLongitude but that doesn't mean anything because you could define a bbox where the left longitude > right longitude wrapping around 180. That part still needs implementing though. |
Regarding:
core/src/OsmSharp/Streams/OsmStreamExtensions.cs
Lines 218 to 226 in 17223c2
Since longitudes increase when going "left" (A picture for reference), I think the comparison operators here are backward. Would you consider a pull request which:
Bounds
parameterThe text was updated successfully, but these errors were encountered: