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
701e640b
Commit
701e640b
authored
Sep 30, 2021
by
Manggar Mahardhika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
30/092021 search jadi
parent
4958de4c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2048 additions
and
31 deletions
+2048
-31
API/urls.py
API/urls.py
+4
-1
API/views.py
API/views.py
+325
-1
templates/includes/js-m.html
templates/includes/js-m.html
+3
-10
templates/includes/sidebar.html
templates/includes/sidebar.html
+7
-5
templates/layout/layout.html
templates/layout/layout.html
+1707
-12
templates/user/login.html
templates/user/login.html
+2
-2
No files found.
API/urls.py
View file @
701e640b
...
...
@@ -63,6 +63,9 @@ 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
(
'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
API/views.py
View file @
701e640b
...
...
@@ -2769,4 +2769,328 @@ def createpoint(request):
status
=
1
respon
=
{
'data'
:
data
,
'info'
:
info
,
'status'
:
status
}
return
Response
(
respon
)
\ No newline at end of file
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
templates/includes/js-m.html
View file @
701e640b
...
...
@@ -615,7 +615,6 @@
}
}
$
(
document
).
on
(
"
click
"
,
"
#btn_edit_adm
"
,
function
()
{
var
map_edit
=
L
.
map
(
'
map-for-edit
'
,
{
editable
:
true
,
...
...
@@ -4573,13 +4572,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
()
}
}
...
...
@@ -7277,13 +7273,10 @@
},
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
];
console
.
log
(
data_id
)
console
.
log
(
data_po
)
var
data_kab
=
`<option value="`
+
data_id
+
`">`
+
data_po
+
`</option>`
;
data_all_kab
.
push
(
data_kab
)
};
...
...
@@ -7302,9 +7295,9 @@
}
var
map_edit
=
new
L
.
map
(
'
map-edit
'
,
{
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
}).
setView
([
-
2
,
118
],
5
);
mapss
=
L
.
tileLayer
(
'
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
'
,
{
...
...
templates/includes/sidebar.html
View file @
701e640b
...
...
@@ -29,11 +29,7 @@
<i
class=
"icon-pie-chart5"
></i>
</a>
</li>
<li
style=
"margin-top: 400px;position: absolute;"
>
<a
href=
"#"
id=
"btn-hide-all"
class=
"side-bar-but"
style=
"position: absolute;margin-top: 20px;"
>
<i
class=
"icon-arrow-right13"
></i>
</a>
</li>
</ul>
...
...
@@ -49,6 +45,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>
...
...
templates/layout/layout.html
View file @
701e640b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
templates/user/login.html
View file @
701e640b
...
...
@@ -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: 3
6%; width:1028
px; "
>
<img
src=
"../../static/img/indonesia-ter.PNG"
alt=
"Image"
style=
"margin-top: 4%; margin-bottom: 3%; margin-left: 3
8%; width:920
px; "
>
<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>
...
...
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