-
Notifications
You must be signed in to change notification settings - Fork 2
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
largestRect not correct #108
Comments
@dsmilkov any ideas why this may be? |
@bhaktatejas922 the I can't see the steps in your code that you used to take the output and draw the final polygon, but I would recommend moving your Another thing you may want to test here, is that lat/long positions typically map to y/x positions, not x/y, so that underlying function might need to change it's map function to |
Ah yeah should've mentioned that those original coordinates are already in long, lat form. I'm just taking the outputted points and pasting them into geojson.io directly for display. I should probably explore making it less prone to rounding errors it sounds like. Do you think multiplying it by 1000 or 1000000 would help? Tried that already |
so those issues with the ultra small rectangles I resolved (repeat points). However I still get max rectangles that are not actually fitting at times. Weirdly, they seem to happen mostly at the 90 degree and 0 degree angle. Tried to specify angles such that 90, -90 and 0 arent included but it still tries -0, -90 as an angle for some reason |
Expected Behavior
I should be getting a max rectangle but I get some really weird results. Why is this happening? Using lat/long for my points as shown
Current Behavior
https://stackoverflow.com/questions/74083520/non-max-rectangle-when-using-d3plus-largestrect
Steps to Reproduce (for bugs)
When I use d3plus.largestRect it often doesnt return the largest inscribed rectangle. Any ideas whats going on, or what I should do to try to debug?
Someone took it from d3plus and made it its own repo here if its helpful.
https://github.com/rossjs/largest-rect-in-poly-geojson
Example where rectangle is wrong. This happens regardless of which options I pass to it
Some examples:
The text was updated successfully, but these errors were encountered: