Skip to content

Commit ffc5e78

Browse files
committed
update README.md
1 parent 1dc29f1 commit ffc5e78

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,48 @@ class Location extends Model
129129
];
130130

131131
protected $postgisFields = [
132-
'location',
133-
'polygon',
132+
'location' => [
133+
'geomtype' => 'geography',
134+
'srid' => 4326
135+
],
136+
'location2' => [
137+
'geomtype' => 'geography',
138+
'srid' => 4326
139+
],
140+
'location3' => [
141+
'geomtype' => 'geometry',
142+
'srid' => 27700
143+
],
144+
'polygon' => [
145+
'geomtype' => 'geography',
146+
'srid' => 4326
147+
],
148+
'polygon2' => [
149+
'geomtype' => 'geometry',
150+
'srid' => 27700
151+
]
134152
];
135153

136154
}
137155

156+
$linestring = new LineString(
157+
[
158+
new Point(0, 0),
159+
new Point(0, 1),
160+
new Point(1, 1),
161+
new Point(1, 0),
162+
new Point(0, 0)
163+
]
164+
);
165+
138166
$location1 = new Location();
139167
$location1->name = 'Googleplex';
140168
$location1->address = '1600 Amphitheatre Pkwy Mountain View, CA 94043';
141169
$location1->location = new Point(37.422009, -122.084047);
170+
$location1->location2 = new Point(37.422009, -122.084047);
171+
$location1->location3 = new Point(37.422009, -122.084047);
172+
$location1->polygon = new Polygon([$linestring]);
173+
$location1->polygon2 = new Polygon([$linestring]);
142174
$location1->save();
143175

144176
$location2 = Location::first();

0 commit comments

Comments
 (0)