Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 68e522e

Browse files
authored
Merge pull request #171 from rvdveen/add-linestringz-and-pointz
2 parents 0ce123e + 15d88e4 commit 68e522e

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

src/Schema/Blueprint.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ public function point($column, $geomtype = 'GEOGRAPHY', $srid = '4326')
1313
return $this->addColumn('point', $column, compact('geomtype', 'srid'));
1414
}
1515

16+
/**
17+
* Add a point column on the table
18+
*
19+
* @param $column
20+
* @return \Illuminate\Support\Fluent
21+
*/
22+
public function pointz($column, $geomtype = 'GEOGRAPHY', $srid = '4326')
23+
{
24+
return $this->addColumn('pointz', $column, compact('geomtype', 'srid'));
25+
}
26+
1627
/**
1728
* Add a multipoint column on the table
1829
*
@@ -68,6 +79,17 @@ public function linestring($column, $geomtype = 'GEOGRAPHY', $srid = '4326')
6879
return $this->addColumn('linestring', $column, compact('geomtype', 'srid'));
6980
}
7081

82+
/**
83+
* Add a linestringz column on the table
84+
*
85+
* @param $column
86+
* @return \Illuminate\Support\Fluent
87+
*/
88+
public function linestringz($column, $geomtype = 'GEOGRAPHY', $srid = '4326')
89+
{
90+
return $this->addColumn('linestringz', $column, compact('geomtype', 'srid'));
91+
}
92+
7193
/**
7294
* Add a multilinestring column on the table
7395
*

src/Schema/Grammars/PostgisGrammar.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ public function typePoint(Fluent $column)
2121
return $this->createTypeDefinition($column, 'POINT');
2222
}
2323

24+
/**
25+
* Adds a statement to add a pointz geometry column
26+
*
27+
* @param \Illuminate\Support\Fluent $column
28+
* @return string
29+
*/
30+
public function typePointZ(Fluent $column)
31+
{
32+
return $this->createTypeDefinition($column, 'POINTZ');
33+
}
34+
2435
/**
2536
* Adds a statement to add a point geometry column
2637
*
@@ -76,6 +87,17 @@ public function typeLinestring(Fluent $column)
7687
return $this->createTypeDefinition($column, 'LINESTRING');
7788
}
7889

90+
/**
91+
* Adds a statement to add a linestringz geometry column
92+
*
93+
* @param \Illuminate\Support\Fluent $column
94+
* @return string
95+
*/
96+
public function typeLinestringZ(Fluent $column)
97+
{
98+
return $this->createTypeDefinition($column, 'LINESTRINGZ');
99+
}
100+
79101
/**
80102
* Adds a statement to add a multilinestring geometry column
81103
*

0 commit comments

Comments
 (0)