Skip to content

Commit 30403e4

Browse files
committed
Some GeoJSON fixes
1 parent 64381d1 commit 30403e4

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/Tqdev/PhpCrudApi/GeoJson/GeoJsonService.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ public function _list(string $tableName, array $params): FeatureCollection
5959

6060
$features = array();
6161
foreach ($records->getRecords() as $record) {
62-
if (isset($record[$geometryColumnName])) {
63-
$features[] = $this->convertRecordToFeature($record, $geometryColumnName);
64-
}
62+
$features[] = $this->convertRecordToFeature($record, $geometryColumnName);
6563
}
6664
return new FeatureCollection($features);
6765
}

tests/functional/001_records/083_list_countries_as_geojson.log renamed to tests/functional/001_records/083_list_users_as_geojson.log

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ GET /geojson/users
22
===
33
200
44
Content-Type: application/json
5-
Content-Length: 174
5+
Content-Length: 269
66

7-
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"id":1,"username":"user1","password":"testtest2"},"geometry":{"type":"Point","coordinates":[30,20]}}]}
7+
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"id":1,"username":"user1","password":"testtest2"},"geometry":{"type":"Point","coordinates":[30,20]}},{"type":"Feature","properties":{"id":2,"username":"user2","password":"pass2"},"geometry":null}]}

0 commit comments

Comments
 (0)