Commit ced77bc2 authored by Muhamad's avatar Muhamad

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

# Conflicts:
#	Application/__pycache__/views.cpython-37.pyc
parents 1e8a32e3 b0cc89be
......@@ -55,6 +55,7 @@ urlpatterns = [
path('c_bangunan', views.createbang, name='c_bangunan'),
path('create-jalan', views.createjalan, name='create-jalan'),
path('create-point', views.createpoint, name='create-point'),
path('c_lahan', views.createlahan, name='c_lahan'),
path('edit-tuplah', login_required(views.edittuplah), name='edit-tuplah'),
path('edit-tuplah-valid', views.edittuplahvalid, name='edit-tuplah-valid'),
......
......@@ -60,9 +60,25 @@ def search_auto(request):
def tuplah(request):
with conn.cursor() as desa:
desa.execute(f"SELECT json_build_object('type', 'Feature', 'legend', (a.id, a.legenda, st_area(a.geom::geography), a.gambar) ,'geometry', ST_AsGeoJSON( st_intersection(a.geom, b.geom):: geometry) :: json) from geo_tuplah a, geo_prov_kab b where b.kabupaten = 'OGAN KOMERING ULU'")
all = desa.fetchall()
desa.execute(f"""SELECT
json_build_object (
'type',
'Feature',
'legend',
( A.ID, A.legenda, st_area ( A.geom :: geography ), A.gambar ),
'geometry',
ST_AsGeoJSON ( st_intersection ( A.geom, b.geom ) :: geometry ) :: json
)
FROM
geo_tuplah A,
geo_prov_kab b
WHERE
b.kabupaten = 'OGAN KOMERING ULU'""")
all = desa.fetchall()
ltup = []
for i in all:
i[0]['legend']['f3'] = '{0:,.2f}'.format(i[0]['legend']['f3'])
ltup.append(i[0])
data = {'tuplah':all}
return Response(data)
......@@ -2526,6 +2542,45 @@ def upload_tampak(request):
return Response(respon)
@api_view(('GET',))
def createlahan(request):
poly_create = request.GET.get('polygon')
p_create = poly_create.replace('"','')
po_create = p_create.replace(', ','],[')
name = request.GET.get('name')
tipelh = request.GET.get('tipelh')
tahun = request.GET.get('tahun')
luas = request.GET.get('luas')
obid = 666
provinsi = "Sumatera Selatan"
gambar = "NONE"
latlng = po_create.split("],[")[0]
print(p_create)
print(latlng)
if name == "":
name = "Sumatera Selatan"
else:
name = name
with conn.cursor() as lahan:
lahan.execute("""INSERT INTO geo_tuplah(geom, objectid_1, name, provinsi, pl_19_r, legenda, gambar) VALUES (ST_GeomFromEWKT('SRID=4326;MULTIPOLYGON(((%s)))'), '%s', '%s', '%s', '%s', '%s', '%s')"""% (p_create, obid, name, provinsi, tahun, tipelh, gambar))
conn.commit()
data = {'status':'Success'}
data = 'SUCCESS'
info = 'data telah diperbaharui'
status = 0
# except:
# data = 'Sorry'
# info = 'Dalam Perbaikan'
# status = 1
respon={'data':data, 'info': info, 'status':status}
return Response(respon)
import re
@api_view(('POST',))
......@@ -3122,20 +3177,6 @@ def search_spes(request):
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,
......@@ -3192,7 +3233,7 @@ def search_spes(request):
WHERE
a.namobj ILIKE '%{}%'
LIMIT 10
""".format(inp, inp, inp, inp, inp, inp, inp, inp, inp, inp, inp))
""".format(inp, inp, inp, inp, inp, inp, inp, inp, inp, inp))
s_point = search_point.fetchall()
kill = s_point
elif tipe == ' Bangunan':
......
......@@ -816,6 +816,22 @@ input#change_stat {
border-top: 20px solid white;
}
#create,
#create-jal {
border: transparent;
border-radius: 5px;
margin: 10px;
}
#map-create-all>div.leaflet-control-container>div.leaflet-top.leaflet-left>div:nth-child(1)>div>div>a.leaflet-draw-draw-marker {
width: 100%!important;
padding: 0px!important;
}
#informasi_create>div {
margin: 10px;
}
@media (max-width: 1025px) {
.dock {
position: absolute;
......
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 23L4 25V7L12 5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M20 27L12 23V5L20 9V27Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M20 9L28 7V25L20 27" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.75 18.6875L3.25 20.3125V5.6875L9.75 4.0625" stroke="#E86250" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.25 21.9375L9.75 18.6875V4.0625L16.25 7.3125V21.9375Z" stroke="#E86250" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.25 7.3125L22.75 5.6875V20.3125L16.25 21.9375" stroke="#E86250" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
......@@ -24,14 +24,18 @@ $("#sidebar").hide()
maps = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', { id: 'mapbox/light-v9', tileSize: 512, zoomOffset: -1 }).addTo(map);
OpenStreetMap.onclick = function() {
maps = L.tileLayer("https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&s=Gal&apistyle=s.t:0|s.e:l|p.v:off", {
map.removeLayer(maps)
//maps = L.tileLayer("https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&s=Gal&apistyle=s.t:0|s.e:l|p.v:off", {
maps = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
maxZoom: 22,
minZoom: 3,
}).addTo(map);
};
WorldImagery.onclick = function() {
// https://{s}.tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png
map.removeLayer(maps)
// https://{s}.tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png
maps = L.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", {
maxZoom: 22,
minZoom: 3,
......@@ -39,6 +43,7 @@ WorldImagery.onclick = function() {
};
BingSatellite.onclick = function() {
map.removeLayer(maps)
maps = L.tileLayer.bing({ bingMapsKey: BING_KEY, maxNativeZoom: 22 }).addTo(map);
setTimeout(function() {
$('.leaflet-bottom.leaflet-right>.leaflet-control-attribution.leaflet-control').html(`Powered by <a href="https://khansia.co.id" target="_blank">Khansia</a> with <a href="https://leafletjs.com" target="_blank">Leaflet</a>`)
......@@ -48,6 +53,7 @@ BingSatellite.onclick = function() {
GoogleSatellite.onclick = function() {
map.removeLayer(maps)
maps = L.tileLayer('http://mt0.google.com/vt/lyrs=y&hl=en&x={x}&y={y}&z={z}&s=Gal&apistyle=s.t:0|s.e:l|p.v:off', {
maxZoom: 22,
minZoom: 4,
......
This diff is collapsed.
This diff is collapsed.
......@@ -268,6 +268,10 @@
</div>
<div id="input_perbaikan_bang-s" class="modal fade">
</div>
<!-- modal tuplah -->
<div id="modal-edit-tuplah" class="modal fade">
<div class="modal-dialog" style="width: max-content;height: max-content;">
......@@ -291,7 +295,23 @@
<table>
<tr>
<th>
Image
Luas &nbsp;
</th>
<td>
<input id="luas_tuplah_edit" type="text" class="form-control" value="" style="width:fit-content;" disabled>
</td>
</tr>
<tr>
<th>
&nbsp;
</th>
<td>
&nbsp;
</td>
</tr>
<tr>
<th>
Image &nbsp;
</th>
<td>
<input type="file" id="imgtuplah" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
......@@ -324,8 +344,8 @@
<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">&times;</button>
<h4 class="modal-title">3D Searching</h4>
<button type="button" class="close" style="color: white;" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" style="color: white;">3D Searching</h4>
</div>
<div class="modal-body">
<fieldset>
......@@ -625,7 +645,7 @@
<div class="col-md-4 text-center">
<a href="#" class="btn btn_create_lahan">
<div>
<img src="{% static 'img/icon-1/Vectorpoint.svg' %}" alt="" style="width: 35px;
<img src="{% static 'img/icon-1/SquareHalflahan.svg' %}" alt="" style="width: 35px;
height: 35px;">
</div>
<div style="margin-top: 10px;">
......@@ -636,7 +656,7 @@
<div class="col-md-4 text-center">
<a href="#" class="btn btn_cek_KDBKLB">
<div>
<img src="{% static 'img/icon-1/Vectorpoint.svg' %}" alt="" style="width: 35px;
<img src="{% static 'img/icon-1/kelurahan.svg' %}" alt="" style="width: 35px;
height: 35px;">
</div>
<div style="margin-top: 10px;">
......@@ -662,8 +682,8 @@
<div class="modal-body" id="create_all">
<div class="tabbable" style="height:450px!important;width: 560px!important;">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href=".koordinatjalan" data-toggle="tab" class="tab_1">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#informasi_create" data-toggle="tab" class="tab_2">Informasi Jalan</a></li>
<li onclick="changetabs(this)" id="tab_koor" class="active"><a href=".koordinatjalan" data-toggle="tab" class="tab_1">Koordinat</a></li>
<li onclick="changetabs(this)" id="tab_info"><a href="#informasi_create" data-toggle="tab" id="informasi_poo" class="tab_2">Informasi Jalan</a></li>
</ul>
<div class="tab-content">
......@@ -852,10 +872,7 @@
</div>
<div style="border-bottom: 1pt solid #E2E2E2;">
<div class="tab_personal_information" style="margin:0px;">
<div class="alert alert-danger" id="notificationsprop" style="display: none;margin: 0px;
padding-top: 0px;
padding-bottom: 0px;">
<div class="alert alert-danger" id="notificationsprop" style="display: none;margin: 0px;padding-top: 0px;padding-bottom: 0px;">
</div>
<form class="form-horizontal" id="formmen" method="post" enctype="multipart/form-data">
<div class="panel-body">
......
......@@ -8,7 +8,6 @@
<div id="labelchange">
<img src="{% static 'img/icon-1/Vector3d.svg' %}" alt="" style="height: 50px;
width: 50px;">
</div>
</a>
</div>
......
......@@ -29,14 +29,14 @@
</a>
</li>
<li style="margin-top: 60vh;position: absolute;">
<a href="#" id="btn-hide-all" class="side-bar-but" style="position: absolute;margin-top: 20px; display: block!important;">
<i class="icon-arrow-right13"></i>
<a href="#" id="btn-hide-all" class="side-bar-but" style="position: absolute; margin-top: 0px; display: none;">
<i class="icon-arrow-left12"></i>
</a>
</li>
</ul>
<ul class="navigation navigation-main navigation-accordion">
<ul class="navigation navigation-main navigation-accordion" style="height: 100px;">
<li>
<a href="#" class="side-bar-but" data-toggle="modal" data-target="#modal_help" data-backdrop="static" data-keyboard="false">
<img src="{% static 'img/icon-1/Vectoriconwarning.svg' %}" alt="" style="height: 17.875003814697266px;width: 17.875003814697266px;margin-left: -8px;">
......@@ -1170,7 +1170,7 @@
$("#manage_perbaikan").removeClass("active");
$("#panel-sm").removeClass("active");
$("#panel-sm2").removeClass("active");
$(this).css('display', 'none');
$(this).removeClass("hid");
});
......@@ -1179,7 +1179,7 @@
$("#manage_perbaikan").removeClass("active");
$("#panel-sm").removeClass("active");
$("#panel-sm2").removeClass("active");
$(this).css('display', 'none');
$(this).removeClass("hid");
};
......
This diff is collapsed.
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