Replies: 1 comment 4 replies
-
Hey 👋 Sorry for the late reply, here is a simple example for adding a Polygon to the Ship model (has a polygon field called use Clickbar\Magellan\Data\Geometries\LineString;
use Clickbar\Magellan\Data\Geometries\Point;
use Clickbar\Magellan\Data\Geometries\Polygon;
// ....
$ship->poly = Polygon::make([
LineString::make([
Point::makeGeodetic(1, 1),
Point::makeGeodetic(2, 2),
Point::makeGeodetic(3, 3),
Point::makeGeodetic(1, 1),
]),
]);
$ship->save(); Hope this helps! |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Great library!
One question; could you add a example how to add a polygon to the db? (lineStrings format?)
Beta Was this translation helpful? Give feedback.
All reactions