-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add support for convex hulls #83
Conversation
Hi @Riley19280, thanks for the PR! |
A convex hull is a shape that encompasses all points given Im my use case, a polygon that contains all the points is what I need |
Thanks for the explanation. Isn't it better to implement this algorithm in PHP and save the IO operation to the DB? |
Could be, I am not sure though. I don't want to write it myself when I can have the database do it though. I'm sure whoever implemented it on a database did it as efficiently as they could |
I'm sorry. I appreciate your time, but I prefer not to mess up this package with a new builder class. I assume this use case isn't very common. I suggest you use this code in your project, on top of this package. Let me know if there's anything else I can help with. |
I feel that having a go-to package for all spatial database queries is important. There are plenty of other spatial database functions available that could be added to the builder class, further extending the capabilities provided by this package. I do agree that this specific function may not be commonly used, but that should not prevent similar operations from being added to this package in the future. The new builder class would be the foundation for these things. (May be better named I also don't mind adding a few more operations to it if you feel this PR would be more valuable this way. There is a list here |
Ok, I see what you mean. Can you make the class not inherit from |
I think returning a geometry class directly makes the most sense. Wanted to do that originally but it was too closely tied to queries. I like the direction it's headed now. Let me know what you think |
It looks great, I made some refactoring, can you check it? 4237bf0 |
Looks good to me! |
@Riley19280 Can you fix the PR to include my refactoring? |
Add support for using the ST_ConvexHull funciton.
I broke this out of the
SpatialBuilder
class because it does not operate on a model, only on geometry. For example, this queryresults from
SpatialQuery::make()->convexHull($geometry)