Project Webgis2 SIG
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
$features = [];
|
||||
|
||||
// ====================
|
||||
// IBADAH
|
||||
// ====================
|
||||
$q1 = $conn->query("SELECT * FROM ibadah");
|
||||
while ($row = $q1->fetch_assoc()) {
|
||||
|
||||
$features[] = [
|
||||
"type" => "Feature",
|
||||
"properties" => [
|
||||
"tipe" => "ibadah",
|
||||
"id" => $row['id'],
|
||||
"nama" => $row['nama'],
|
||||
"jenis" => $row['jenis'],
|
||||
"radius" => $row['radius']
|
||||
],
|
||||
"geometry" => [
|
||||
"type" => "Point",
|
||||
"coordinates" => [(float)$row['lng'], (float)$row['lat']]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
// ====================
|
||||
// WARGA
|
||||
// ====================
|
||||
$q2 = $conn->query("SELECT * FROM warga");
|
||||
while ($row = $q2->fetch_assoc()) {
|
||||
|
||||
$features[] = [
|
||||
"type" => "Feature",
|
||||
"properties" => [
|
||||
"tipe" => "warga",
|
||||
"id" => $row['id'],
|
||||
"nama" => $row['nama'],
|
||||
"jumlah_kk" => $row['jumlah_kk'],
|
||||
"pengurus" => $row['pengurus']
|
||||
],
|
||||
"geometry" => [
|
||||
"type" => "Point",
|
||||
"coordinates" => [(float)$row['lng'], (float)$row['lat']]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
// output GeoJSON
|
||||
echo json_encode([
|
||||
"type" => "FeatureCollection",
|
||||
"features" => $features
|
||||
]);
|
||||
?>
|
||||
Reference in New Issue
Block a user