First Commit

This commit is contained in:
Araya's Project
2026-06-10 12:12:51 +07:00
commit 6462f2e396
34 changed files with 5884 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
<?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),
];
},
]);
+17
View File
@@ -0,0 +1,17 @@
<?php
require_once __DIR__ . '/../includes/crud.php';
handle_crud([
'table' => 'tanah',
'geomType' => 'Polygon',
'fields' => ['nama', 'pemilik', 'kategori', 'deskripsi', 'warna'],
'measure' => function (array $geom): array {
// Polygon: coordinates = [ring, ...]; ring pertama = outer ring.
[, $coords] = $geom;
$outer = $coords[0] ?? [];
return [
'luas' => round(ring_area($outer), 2),
'keliling' => round(ring_perimeter($outer), 2),
];
},
]);