- {% if geom_type == 'GEOMETRYCOLLECTION' %}
-
- {% endif %}
-
+
-
- {% if geom_count > 0 %}
- {% for a in 0..geom_count - 1 %}
- {% if gis_data[a] is not null %}
- {% if geom_type == 'GEOMETRYCOLLECTION' %}
-
- {{ 'Geometry %d:'|trans|format(a + 1) }}
-
- {% if gis_data[a]['gis_type'] is not null %}
- {% set type = gis_data[a]['gis_type'] %}
- {% else %}
- {% set type = gis_types[0] %}
- {% endif %}
-
- {% else %}
- {% set type = geom_type %}
- {% endif %}
-
- {% if type == 'POINT' %}
-
- {% trans 'Point:' %}
-
-
- {% elseif type == 'MULTIPOINT' or type == 'LINESTRING' %}
- {% set no_of_points = gis_data[a][type]['no_of_points'] ?? 1 %}
- {% if type == 'LINESTRING' and no_of_points < 2 %}
- {% set no_of_points = 2 %}
- {% endif %}
- {% if type == 'MULTIPOINT' and no_of_points < 1 %}
- {% set no_of_points = 1 %}
- {% endif %}
-
-
- {% for i in 0..no_of_points - 1 %}
-
- {{ 'Point %d:'|trans|format(i + 1) }}
-
-
- {% endfor %}
-
{% trans '+ Add a point' %}
- {% elseif type == 'MULTILINESTRING' or type == 'POLYGON' %}
- {% set no_of_lines = gis_data[a][type]['no_of_lines'] ?? 1 %}
- {% if no_of_lines < 1 %}
- {% set no_of_lines = 1 %}
- {% endif %}
-
-
- {% for i in 0..no_of_lines - 1 %}
-
- {% if type == 'MULTILINESTRING' %}
- {{ 'Linestring %d:'|trans|format(i + 1) }}
- {% elseif i == 0 %}
- {% trans 'Outer ring:' %}
- {% else %}
- {{ 'Inner ring %d:'|trans|format(i) }}
- {% endif %}
-
- {% set no_of_points = gis_data[a][type][i]['no_of_points'] ?? 2 %}
- {% if type == 'MULTILINESTRING' and no_of_points < 2 %}
- {% set no_of_points = 2 %}
- {% endif %}
- {% if type == 'POLYGON' and no_of_points < 4 %}
- {% set no_of_points = 4 %}
- {% endif %}
-
-
- {% for j in 0..no_of_points - 1 %}
-
- {{ 'Point %d:'|trans|format(j + 1) }}
-
-
- {% endfor %}
-
+ {% trans 'Add a point' %}
- {% endfor %}
-
-
- + {{- type == 'MULTILINESTRING' ? 'Add a linestring'|trans : 'Add an inner ring'|trans }}
-
- {% elseif type == 'MULTIPOLYGON' %}
- {% set no_of_polygons = gis_data[a][type]['no_of_polygons'] ?? 1 %}
- {% if no_of_polygons < 1 %}
- {% set no_of_polygons = 1 %}
- {% endif %}
-
-
- {% for k in 0..no_of_polygons - 1 %}
-
- {{ 'Polygon %d:'|trans|format(k + 1) }}
- {% set no_of_lines = gis_data[a][type][k]['no_of_lines'] ?? 1 %}
- {% if no_of_lines < 1 %}
- {% set no_of_lines = 1 %}
- {% endif %}
-
-
- {% for i in 0..no_of_lines - 1 %}
-
- {% if i == 0 %}
- {% trans 'Outer ring:' %}
- {% else %}
- {{ 'Inner ring %d:'|trans|format(i) }}
- {% endif %}
-
- {% set no_of_points = gis_data[a][type][k][i]['no_of_points'] ?? 4 %}
- {% if no_of_points < 4 %}
- {% set no_of_points = 4 %}
- {% endif %}
-
-
- {% for j in 0..no_of_points - 1 %}
-
- {{ 'Point %d:'|trans|format(j + 1) }}
-
-
- {% endfor %}
-
+ {% trans 'Add a point' %}
- {% endfor %}
-
-
+ {% trans 'Add an inner ring' %}
-
- {% endfor %}
-
-
+ {% trans 'Add a polygon' %}
- {% endif %}
- {% endif %}
- {% endfor %}
- {% endif %}
- {% if geom_type == 'GEOMETRYCOLLECTION' %}
-
-
+ {% trans 'Add geometry' %}
- {% endif %}
{# End of data section #}
diff --git a/test/classes/Gis/Ds/PolygonTest.php b/test/classes/Gis/Ds/PolygonTest.php
index 1e38fb70df..bc9b6478e8 100644
--- a/test/classes/Gis/Ds/PolygonTest.php
+++ b/test/classes/Gis/Ds/PolygonTest.php
@@ -22,9 +22,9 @@ class PolygonTest extends AbstractTestCase
{
return [
'POLYGON' => [
- 'no_of_lines' => 2,
+ 'data_length' => 2,
0 => [
- 'no_of_points' => 5,
+ 'data_length' => 5,
0 => ['x' => 35, 'y' => 10],
1 => ['x' => 10, 'y' => 20],
2 => ['x' => 15, 'y' => 40],
@@ -32,7 +32,7 @@ class PolygonTest extends AbstractTestCase
4 => ['x' => 35, 'y' => 10],
],
1 => [
- 'no_of_points' => 4,
+ 'data_length' => 4,
0 => ['x' => 20, 'y' => 30],
1 => ['x' => 35, 'y' => 32],
2 => ['x' => 30, 'y' => 20],
@@ -145,8 +145,8 @@ class PolygonTest extends AbstractTestCase
public static function providerForTestGetPointOnSurface(): array
{
$temp = self::getData();
- unset($temp['POLYGON'][0]['no_of_points']);
- unset($temp['POLYGON'][1]['no_of_points']);
+ unset($temp['POLYGON'][0]['data_length']);
+ unset($temp['POLYGON'][1]['data_length']);
return [[Polygon::fromXYArray($temp['POLYGON'][0])], [Polygon::fromXYArray($temp['POLYGON'][1])]];
}
diff --git a/test/classes/Gis/GisGeometryCollectionTest.php b/test/classes/Gis/GisGeometryCollectionTest.php
index a40a510f54..a081be64db 100644
--- a/test/classes/Gis/GisGeometryCollectionTest.php
+++ b/test/classes/Gis/GisGeometryCollectionTest.php
@@ -73,7 +73,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
$temp1 = [
0 => [
'gis_type' => 'LINESTRING',
- 'LINESTRING' => ['no_of_points' => 2, 0 => ['x' => 5.02,'y' => 8.45], 1 => ['x' => 6.14,'y' => 0.15]],
+ 'LINESTRING' => ['data_length' => 2, 0 => ['x' => 5.02,'y' => 8.45], 1 => ['x' => 6.14,'y' => 0.15]],
],
];
@@ -82,7 +82,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
[
'gis_type' => 'GEOMETRYCOLLECTION',
'srid' => '0',
- 'GEOMETRYCOLLECTION' => ['geom_count' => '1'],
+ 'GEOMETRYCOLLECTION' => ['data_length' => '1'],
0 => ['gis_type' => 'POINT'],
],
0,
@@ -93,7 +93,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
[
'gis_type' => 'GEOMETRYCOLLECTION',
'srid' => '0',
- 'GEOMETRYCOLLECTION' => ['geom_count' => '1'],
+ 'GEOMETRYCOLLECTION' => ['data_length' => '1'],
0 => ['gis_type' => 'LINESTRING'],
],
0,
@@ -104,7 +104,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
[
'gis_type' => 'GEOMETRYCOLLECTION',
'srid' => '0',
- 'GEOMETRYCOLLECTION' => ['geom_count' => '1'],
+ 'GEOMETRYCOLLECTION' => ['data_length' => '1'],
0 => ['gis_type' => 'POLYGON'],
],
0,
@@ -115,7 +115,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
[
'gis_type' => 'GEOMETRYCOLLECTION',
'srid' => '0',
- 'GEOMETRYCOLLECTION' => ['geom_count' => '1'],
+ 'GEOMETRYCOLLECTION' => ['data_length' => '1'],
0 => ['gis_type' => 'MULTIPOINT'],
],
0,
@@ -126,7 +126,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
[
'gis_type' => 'GEOMETRYCOLLECTION',
'srid' => '0',
- 'GEOMETRYCOLLECTION' => ['geom_count' => '1'],
+ 'GEOMETRYCOLLECTION' => ['data_length' => '1'],
0 => ['gis_type' => 'MULTILINESTRING'],
],
0,
@@ -137,7 +137,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
[
'gis_type' => 'GEOMETRYCOLLECTION',
'srid' => '0',
- 'GEOMETRYCOLLECTION' => ['geom_count' => '1'],
+ 'GEOMETRYCOLLECTION' => ['data_length' => '1'],
0 => ['gis_type' => 'MULTIPOLYGON'],
],
0,
@@ -181,11 +181,11 @@ class GisGeometryCollectionTest extends GisGeomTestCase
. ')',
[
'srid' => 0,
- 'GEOMETRYCOLLECTION' => ['geom_count' => 6],
+ 'GEOMETRYCOLLECTION' => ['data_length' => 6],
0 => [
'gis_type' => 'LINESTRING',
'LINESTRING' => [
- 'no_of_points' => 2,
+ 'data_length' => 2,
0 => ['x' => 5.02, 'y' => 8.45],
1 => ['x' => 6.14, 'y' => 0.15],
],
@@ -193,15 +193,15 @@ class GisGeometryCollectionTest extends GisGeomTestCase
1 => [
'gis_type' => 'MULTILINESTRING',
'MULTILINESTRING' => [
- 'no_of_lines' => 2,
+ 'data_length' => 2,
0 => [
- 'no_of_points' => 3,
+ 'data_length' => 3,
0 => ['x' => 36.0, 'y' => 14.0],
1 => ['x' => 47.0, 'y' => 23.0],
2 => ['x' => 62.0, 'y' => 75.0],
],
1 => [
- 'no_of_points' => 3,
+ 'data_length' => 3,
0 => ['x' => 36.0, 'y' => 10.0],
1 => ['x' => 17.0, 'y' => 23.0],
2 => ['x' => 178.0, 'y' => 53.0],
@@ -211,7 +211,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
2 => [
'gis_type' => 'MULTIPOINT',
'MULTIPOINT' => [
- 'no_of_points' => 2,
+ 'data_length' => 2,
0 => ['x' => 5.02, 'y' => 8.45],
1 => ['x' => 6.14, 'y' => 0.15],
],
@@ -219,11 +219,11 @@ class GisGeometryCollectionTest extends GisGeomTestCase
3 => [
'gis_type' => 'MULTIPOLYGON',
'MULTIPOLYGON' => [
- 'no_of_polygons' => 2,
+ 'data_length' => 2,
0 => [
- 'no_of_lines' => 2,
+ 'data_length' => 2,
0 => [
- 'no_of_points' => 5,
+ 'data_length' => 5,
0 => ['x' => 35.0, 'y' => 10.0],
1 => ['x' => 10.0, 'y' => 20.0],
2 => ['x' => 15.0, 'y' => 40.0],
@@ -231,7 +231,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
4 => ['x' => 35.0, 'y' => 10.0],
],
1 => [
- 'no_of_points' => 4,
+ 'data_length' => 4,
0 => ['x' => 20.0, 'y' => 30.0],
1 => ['x' => 35.0, 'y' => 32.0],
2 => ['x' => 30.0, 'y' => 20.0],
@@ -239,9 +239,9 @@ class GisGeometryCollectionTest extends GisGeomTestCase
],
],
1 => [
- 'no_of_lines' => 1,
+ 'data_length' => 1,
0 => [
- 'no_of_points' => 4,
+ 'data_length' => 4,
0 => ['x' => 123.0, 'y' => 0.0],
1 => ['x' => 23.0, 'y' => 30.0],
2 => ['x' => 17.0, 'y' => 63.0],
@@ -254,9 +254,9 @@ class GisGeometryCollectionTest extends GisGeomTestCase
5 => [
'gis_type' => 'POLYGON',
'POLYGON' => [
- 'no_of_lines' => 2,
+ 'data_length' => 2,
0 => [
- 'no_of_points' => 5,
+ 'data_length' => 5,
0 => ['x' => 35.0, 'y' => 10.0],
1 => ['x' => 10.0, 'y' => 20.0],
2 => ['x' => 15.0, 'y' => 40.0],
@@ -264,7 +264,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
4 => ['x' => 35.0, 'y' => 10.0],
],
1 => [
- 'no_of_points' => 4,
+ 'data_length' => 4,
0 => ['x' => 20.0, 'y' => 30.0],
1 => ['x' => 35.0, 'y' => 32.0],
2 => ['x' => 30.0, 'y' => 20.0],
diff --git a/test/classes/Gis/GisLineStringTest.php b/test/classes/Gis/GisLineStringTest.php
index 8ab7e9ee11..91833737c5 100644
--- a/test/classes/Gis/GisLineStringTest.php
+++ b/test/classes/Gis/GisLineStringTest.php
@@ -30,7 +30,7 @@ class GisLineStringTest extends GisGeomTestCase
$temp1 = [
0 => [
'LINESTRING' => [
- 'no_of_points' => 2,
+ 'data_length' => 2,
0 => ['x' => 5.02, 'y' => 8.45],
1 => ['x' => 6.14, 'y' => 0.15],
],
@@ -38,21 +38,21 @@ class GisLineStringTest extends GisGeomTestCase
];
$temp2 = $temp1;
- $temp2[0]['LINESTRING']['no_of_points'] = 3;
+ $temp2[0]['LINESTRING']['data_length'] = 3;
$temp2[0]['LINESTRING'][2] = ['x' => 1.56];
$temp3 = $temp2;
- $temp3[0]['LINESTRING']['no_of_points'] = -1;
+ $temp3[0]['LINESTRING']['data_length'] = -1;
$temp4 = $temp3;
- $temp4[0]['LINESTRING']['no_of_points'] = 3;
+ $temp4[0]['LINESTRING']['data_length'] = 3;
unset($temp4[0]['LINESTRING'][2]['x']);
return [
[$temp1, 0, null, 'LINESTRING(5.02 8.45,6.14 0.15)'],
// if a coordinate is missing, default is empty string
[$temp2, 0, null, 'LINESTRING(5.02 8.45,6.14 0.15,1.56 )'],
- // if no_of_points is not valid, it is considered as 2
+ // if data_length is not valid, it is considered as 2
[$temp3, 0, null, 'LINESTRING(5.02 8.45,6.14 0.15)'],
// missing coordinates are replaced with provided values (3rd parameter)
[$temp4, 0, '0', 'LINESTRING(5.02 8.45,6.14 0.15,0 0)'],
@@ -101,7 +101,7 @@ class GisLineStringTest extends GisGeomTestCase
'srid' => 124,
0 => [
'LINESTRING' => [
- 'no_of_points' => 2,
+ 'data_length' => 2,
0 => ['x' => 5.02, 'y' => 8.45],
1 => ['x' => 6.14, 'y' => 0.15],
],
@@ -114,7 +114,7 @@ class GisLineStringTest extends GisGeomTestCase
'srid' => 0,
0 => [
'LINESTRING' => [
- 'no_of_points' => 1,
+ 'data_length' => 1,
0 => [
'x' => 0,
'y' => 0,
diff --git a/test/classes/Gis/GisMultiLineStringTest.php b/test/classes/Gis/GisMultiLineStringTest.php
index 4a4c12872c..d1a8745458 100644
--- a/test/classes/Gis/GisMultiLineStringTest.php
+++ b/test/classes/Gis/GisMultiLineStringTest.php
@@ -30,9 +30,9 @@ class GisMultiLineStringTest extends GisGeomTestCase
$temp = [
0 => [
'MULTILINESTRING' => [
- 'no_of_lines' => 2,
- 0 => ['no_of_points' => 2, 0 => ['x' => 5.02, 'y' => 8.45], 1 => ['x' => 6.14, 'y' => 0.15]],
- 1 => ['no_of_points' => 2, 0 => ['x' => 1.23, 'y' => 4.25], 1 => ['x' => 9.15, 'y' => 0.47]],
+ 'data_length' => 2,
+ 0 => ['data_length' => 2, 0 => ['x' => 5.02, 'y' => 8.45], 1 => ['x' => 6.14, 'y' => 0.15]],
+ 1 => ['data_length' => 2, 0 => ['x' => 1.23, 'y' => 4.25], 1 => ['x' => 9.15, 'y' => 0.47]],
],
],
];
@@ -41,10 +41,10 @@ class GisMultiLineStringTest extends GisGeomTestCase
unset($temp1[0]['MULTILINESTRING'][1][1]['y']);
$temp2 = $temp;
- $temp2[0]['MULTILINESTRING']['no_of_lines'] = 0;
+ $temp2[0]['MULTILINESTRING']['data_length'] = 0;
$temp3 = $temp;
- $temp3[0]['MULTILINESTRING'][1]['no_of_points'] = 1;
+ $temp3[0]['MULTILINESTRING'][1]['data_length'] = 1;
return [
[$temp, 0, null, 'MULTILINESTRING((5.02 8.45,6.14 0.15),(1.23 4.25,9.15 0.47))'],
@@ -121,9 +121,9 @@ class GisMultiLineStringTest extends GisGeomTestCase
'srid' => 124,
0 => [
'MULTILINESTRING' => [
- 'no_of_lines' => 2,
- 0 => ['no_of_points' => 2, 0 => ['x' => 5.02,'y' => 8.45], 1 => ['x' => 6.14,'y' => 0.15]],
- 1 => ['no_of_points' => 2, 0 => ['x' => 1.23,'y' => 4.25], 1 => ['x' => 9.15,'y' => 0.47]],
+ 'data_length' => 2,
+ 0 => ['data_length' => 2, 0 => ['x' => 5.02,'y' => 8.45], 1 => ['x' => 6.14,'y' => 0.15]],
+ 1 => ['data_length' => 2, 0 => ['x' => 1.23,'y' => 4.25], 1 => ['x' => 9.15,'y' => 0.47]],
],
],
],
diff --git a/test/classes/Gis/GisMultiPointTest.php b/test/classes/Gis/GisMultiPointTest.php
index 7f9676f01b..6e7473c693 100644
--- a/test/classes/Gis/GisMultiPointTest.php
+++ b/test/classes/Gis/GisMultiPointTest.php
@@ -32,7 +32,7 @@ class GisMultiPointTest extends GisGeomTestCase
$gisData1 = [
0 => [
'MULTIPOINT' => [
- 'no_of_points' => 2,
+ 'data_length' => 2,
0 => ['x' => 5.02, 'y' => 8.45],
1 => ['x' => 1.56, 'y' => 4.36],
],
@@ -40,7 +40,7 @@ class GisMultiPointTest extends GisGeomTestCase
];
$gisData2 = $gisData1;
- $gisData2[0]['MULTIPOINT']['no_of_points'] = -1;
+ $gisData2[0]['MULTIPOINT']['data_length'] = -1;
return [
[$gisData1, 0, null, 'MULTIPOINT(5.02 8.45,1.56 4.36)'],
@@ -101,7 +101,7 @@ class GisMultiPointTest extends GisGeomTestCase
'srid' => 124,
0 => [
'MULTIPOINT' => [
- 'no_of_points' => 2,
+ 'data_length' => 2,
0 => ['x' => 5.02, 'y' => 8.45],
1 => ['x' => 6.14, 'y' => 0.15],
],
diff --git a/test/classes/Gis/GisMultiPolygonTest.php b/test/classes/Gis/GisMultiPolygonTest.php
index 86c774982d..81b9dd408f 100644
--- a/test/classes/Gis/GisMultiPolygonTest.php
+++ b/test/classes/Gis/GisMultiPolygonTest.php
@@ -29,11 +29,11 @@ class GisMultiPolygonTest extends GisGeomTestCase
{
return [
'MULTIPOLYGON' => [
- 'no_of_polygons' => 2,
+ 'data_length' => 2,
0 => [
- 'no_of_lines' => 2,
+ 'data_length' => 2,
0 => [
- 'no_of_points' => 5,
+ 'data_length' => 5,
0 => ['x' => 35, 'y' => 10],
1 => ['x' => 10, 'y' => 20],
2 => ['x' => 15, 'y' => 40],
@@ -41,7 +41,7 @@ class GisMultiPolygonTest extends GisGeomTestCase
4 => ['x' => 35, 'y' => 10],
],
1 => [
- 'no_of_points' => 4,
+ 'data_length' => 4,
0 => ['x' => 20, 'y' => 30],
1 => ['x' => 35, 'y' => 32],
2 => ['x' => 30, 'y' => 20],
@@ -49,9 +49,9 @@ class GisMultiPolygonTest extends GisGeomTestCase
],
],
1 => [
- 'no_of_lines' => 1,
+ 'data_length' => 1,
0 => [
- 'no_of_points' => 4,
+ 'data_length' => 4,
0 => ['x' => 123, 'y' => 0],
1 => ['x' => 23, 'y' => 30],
2 => ['x' => 17, 'y' => 63],
@@ -87,13 +87,13 @@ class GisMultiPolygonTest extends GisGeomTestCase
$temp = [0 => self::getData()];
$temp1 = $temp;
- $temp1[0]['MULTIPOLYGON']['no_of_polygons'] = 0;
+ $temp1[0]['MULTIPOLYGON']['data_length'] = 0;
$temp2 = $temp;
- $temp2[0]['MULTIPOLYGON'][1]['no_of_lines'] = 0;
+ $temp2[0]['MULTIPOLYGON'][1]['data_length'] = 0;
$temp3 = $temp;
- $temp3[0]['MULTIPOLYGON'][1][0]['no_of_points'] = 3;
+ $temp3[0]['MULTIPOLYGON'][1][0]['data_length'] = 3;
return [
[
diff --git a/test/classes/Gis/GisPolygonTest.php b/test/classes/Gis/GisPolygonTest.php
index cfe089b307..afb9e10178 100644
--- a/test/classes/Gis/GisPolygonTest.php
+++ b/test/classes/Gis/GisPolygonTest.php
@@ -29,9 +29,9 @@ class GisPolygonTest extends GisGeomTestCase
{
return [
'POLYGON' => [
- 'no_of_lines' => 2,
+ 'data_length' => 2,
0 => [
- 'no_of_points' => 5,
+ 'data_length' => 5,
0 => ['x' => 35, 'y' => 10],
1 => ['x' => 10, 'y' => 20],
2 => ['x' => 15, 'y' => 40],
@@ -39,7 +39,7 @@ class GisPolygonTest extends GisGeomTestCase
4 => ['x' => 35, 'y' => 10],
],
1 => [
- 'no_of_points' => 4,
+ 'data_length' => 4,
0 => ['x' => 20, 'y' => 30],
1 => ['x' => 35, 'y' => 32],
2 => ['x' => 30, 'y' => 20],
@@ -77,10 +77,10 @@ class GisPolygonTest extends GisGeomTestCase
unset($temp1[0]['POLYGON'][1][3]['y']);
$temp2 = $temp;
- $temp2[0]['POLYGON']['no_of_lines'] = 0;
+ $temp2[0]['POLYGON']['data_length'] = 0;
$temp3 = $temp;
- $temp3[0]['POLYGON'][1]['no_of_points'] = 3;
+ $temp3[0]['POLYGON'][1]['data_length'] = 3;
return [
[$temp, 0, null, 'POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 32,30 20,20 30))'],