I have an array like that
Array(11) [ (2) […], (2) […], (2) […], (2) […], (2) […], (2) […], (2) […], (2) […], (2) […], (2) […], … ]
0: Array [ 21.0560137444799, 34.739720318378 ]
1: Array [ 21.0560779456378, 34.7397100033393 ]
2: Array [ 21.056080278408, 34.7397458213187 ]
3: Array [ 21.0561253817111, 34.7397439687819 ]
4: Array [ 21.0561232577343, 34.739797555191 ]
5: Array [ 21.0562660652913, 34.7397921848872 ]
6: Array [ 21.0562570608315, 34.7397353403419 ]
7: Array [ 21.0562048139691, 34.7397280744531 ]
8: Array [ 21.0561893739781, 34.7396442492899 ]
9: Array [ 21.0560014634615, 34.7396514720213 ]
10: Array [ 21.0560137444799, 34.739720318378 ]
length: 11
I want to create a $multipolygon = these 11 points
that is compatible in postgresql.
1° How can I create this multipolygon?
2° And then how I can I send it into a php request and ask to select only features that intersect inside this polygon? ST_MakeEnvelope works only with four points.
$sql="SELECT * from $table where $coverage in ($multipolygon)";