Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
df-aggregator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Oleksandr Barabash
df-aggregator
Commits
9787e0bc
Commit
9787e0bc
authored
Nov 02, 2020
by
Corey Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started working on WebGUI
parent
cca17660
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
3 deletions
+108
-3
df-aggregator.py
df-aggregator.py
+10
-3
cesium.tpl
views/cesium.tpl
+40
-0
index.tpl
views/index.tpl
+32
-0
webgui.py
webgui.py
+26
-0
No files found.
df-aggregator.py
View file @
9787e0bc
...
...
@@ -5,6 +5,8 @@ import numpy as np
import
math
import
time
import
sqlite3
import
threading
import
webgui
from
optparse
import
OptionParser
from
os
import
system
,
name
from
lxml
import
etree
...
...
@@ -54,7 +56,6 @@ class receiver:
self
.
confidence
=
int
(
xml_conf
.
text
)
except
:
print
(
"Problem connecting to receiver."
)
pass
latitude
=
0.0
longitude
=
0.0
...
...
@@ -203,6 +204,10 @@ def clear():
_
=
system
(
'clear'
)
if
__name__
==
'__main__'
:
ipaddr
=
"127.0.0.1"
# web = threading.Thread(target=webgui.start_server,)
# web.daemon = True
# web.start()
usage
=
"usage:
%
prog [options]"
parser
=
OptionParser
(
usage
=
usage
)
parser
.
add_option
(
"-g"
,
"--geofile"
,
dest
=
"geofile"
,
help
=
"GeoJSON Output File"
,
metavar
=
"FILE"
)
...
...
@@ -252,7 +257,9 @@ if __name__ == '__main__':
avg_list
=
[]
average_intersects
=
np
.
array
([])
.
reshape
(
0
,
2
)
while
True
:
receiving
=
True
while
receiving
:
print
(
"Receiving"
+
dots
*
'.'
)
print
(
"Press Control+C to process data and exit."
)
intersect_list
=
np
.
array
([])
.
reshape
(
0
,
3
)
...
...
@@ -314,5 +321,5 @@ if __name__ == '__main__':
conn
.
commit
()
conn
.
close
()
process_data
(
database_name
,
geofile
,
eps
,
min_samp
)
# web.join()
quit
()
views/cesium.tpl
0 → 100644
View file @
9787e0bc
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<!-- Include the CesiumJS JavaScript and CSS files -->
<script
src=
"https://cesium.com/downloads/cesiumjs/releases/1.75/Build/Cesium/Cesium.js"
></script>
<link
href=
"https://cesium.com/downloads/cesiumjs/releases/1.75/Build/Cesium/Widgets/widgets.css"
rel=
"stylesheet"
>
</head>
<body>
<div
id=
"cesiumContainer"
></div>
<script>
// Your access token can be found at: https://cesium.com/ion/tokens.
Cesium
.
Ion
.
defaultAccessToken
=
'{
{
access_token
}
}'
;
// Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID.
// const viewer = new Cesium.Viewer('cesiumContainer', {
// terrainProvider: Cesium.createWorldTerrain()
// });
var
viewer
=
new
Cesium
.
Viewer
(
'cesiumContainer'
,
{
terrainProvider
:
Cesium
.
createWorldTerrain
()
});
viewer
.
dataSources
.
add
(
Cesium
.
GeoJsonDataSource
.
load
(
'/static/dc_med.geojson'
,
{
clampToGround
:
true
,
markerColor
:
Cesium
.
Color
.
GREEN
,
markerSymbol
:
''
}));
// Add Cesium OSM Buildings, a global 3D buildings layer.
const
buildingTileset
=
viewer
.
scene
.
primitives
.
add
(
Cesium
.
createOsmBuildings
());
// Fly the camera to San Francisco at the given longitude, latitude, and height.
// viewer.camera.flyTo({
// destination : Cesium.Cartesian3.fromDegrees(-122.4175, 37.655, 400),
// orientation : {
// heading : Cesium.Math.toRadians(0.0),
// pitch : Cesium.Math.toRadians(-15.0),
// }
// });
</script>
</div>
</body>
</html>
views/index.tpl
0 → 100644
View file @
9787e0bc
<!DOCTYPE html>
<html>
<head>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity=
"sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=
""
/>
<script
src=
"https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity=
"sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=
""
></script>
</head>
<body>
<p>
Test
</p>
<div
style=
"height: 700px"
id=
"map"
></div>
<script>
// initialize Leaflet
var
map
=
L
.
map
(
'map'
).
setView
(
{
lon
:
-
76.3
,
lat
:
39.1
}
,
8
);
// add the OpenStreetMap tiles
L
.
tileLayer
(
'https://
{
s
}
.tile.openstreetmap.org/
{
z
}
/
{
x
}
/
{
y
}
.png'
,
{
maxZoom
:
19
,
attribution
:
'© <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
}).
addTo
(
map
);
// show the scale bar on the lower left corner
L
.
control
.
scale
().
addTo
(
map
);
</script>
</body>
</html>
webgui.py
0 → 100644
View file @
9787e0bc
from
bottle
import
route
,
run
,
request
,
get
,
post
,
redirect
,
template
,
static_file
ipaddr
=
"127.0.0.1"
with
open
(
'accesstoken.txt'
,
"r"
)
as
tokenfile
:
access_token
=
tokenfile
.
read
()
.
replace
(
'
\n
'
,
''
)
@route
(
'/static/<filepath:path>'
,
name
=
'static'
)
def
server_static
(
filepath
):
return
static_file
(
filepath
,
root
=
'./static'
)
@get
(
'/'
)
@get
(
'/index'
)
def
hello
():
return
template
(
'index.tpl'
)
@get
(
'/cesium'
)
def
cesium
():
return
template
(
'cesium.tpl'
,
{
'access_token'
:
access_token
})
def
start_server
():
run
(
host
=
ipaddr
,
port
=
8080
,
quiet
=
True
,
debug
=
False
,
server
=
'paste'
)
if
__name__
==
'__main__'
:
start_server
()
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