Files
UAS_WEBGIS_DeranggaArayAbim…/sig-02/api/jalan.php
T
Araya's Project 6462f2e396 First Commit
2026-06-10 12:12:51 +07:00

16 lines
430 B
PHP

<?php
require_once __DIR__ . '/../includes/crud.php';
handle_crud([
'table' => 'jalan',
'geomType' => 'LineString',
'fields' => ['nama', 'jenis', 'kategori', 'deskripsi', 'warna'],
'measure' => function (array $geom): array {
// LineString: coordinates = [ [lng,lat], ... ]
[, $coords] = $geom;
return [
'panjang' => round(line_length($coords), 2),
];
},
]);