Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OKU-GIS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhamad
OKU-GIS
Commits
1fcdd69e
Commit
1fcdd69e
authored
Aug 06, 2021
by
Manggar Mahardhika
Browse files
Options
Browse Files
Download
Plain Diff
konflik js-m
parents
696fadf2
18486b82
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
847 additions
and
601 deletions
+847
-601
API/views.py
API/views.py
+105
-11
templates/includes/js-m.html
templates/includes/js-m.html
+339
-229
templates/includes/js-o.html
templates/includes/js-o.html
+7
-7
templates/includes/modal.html
templates/includes/modal.html
+22
-3
templates/includes/navbar.html
templates/includes/navbar.html
+3
-1
templates/includes/plugin.html
templates/includes/plugin.html
+23
-13
templates/layout/layout.html
templates/layout/layout.html
+9
-4
templates/layout/user_layout.html
templates/layout/user_layout.html
+339
-333
No files found.
API/views.py
View file @
1fcdd69e
...
@@ -48,9 +48,9 @@ import random
...
@@ -48,9 +48,9 @@ import random
@
api_view
((
'GET'
,))
@
api_view
((
'GET'
,))
@
renderer_classes
((
TemplateHTMLRenderer
,
JSONRenderer
))
@
renderer_classes
((
TemplateHTMLRenderer
,
JSONRenderer
))
def
search_auto
(
request
):
def
search_auto
(
request
):
nama_desa
=
request
.
GET
.
get
(
'namadesa'
)
with
conn
.
cursor
()
as
desa
:
with
conn
.
cursor
()
as
desa
:
desa
.
execute
(
f
"SELECT id, desa, kecamatan FROM geo_data_kelurahan
WHERE desa ILIKE '{nama_desa}
%
' order by desa ASC limit 5
"
)
desa
.
execute
(
f
"SELECT id, desa, kecamatan FROM geo_data_kelurahan
order by desa ASC
"
)
all
=
desa
.
fetchall
()
all
=
desa
.
fetchall
()
data
=
{
'nama_des'
:
all
}
data
=
{
'nama_des'
:
all
}
...
@@ -737,22 +737,116 @@ def hapus(request):
...
@@ -737,22 +737,116 @@ def hapus(request):
print
(
respon
)
print
(
respon
)
return
Response
(
respon
)
return
Response
(
respon
)
@
api_view
((
'GET'
,))
@
api_view
((
'GET'
,))
@
renderer_classes
((
TemplateHTMLRenderer
,
JSONRenderer
))
@
renderer_classes
((
TemplateHTMLRenderer
,
JSONRenderer
))
def
hasilsearch
(
request
):
def
hasilsearch
(
request
):
if
request
.
method
==
'GET'
:
if
request
.
method
==
'GET'
:
id_desa
=
request
.
GET
.
get
(
"id_desa_search"
)
nama_desa
=
request
.
GET
.
get
(
"id_desa_search"
)
nama_desa
=
nama_desa
.
split
(
","
)[
0
]
with
conn
.
cursor
()
as
bts
:
bts
.
execute
(
"""
SELECT
st_asgeojson ( ST_ExteriorRing ( the_geom ) ) AS erings
FROM
( SELECT ( ST_Dump ( geom ) ).geom AS the_geom FROM geo_data_kelurahan WHERE desa = '
%
s' ) as foo
"""
%
nama_desa
)
batas
=
bts
.
fetchall
()
# batas_desa = json.loads(batas)
line_o
=
[]
for
i
in
batas
:
o_pol1
=
''
o_poly
=
[]
for
x
in
json
.
loads
(
i
[
0
])[
'coordinates'
]:
o_pol1
+=
(
f
'{x[0]},{x[1]}""'
)
o_pol2
=
o_pol1
.
replace
(
'""1'
,
',1'
)
with
conn
.
cursor
()
as
kel
:
o_poly
.
append
(
o_pol2
.
replace
(
'""'
,
''
))
kel
.
execute
(
"SELECT json_build_object('type', 'Feature', 'administrasi', (kode_desa, desa, kecamatan, kab_kota, provinsi, jumlah_pen, jumlah_kk, luas_desa),'penduduk', (pria, wanita, belum_kawin, kawin, cerai_hidup, cerai_mati, wajib_ktp, islam, kristen, khatolik, hindu, budha, konghucu, kepercayaan_lain, u0, u5, u10, u15, u20, u25, u30, u35, u40, u45, u50, u55, u60, u65, u70, u75),'pekerjaan_pendidikan', (tidak_sekolah, belum_tamat, tamat_sd, sltp, slta, diploma_i, diploma_ii, diploma_iv, strata_ii, strata_iii, tidak_bekerja, aparatur_pemerintah, tenaga_pendidik, wiraswasta, pertanian, tenaga_kesehatan, pensiunan, pegawai, tentara, kepolisian, pedagang, petani, peternak, nelayan, karyawan, buruh, pembantu, tukang, pendeta, pastor, ustadz, dosen, guru, pilot, pengacara, notaris, arsitek, akuntan, konsultan, dokter, bidan, perawat, psikiater, sopir, lainnya),'geometry', ST_AsGeoJSON(geom :: geometry) :: json) from geo_data_kelurahan where id =
%
s"
%
int
(
id_desa
))
kel_res_
=
kel
.
fetchall
()
line_o
.
append
(
o_poly
)
with
conn
.
cursor
()
as
desa
:
desa
.
execute
(
"""
SELECT
ST_AsGeoJson ( ST_centroid ( geom ) )
FROM
geo_data_kelurahan
WHERE
desa = '
%
s'"""
%
nama_desa
)
lat_lng
=
desa
.
fetchall
()
with
conn
.
cursor
()
as
bang
:
bang
.
execute
(
"""SELECT
json_build_object (
'type',
'Feature',
'properties',
( buildings.ID, buildings.NAME, buildings.information ),
'administrasi',
(
buildings.address_1,
buildings.address_2,
buildings.address_3,
buildings.provinsi,
buildings.alamat,
buildings.luas_bangunan,
buildings.luas_tanah,
buildings.tinggi_bangunan,
buildings.gambar,
buildings.pemilik
),
'geometry',
ST_AsGeoJSON ( buildings.geom :: geometry ) :: json
)
FROM
geo_bangunan buildings
JOIN geo_data_kelurahan desa ON st_intersects ( ST_SetSRID(desa.geom, 0), buildings.geom )
WHERE
desa.desa = '
%
s'"""
%
nama_desa
)
kel_res
=
[]
bangunan
=
bang
.
fetchall
()
for
i
in
kel_res_
:
kel_res
.
append
(
i
[
0
])
polygon_o
=
[]
info_polygon
=
[]
tinggi_pol
=
[]
for
i
in
bangunan
:
o_pol1
=
''
o_poly
=
[]
for
x
in
i
[
0
][
'geometry'
][
'coordinates'
][
0
][
0
]:
o_pol1
+=
(
f
'{x[0]},{x[1]}""'
)
o_pol2
=
o_pol1
.
replace
(
'""1'
,
',1'
)
data
=
{
'result'
:
kel_res
}
o_poly
.
append
(
o_pol2
.
replace
(
'""'
,
''
))
return
Response
(
data
)
polygon_o
.
append
(
o_poly
)
tinggi_pol
.
append
(
i
[
0
][
'administrasi'
][
'f8'
])
info_polygon
.
append
(
i
[
0
][
'properties'
][
'f1'
])
# for i in batas:
# o_batas = ''
# o_poly_batas = []
# for x in i[0]['geometry']['coordinates'][0][0]:
# o_batas += (f'{x[0]},{x[1]}""')
# o_pol2 = o_pol1.replace('""1',',1')
# o_poly.append(o_pol2.replace('""',''))
# polygon_o.append(o_poly)
# tinggi_pol.append(i[0]['administrasi']['f8'])
# info_polygon.append(i[0]['properties']['f1'])
lat
=
json
.
loads
(
lat_lng
[
0
][
0
])[
'coordinates'
][
0
]
lng
=
json
.
loads
(
lat_lng
[
0
][
0
])[
'coordinates'
][
1
]
respon
=
{
'polygon_o'
:
polygon_o
,
'tinggi_pol'
:
tinggi_pol
,
'info_polygon'
:
info_polygon
,
'lat'
:
lat
,
'lng'
:
lng
,
'line_o'
:
line_o
}
return
Response
(
respon
)
import
random
import
random
...
...
templates/includes/js-m.html
View file @
1fcdd69e
This diff is collapsed.
Click to expand it.
templates/includes/js-o.html
View file @
1fcdd69e
...
@@ -1054,7 +1054,7 @@
...
@@ -1054,7 +1054,7 @@
var
desa
=
response
[
'
nama_des
'
][
i
][
1
];
var
desa
=
response
[
'
nama_des
'
][
i
][
1
];
var
kec
=
response
[
'
nama_des
'
][
i
][
2
];
var
kec
=
response
[
'
nama_des
'
][
i
][
2
];
var
da
=
`<li value='`
+
id
+
`'>`
+
desa
+
`,`
+
kec
+
`</li>`
;
var
da
=
`<li value='`
+
desa
+
`,`
+
kec
+
`'>`
+
desa
+
`,`
+
kec
+
`</li>`
;
data_de
.
push
(
da
)
data_de
.
push
(
da
)
}
}
...
@@ -1071,6 +1071,9 @@
...
@@ -1071,6 +1071,9 @@
});
});
//3d begin
function
setsearch
(
element
)
{
function
setsearch
(
element
)
{
var
value
=
$
(
element
).
text
();
var
value
=
$
(
element
).
text
();
...
@@ -1086,11 +1089,8 @@
...
@@ -1086,11 +1089,8 @@
},
},
dataType
:
'
json
'
,
dataType
:
'
json
'
,
success
:
function
(
response
)
{
success
:
function
(
response
)
{
var
resultan
=
response
[
'
result
'
][
0
]
geo_json_search
(
resultan
);
console
.
log
(
response
)
map
.
setView
([
resultan
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
1
],
resultan
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
0
]],
14
);
search_desa
.
addTo
(
map
)
geo_batas
.
remove
()
}
}
});
});
}
}
...
@@ -1467,7 +1467,7 @@
...
@@ -1467,7 +1467,7 @@
// } else {
// } else {
// var path_img = `"static/image/bangunan/` + feature.administrasi.f9 + `"`
// var path_img = `"static/image/bangunan/` + feature.administrasi.f9 + `"`
// }
// }
// // var list_history = feature.properties.f7
// // var list_history = feature.properties.f7
// // var list_history_panel = ``
// // var list_history_panel = ``
...
...
templates/includes/modal.html
View file @
1fcdd69e
...
@@ -699,9 +699,28 @@
...
@@ -699,9 +699,28 @@
</div>
</div>
</div>
</div>
<div
class=
"modal fade"
id=
"modalsearch3d"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog modal-xs"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
3D Searching
</h4>
</div>
<div
class=
"modal-body"
>
<fieldset>
<select
id=
"search_desa"
placeholder=
"Pick a state..."
style=
"width: 256px;height: 35px;"
>
</select>
<br>
</fieldset>
</div>
<div
class=
"modal-footer"
>
<input
class=
"btn btn-success btn-block"
id=
"search3D"
type=
"submit"
value=
"Search"
>
</div>
</div>
</div>
</div>
</div>
</div>
<!--
<script>
<script>
$("#tipe_point").change(function() {
$("#tipe_point").change(function() {
var tipe = $(this).val();
var tipe = $(this).val();
...
@@ -729,4 +748,4 @@
...
@@ -729,4 +748,4 @@
}
}
});
});
});
});
</script>
</script> -->
\ No newline at end of file
\ No newline at end of file
templates/includes/navbar.html
View file @
1fcdd69e
...
@@ -10,9 +10,11 @@
...
@@ -10,9 +10,11 @@
top: 7px;"
>
top: 7px;"
>
</i>
</i>
<!-- <i class="icon-location4 fa-gradient"></i> -->
<!-- <i class="icon-location4 fa-gradient"></i> -->
<b>
OKU-GIS
</b>
<b>
Teman-KU
</b>
(Sistem Informasi Pembangunan OKU)
</a>
</a>
<ul
class=
"nav navbar-nav pull-right visible-xs-block"
>
<ul
class=
"nav navbar-nav pull-right visible-xs-block"
>
<li><a
data-toggle=
"collapse"
data-target=
"#navbar-mobile"
><i
class=
"icon-tree5"
></i></a></li>
<li><a
data-toggle=
"collapse"
data-target=
"#navbar-mobile"
><i
class=
"icon-tree5"
></i></a></li>
</ul>
</ul>
...
...
templates/includes/plugin.html
View file @
1fcdd69e
{% load static %}
{% load static %}
<ul
class=
"dock"
style=
"right: 0;position: absolute;"
>
<ul
class=
"dock"
style=
"right: 0;position: absolute;"
>
<li
class=
"fixed-plugin"
style=
"top: 100px;"
>
<li
class=
"fixed-plugin"
style=
"top: 50px;"
>
<div
class=
"dropdown show-dropdown"
style=
"top: 1px;"
>
<a
href=
"#"
type=
"checkbox"
>
<input
type=
"checkbox"
name=
"checkbox"
onclick=
"mapsganti()"
id=
"mapschange"
style=
"position: absolute;opacity: 0;width: 48px;height: 30px;"
>
<div
id=
"labelchange"
>
<h1
style=
"color: white;margin-top: 5px;margin-left: 8px;"
>
3D
</h1>
</div>
<!-- <i class="fa fa-map-o fa-2x" style="color: white;
margin: 10px 10px;
width: auto;"> </i> -->
</a>
</div>
</li>
<li
class=
"fixed-plugin no3d"
style=
"top: 110px;"
>
<div
class=
"dropdown show-dropdown"
style=
"top: 1px;"
>
<div
class=
"dropdown show-dropdown"
style=
"top: 1px;"
>
<a
href=
"#"
data-toggle=
"dropdown"
>
<a
href=
"#"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-map-o fa-2x"
style=
"color: white;
<i
class=
"fa fa-map-o fa-2x"
style=
"color: white;
...
@@ -55,9 +73,9 @@
...
@@ -55,9 +73,9 @@
</ul>
</ul>
</div>
</div>
</li>
</li>
<li
class=
"fixed-plugin
"
style=
"top: 16
0px;"
>
<li
class=
"fixed-plugin
no3d"
style=
"top: 17
0px;"
>
<div
class=
"dropdown show-dropdown"
>
<div
class=
"dropdown show-dropdown
"
>
<a
href=
"#"
data-toggle=
"dropdown"
>
<a
href=
"#"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-cog fa-2x"
style=
"font-size: 36px;
<i
class=
"fa fa-cog fa-2x"
style=
"font-size: 36px;
color: white;
color: white;
...
@@ -71,7 +89,6 @@
...
@@ -71,7 +89,6 @@
<div class="panel-body"> -->
<div class="panel-body"> -->
<div
class=
"row"
style=
"margin: 0;padding: 0;"
>
<div
class=
"row"
style=
"margin: 0;padding: 0;"
>
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
id=
"geo_tuplah"
onclick=
"geotuplah()"
style=
"margin-top:2px;"
>
<input
type=
"checkbox"
id=
"geo_tuplah"
onclick=
"geotuplah()"
style=
"margin-top:2px;"
>
...
@@ -79,14 +96,13 @@
...
@@ -79,14 +96,13 @@
</label>
</label>
</div>
</div>
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
id=
"geo_building"
style=
"margin-top:2px;"
>
<input
type=
"checkbox"
id=
"geo_building"
style=
"margin-top:2px;"
>
Bangunan
Bangunan
</label>
</label>
</div>
</div>
<ul
class=
"nasted active"
>
<
!-- <
ul class="nasted active">
<div class="checkbox">
<div class="checkbox">
<label>
<label>
<input type="checkbox" id="2d-maps" style="margin-top:2px;">
<input type="checkbox" id="2d-maps" style="margin-top:2px;">
...
@@ -99,13 +115,7 @@
...
@@ -99,13 +115,7 @@
Bangunan 3D Maps
Bangunan 3D Maps
</label>
</label>
</div>
</div>
</ul>
</ul> -->
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
id=
"geo_jalan"
onclick=
"geojalan()"
style=
"margin-top:2px;"
>
<input
type=
"checkbox"
id=
"geo_jalan"
onclick=
"geojalan()"
style=
"margin-top:2px;"
>
...
...
templates/layout/layout.html
View file @
1fcdd69e
...
@@ -465,7 +465,7 @@
...
@@ -465,7 +465,7 @@
}
}
li
.fixed-plugin
.fa
:hover
{
li
.fixed-plugin
.fa
:hover
{
transform
:
rotate
(
18
0deg
);
transform
:
rotate
(
36
0deg
);
transition
:
all
0.3s
linear
;
transition
:
all
0.3s
linear
;
}
}
/*.move-btn .caret {*/
/*.move-btn .caret {*/
...
@@ -683,10 +683,15 @@
...
@@ -683,10 +683,15 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"col-lg-12"
>
<div
id=
"map"
>
<div
id=
"map"
>
</div>
</div>
<div
id=
"map-cesium"
style=
"z-index: -999; height: 605px; display:none"
></div>
<div
id=
"map-cesium"
style=
"z-index: -999; height: 100vh; display:none"
>
<div
class=
"label-bangunan"
style=
"margin: 0px 0 0px 0px;padding-top: 55px;position: absolute;z-index: 1;right: 20px;"
>
<label
style=
"background-color: white;"
>
left click + ctrl to rotate maps
</label>
</div>
<div
class=
"page_loader_3d"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
templates/layout/user_layout.html
View file @
1fcdd69e
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment