Commit 19264452 authored by Muhamad's avatar Muhamad

Merge branch 'master' of http://git.khansia.co.id/Nahrowi/oku-gis

# Conflicts:
#	API/__pycache__/views.cpython-37.pyc
#	API/urls.py
#	API/views.py
#	templates/includes/sidebar.html
#	templates/layout/layout.html
parents 192d9c39 f0d124c1
......@@ -63,11 +63,16 @@ urlpatterns = [
path('edit-jalan-valid', views.editjalanvalid, name='edit-jalan-valid'),
path('3d-maps', views.maps3d, name='3d-maps'),
path('deletejalan', views.deletejalan, name='hapus-jalan'),
path('filt_perbaikan_kecamatan', views.filt_perbaikan_kecamatan),
path('filt_perbaikan_desa', views.filt_perbaikan_desa),
path('user-data', views.user_data, name='user-data'),
path('deletejalan', views.deletejalan, name='hapus-jalan'),
path('search_spes', views.search_spes, name='search_spes'),
path('search_lanjut', views.search_lanjut, name='search_lanjut')
]
\ No newline at end of file
......@@ -2979,4 +2979,329 @@ def user_data(request):
'thisUser' : user_data,
'point':point
}
return Response(respon)
\ No newline at end of file
return Response(respon)
return Response(respon)
@api_view(('GET',))
def search_spes(request):
tipe = request.GET.get('type')
inp = request.GET.get('inp')
inp = str(inp)
kill = None
if tipe == ' Point':
with conn.cursor() as search_point:
search_point.execute("""
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_kantor_administrasi'
FROM
geo_kantor_administrasi a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_layanan_kesehatan'
FROM
geo_layanan_kesehatan a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_puskesmas'
FROM
geo_puskesmas a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_rumah_sakit'
FROM
geo_rumah_sakit a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_sarana_ibadah'
FROM
geo_sarana_ibadah a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_sarana_pendidikan'
FROM
geo_sarana_pendidikan a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_spbu'
FROM
geo_spbu a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_stasiun'
FROM
geo_stasiun a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_terminal_bus'
FROM
geo_terminal_bus a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_cagar_budaya'
FROM
geo_cagar_budaya a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_gardu_listrik'
FROM
geo_gardu_listrik a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
LIMIT 10
""".format(inp, inp, inp, inp, inp, inp, inp, inp, inp, inp, inp))
s_point = search_point.fetchall()
kill = s_point
elif tipe == ' Bangunan':
with conn.cursor() as search_bangunan:
search_bangunan.execute("""
select id, name, geom FROM geo_bangunan where name ilike '%{}%' LIMIT 10
""".format(inp))
s_bangunan = search_bangunan.fetchall()
kill = s_bangunan
elif tipe == ' Jalan':
with conn.cursor() as search_jalan:
search_jalan.execute("""select id, namrjl, geom FROM geo_jalan where namrjl ilike '%{}%' LIMIT 10
""".format(inp))
s_jalan = search_jalan.fetchall()
kill = s_jalan
return Response({'result':kill})
@api_view(('GET',))
def search_lanjut(request):
tipe = request.GET.get('type')
idm = request.GET.get('idx')
kills = None
if tipe == ' Point':
db = request.GET.get('db')
suk = ''
if (db == 'geo_cagar_budaya' or db == 'geo_terminal_bus'):
suk == ', a.luas'
else:
suk == ''
with conn.cursor() as search_point:
search_point.execute("""
SELECT
json_build_object (
'type',
'Feature',
'administrasi',
(
A.namobj,
A.remark,
A.alamat,
A.luas_bangunan,
A.luas_tanah,
A.satuan_luas_bangunan,
A.satuan_luas_tanah,
A.gambar,
A.tinggi_bangunan,
A.perangkat,
A.tipe_gambar,
b.kabupaten,
c.kecamatan,
d.desa,
a.id
{}
),
'geometry',
ST_AsGeoJSON ( A.geom :: geometry ) :: json
)
FROM
{} A
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE a.id = {}
""".format(suk, db, idm))
s_point = search_point.fetchall()
kills = s_point
elif tipe == ' Bangunan':
with conn.cursor() as search_bangunan:
search_bangunan.execute("""
SELECT
json_build_object (
'type',
'Feature',
'properties',
( gb.ID, gb.NAME, gb.information,
(
SELECT ARRAY_AGG
( '' || ID || ',' || tgl_perbaikan || ',' || jenis_perbaikan || '' ORDER BY tgl_perbaikan DESC )
FROM
tbl_perbaikan
WHERE
id_object = gb.ID
AND type_id = 1
)
),
'administrasi',
(
gb.address_1,
gb.address_2,
gb.address_3,
gb.provinsi,
gb.alamat,
gb.luas_bangunan,
gb.luas_tanah,
gb.tinggi_bangunan,
gb.gambar,
gb.pemilik,
gb.db_tipe,
gb.remark,
gb.point_id,
gb.point_name
),
'geometry',
ST_AsGeoJSON ( gb.geom :: geometry ) :: json
)
FROM
geo_bangunan gb
WHERE
gb.id = {}
""".format(idm))
s_bangunan = search_bangunan.fetchall()
polbang = []
for i in s_bangunan:
i[0]['properties']['f2'] = i[0]['properties']['f2'].replace("'"," ")
polbang.append(i[0])
data_bang = {'gen':s_bangunan}
kills = data_bang
elif tipe == ' Jalan':
with conn.cursor() as search_jalan:
search_jalan.execute("""SELECT
json_build_object (
'type',
'Feature',
'properties',
(
gj.ID,
namrjl,
st_length ( gj.geom :: geography ),
gj.lebar_jalan,
gj.remark,
gj.gambar,
(
SELECT ARRAY_AGG
( '' || ID || ',' || tgl_perbaikan || '' ORDER BY tgl_perbaikan DESC )
FROM
tbl_perbaikan
WHERE
id_object = gj.ID
AND type_id = 2
)
),
'geometry',
ST_AsGeoJSON ( gj.geom :: geometry ) :: json
)
FROM
geo_jalan gj
WHERE
gj.id = {}""".format(idm))
s_jalan = search_jalan.fetchall()
data_jal = {'gen':s_jalan}
kills = data_jal
return Response(kills)
\ No newline at end of file
......@@ -628,7 +628,6 @@
}
}
$(document).on("click", "#btn_edit_adm", function() {
var map_edit = L.map('map-for-edit', {
editable: true,
......@@ -4426,13 +4425,10 @@
if ((checkBox1.checked == true) || (checkBox2.checked == true) || (checkBox3.checked == true) || (checkBox4.checked == true) || (checkBox5.checked == true) || (checkBox6.checked == true) || (checkBox7.checked == true) || (checkBox8.checked == true) || (checkBox9.checked == true) || (checkBox10.checked == true) || (checkBox11.checked == true) || (checkBox12.checked == true)) {
showlegend()
} else if ((checkBox1.checked == false) && (checkBox2.checked == false) && (checkBox3.checked == false) && (checkBox4.checked == false) && (checkBox5.checked == false) && (checkBox6.checked == false) && (checkBox7.checked == false) && (checkBox8.checked == false) && (checkBox9.checked == false) && (checkBox10.checked == false) && (checkBox11.checked == false) && (checkBox12.checked == false)) {
hidelegend()
}
}
......@@ -7165,11 +7161,11 @@
},
dataType: 'json',
success: function(data) {
console.log(data)
var data_all_kab = []
for (var i = 0; i < data['result'].length; i++) {
var data_id = data['result'][i][0];
var data_po = data['result'][i][1];
var data_kab = `<option value="` +data_id + `">` + data_po + `</option>`;
console.log(data_id)
console.log(data_po)
var data_kab = `<option value="` + data_id + `">` + data_po + `</option>`;
......
......@@ -48,6 +48,12 @@
</a>
</li>
<hr>
<li>
<a href="#" id="btn-hide-all" class="side-bar-but" style="position: absolute;margin-top: 1px;">
<i class="icon-arrow-right13"></i>
</a>
</li>
</ul>
</div>
</div>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -56,7 +56,7 @@
</style>
</head>
<body style="background-image:url('../../static/img/bglog.PNG'); width: 100%; height: 100%; background-position: center; background-repeat: no-repeat; background-size: cover;">
<body style="background-image:url('../../static/img/bglog.PNG'); width: 100%; height: 100%; background-position: center; background-repeat: no-repeat; background-size: cover; overflow-x: hidden;">
<!-- <body style="background-color: gainsboro; width: 100%; height: 100%;"> -->
<!-- <body> -->
......@@ -152,7 +152,7 @@
</div>
<!-- <div class="background-image"></div> -->
<div>
<img src="../../static/img/indonesia-ter.PNG" alt="Image" style="margin-top: 4%; margin-bottom: 3%; margin-left: 36%; width:1028px; ">
<img src="../../static/img/indonesia-ter.PNG" alt="Image" style="margin-top: 4%; margin-bottom: 3%; margin-left: 38%; width:920px; ">
<span style="margin-top: 5%; margin-left: 45%; -webkit-filter: drop-shadow(5px 5px 5px #222); filter: drop-shadow(5px 5px 5px #222); width: 362px; color:#ffffff; font-family: 'Montserrat', light;">Fitur Teman-KU</span>
<img src="../../static/img/Group_68.png" alt="Image" style="margin-top: 2%; margin-left: 45%; -webkit-filter: drop-shadow(5px 5px 5px #222); filter: drop-shadow(5px 5px 5px #222);">
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment