Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
590f0ff254 |
No files matched your search
@@ -1,4 +1 @@
|
|||||||
* text=auto !eol
|
* text=auto !eol
|
||||||
/mapkey.js -text
|
|
||||||
/mapkey_yearly.js -text
|
|
||||||
/quakes2kml.py -text
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/*.kml
|
|
||||||
+10
-12
@@ -4,6 +4,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
||||||
<title>RUB SeisObs - Station and Seismicity Map</title>
|
<title>RUB SeisObs - Station and Seismicity Map</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
html, body, #map {
|
html, body, #map {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -17,7 +20,7 @@
|
|||||||
bottom: 1em;
|
bottom: 1em;
|
||||||
left: 1em;
|
left: 1em;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
z-index: 15000;
|
z-index: 20000;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 0 0.5em 0.5em 0.5em;
|
padding: 0 0.5em 0.5em 0.5em;
|
||||||
}
|
}
|
||||||
@@ -26,17 +29,14 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 18px;
|
top: 18px;
|
||||||
left: 80px;
|
left: 80px;
|
||||||
width: 420px;
|
width: 320px;
|
||||||
height: 80px;
|
height: 34px;
|
||||||
z-index: 20000;
|
z-index: 20000;
|
||||||
background: rgb(255, 255, 255);
|
background: rgb(255, 255, 255);
|
||||||
background: rgba(255, 255, 255, 0.7);
|
background: rgba(255, 255, 255, 0.7);
|
||||||
padding: 0px 0px 0px 0px;
|
padding: 0px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.olControlAttribution {
|
.olControlAttribution {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type='text/javascript' src='OpenLayers.js'></script>
|
<script type='text/javascript' src='OpenLayers.js'></script>
|
||||||
<script type='text/javascript' src='https://maps.google.com/maps/api/js?sensor=false&v=3'></script>
|
<script type='text/javascript' src='https://maps.google.com/maps/api/js?sensor=false&v=3.9'></script>
|
||||||
<script type='text/javascript' src='station_map_www.js'></script>
|
<script type='text/javascript' src='station_map_www.js'></script>
|
||||||
<script type='text/javascript' src='mapkey.js'></script>
|
<script type='text/javascript' src='mapkey.js'></script>
|
||||||
<script type='text/javascript' src='lang/de.js'></script>
|
<script type='text/javascript' src='lang/de.js'></script>
|
||||||
@@ -71,20 +71,18 @@
|
|||||||
'Google Maps (Terrain)': 'Google Maps (Gelände)',
|
'Google Maps (Terrain)': 'Google Maps (Gelände)',
|
||||||
'Google Maps (Satellite)': 'Google Maps (Satellit)',
|
'Google Maps (Satellite)': 'Google Maps (Satellit)',
|
||||||
'Google Maps (Streets)': 'Google Maps (Straßen)',
|
'Google Maps (Streets)': 'Google Maps (Straßen)',
|
||||||
'Year': 'Jahr',
|
|
||||||
'Magnitudes': 'Magnituden',
|
'Magnitudes': 'Magnituden',
|
||||||
'Magnitude': 'Magnitude',
|
|
||||||
'stations': 'Stationen',
|
'stations': 'Stationen',
|
||||||
'Zoom in to resolve individual stations.': 'Zum Anzeigen der einzelnen Stationen vergrößern.'
|
'Zoom in to resolve individual stations.': 'Zum Anzeigen der einzelnen Stationen vergrößern.'
|
||||||
});
|
});
|
||||||
OpenLayers.Lang.setCode(document.documentElement.lang);
|
OpenLayers.Lang.setCode(document.documentElement.lang);
|
||||||
</script>
|
</script>
|
||||||
<div id="map">
|
|
||||||
<script type='text/javascript'>init(true, true, true, false);</script>
|
|
||||||
</div>
|
|
||||||
<div id="mapkey">
|
<div id="mapkey">
|
||||||
<script type='text/javascript'>initKey(true, false, false);</script>
|
<script type='text/javascript'>initKey(true, false, false);</script>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="map">
|
||||||
|
<script type='text/javascript'>init(true, true, false, false);</script>
|
||||||
|
</div>
|
||||||
<!-- <div id="maptext">
|
<!-- <div id="maptext">
|
||||||
<h3 id="title">Stations</h3>
|
<h3 id="title">Stations</h3>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
/*
|
|
||||||
* JavaScript code to generate maps used by the
|
|
||||||
* Seismological Observatory of the Ruhr-University Bochum
|
|
||||||
*
|
|
||||||
* Copyright 2012 Kasper D. Fischer <kasper.fischer@rub.de>
|
|
||||||
*
|
|
||||||
* License
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or (at
|
|
||||||
* your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
||||||
*
|
|
||||||
* $Id: station_map.js 321 2012-02-13 14:52:11Z kasper $
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Global variables */
|
|
||||||
var mapkey;
|
|
||||||
|
|
||||||
/* Main function to create the map */
|
|
||||||
function initKey(showMag, showAge, showStation) {
|
|
||||||
|
|
||||||
/* Creating map */
|
|
||||||
wgs84 = new OpenLayers.Projection("EPSG:4326");
|
|
||||||
mapkey = new OpenLayers.Map(
|
|
||||||
'mapkey',
|
|
||||||
{
|
|
||||||
projection: wgs84,
|
|
||||||
displayProjection: wgs84,
|
|
||||||
controls: []
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Show Magnitudes
|
|
||||||
mag_layer = new OpenLayers.Layer.Vector(
|
|
||||||
'Magnitude Scale',
|
|
||||||
{
|
|
||||||
projection: wgs84,
|
|
||||||
isBaseLayer: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Adding custom style for Magnitudes
|
|
||||||
var mag_style_default = new OpenLayers.Style({
|
|
||||||
fillColor: '#ff0000', fillOpacity: 0.2,
|
|
||||||
strokeColor: '#ff0000', strokeWidth: 2,
|
|
||||||
pointRadius: "${pntsize}",
|
|
||||||
label: "${text}", labelXOffset: "${offset}",
|
|
||||||
graphicName: 'circle'
|
|
||||||
});
|
|
||||||
var mag_style_map = new OpenLayers.StyleMap({
|
|
||||||
'default': mag_style_default
|
|
||||||
});
|
|
||||||
mag_layer.styleMap = mag_style_map;
|
|
||||||
|
|
||||||
// Adding points as map key, size: mag*3.5+2.0
|
|
||||||
var pointt = new OpenLayers.Geometry.Point(-10, 0);
|
|
||||||
var mag_pointt = new OpenLayers.Feature.Vector(pointt, {pntsize: 0, text: 'Magnitude', offset: 2});
|
|
||||||
var point0 = new OpenLayers.Geometry.Point(0, 0);
|
|
||||||
var mag_point0 = new OpenLayers.Feature.Vector(point0, {pntsize: 0.5*3.5+2.0, text: '0.5', offset: 17});
|
|
||||||
var point1 = new OpenLayers.Geometry.Point(10, 0);
|
|
||||||
var mag_point1 = new OpenLayers.Feature.Vector(point1, {pntsize: 1.5*3.5+2.0, text: '1.5', offset: 20.5});
|
|
||||||
var point2 = new OpenLayers.Geometry.Point(20, 0);
|
|
||||||
var mag_point2 = new OpenLayers.Feature.Vector(point2, {pntsize: 2.5*3.5+2.0, text: '2.5', offset: 24.0});
|
|
||||||
var point3 = new OpenLayers.Geometry.Point(30, 0);
|
|
||||||
var mag_point3 = new OpenLayers.Feature.Vector(point3, {pntsize: 3.5*3.5+2.0, text: '3.5', offset: 27.5});
|
|
||||||
mag_layer.addFeatures([mag_pointt, mag_point0, mag_point1, mag_point2, mag_point3]);
|
|
||||||
|
|
||||||
|
|
||||||
mapkey.addLayer(mag_layer);
|
|
||||||
mag_layer.setVisibility(true);
|
|
||||||
|
|
||||||
// Set initial view
|
|
||||||
if (!mapkey.getCenter()) {
|
|
||||||
mapkey.setCenter(0,0);
|
|
||||||
mapkey.zoomToExtent(mag_layer.getDataExtent());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
mapkey.js
|
|
||||||
-90
@@ -1,90 +0,0 @@
|
|||||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
|
|
||||||
<!-- $Id$ -->
|
|
||||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
|
||||||
<title>RUB SeisObs - Station and Seismicity Map</title>
|
|
||||||
<style type="text/css">
|
|
||||||
html, body, #map {
|
|
||||||
margin: 0;
|
|
||||||
width: 1440px;
|
|
||||||
height: 900px;
|
|
||||||
z-index: 10000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#maptext {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 1em;
|
|
||||||
left: 1em;
|
|
||||||
width: 20%;
|
|
||||||
z-index: 15000;
|
|
||||||
background-color: white;
|
|
||||||
padding: 0 0.5em 0.5em 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mapkey {
|
|
||||||
position: absolute;
|
|
||||||
top: 18px;
|
|
||||||
left: 80px;
|
|
||||||
width: 320px;
|
|
||||||
height: 34px;
|
|
||||||
z-index: 20000;
|
|
||||||
background: rgb(255, 255, 255);
|
|
||||||
background: rgba(255, 255, 255, 0.7);
|
|
||||||
padding: 0px 0px 0px 0px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<style type="text/css">
|
|
||||||
.olControlAttribution {
|
|
||||||
position: absolute;
|
|
||||||
font-size: 10px;
|
|
||||||
text-align: left;
|
|
||||||
color: #eeeeee;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right:auto !important;
|
|
||||||
background: #130085; /* fallback for IE - IE6 requires background shorthand*/
|
|
||||||
background: rgba(0, 60, 136, 0.3);
|
|
||||||
filter: alpha(opacity=30);
|
|
||||||
font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
|
|
||||||
border-radius: 5px 0 0 0;
|
|
||||||
}
|
|
||||||
.olControlAttribution a {
|
|
||||||
color: #eeeeee;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type='text/javascript' src='OpenLayers.js'></script>
|
|
||||||
<script type='text/javascript' src='https://maps.google.com/maps/api/js?sensor=false&v=3'></script>
|
|
||||||
<script type='text/javascript' src='station_map_www.js'></script>
|
|
||||||
<script type='text/javascript' src='mapkey.js'></script>
|
|
||||||
<script type='text/javascript' src='lang/de.js'></script>
|
|
||||||
<script type='text/javascript'>
|
|
||||||
OpenLayers.Util.extend(OpenLayers.Lang.de, {
|
|
||||||
'Overlays' : 'Ebenen',
|
|
||||||
'Stations' : 'Stationen',
|
|
||||||
'Events': 'Ereignisse',
|
|
||||||
'Grid': 'Gitter',
|
|
||||||
'Google Maps (Terrain)': 'Google Maps (Gelände)',
|
|
||||||
'Google Maps (Satellite)': 'Google Maps (Satellit)',
|
|
||||||
'Google Maps (Streets)': 'Google Maps (Straßen)',
|
|
||||||
'Magnitudes': 'Magnituden',
|
|
||||||
'stations': 'Stationen',
|
|
||||||
'Zoom in to resolve individual stations.': 'Zum Anzeigen der einzelnen Stationen vergrößern.'
|
|
||||||
});
|
|
||||||
OpenLayers.Lang.setCode(document.documentElement.lang);
|
|
||||||
</script>
|
|
||||||
<div id="map">
|
|
||||||
<script type='text/javascript'>init(true, true, true, true);</script>
|
|
||||||
</div>
|
|
||||||
<div id="mapkey">
|
|
||||||
<script type='text/javascript'>initKey(true, false, false);</script>
|
|
||||||
</div>
|
|
||||||
<!-- <div id="maptext">
|
|
||||||
<h3 id="title">Stations</h3>
|
|
||||||
</div> -->
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
#! /usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Creates KML file with station info.
|
|
||||||
|
|
||||||
License
|
|
||||||
Copyright 2012 Kasper D. Fischer <kasper.fischer@rub.de>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by the Free
|
|
||||||
Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but
|
|
||||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
||||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along
|
|
||||||
with this program. If not, see http://www.gnu.org/licenses/.
|
|
||||||
|
|
||||||
$Id: stations.py 311 2012-01-31 14:34:31Z kasper $
|
|
||||||
"""
|
|
||||||
|
|
||||||
import csv, os, shutil, sys
|
|
||||||
import simplekml
|
|
||||||
from obspy.core import UTCDateTime
|
|
||||||
|
|
||||||
# create new empty KML file
|
|
||||||
kml = simplekml.Kml()
|
|
||||||
|
|
||||||
# create empyt folder to contain styles and stations
|
|
||||||
quakes_folder = kml.newfolder(name="Earthquakes")
|
|
||||||
|
|
||||||
# style of broad-band stations
|
|
||||||
quake1m_style = simplekml.Style()
|
|
||||||
quake1m_style.iconstyle.color = 'ff0000ff'
|
|
||||||
quake1m_style.iconstyle.icon.href = 'circle'
|
|
||||||
|
|
||||||
# style of short periode stations
|
|
||||||
quake1y_style = simplekml.Style()
|
|
||||||
quake1y_style.iconstyle.color = 'ffff00ff'
|
|
||||||
|
|
||||||
# style of short periode stations
|
|
||||||
quakeAll_style = simplekml.Style()
|
|
||||||
quakeAll_style.iconstyle.color = 'ff00ffff'
|
|
||||||
|
|
||||||
# reading earthquake list
|
|
||||||
events = []
|
|
||||||
num_header = 0
|
|
||||||
with open('quakes.txt', 'rb') as f:
|
|
||||||
reader = csv.reader(f, delimiter='\t')
|
|
||||||
try:
|
|
||||||
for row in reader:
|
|
||||||
if ( reader.line_num <= num_header ):
|
|
||||||
header = row
|
|
||||||
else:
|
|
||||||
events.append(row)
|
|
||||||
except csv.Error, e:
|
|
||||||
sys.exit('file {0}, line {1}: {2}'.format('quakes.txt', reader.line_num, e))
|
|
||||||
|
|
||||||
# adding station markers
|
|
||||||
for event in events:
|
|
||||||
eventTime = UTCDateTime(event[0]+' '+event[1])
|
|
||||||
nowTime = UTCDateTime()
|
|
||||||
lat = event[2]
|
|
||||||
lon = event[3]
|
|
||||||
mag = event[4]
|
|
||||||
region = event[5]
|
|
||||||
|
|
||||||
pnt = quakes_folder.newpoint(
|
|
||||||
name = region,
|
|
||||||
coords = [(lon, lat)],
|
|
||||||
description = "<p>Magnitude {0}<br>Time {1}<br>Location {2}N {3}E</p>".format(
|
|
||||||
mag, eventTime.strftime('%Y-%m-%d %H:%M:%S'), lat, lon)
|
|
||||||
)
|
|
||||||
pnt.extendeddata.newdata('mag', mag)
|
|
||||||
pnt.extendeddata.newdata('lat', lat)
|
|
||||||
pnt.extendeddata.newdata('lon', lon)
|
|
||||||
pnt.extendeddata.newdata('time', eventTime.strftime('%Y-%m-%d %H:%M:%S'))
|
|
||||||
pnt.extendeddata.newdata('age', nowTime-eventTime)
|
|
||||||
pnt.extendeddata.newdata('pntsize', float(mag)*3.5+2)
|
|
||||||
if (( nowTime - eventTime ) > 60*60*24*30 ):
|
|
||||||
pnt.extendeddata.newdata('pntcolor', '#ffa500')
|
|
||||||
pnt.style = quake1y_style
|
|
||||||
elif (( nowTime - eventTime ) > 60*60*24*365 ):
|
|
||||||
pnt.extendeddata.newdata('pntcolor', '#ffff00')
|
|
||||||
pnt.style = quakeAll_style
|
|
||||||
else:
|
|
||||||
pnt.extendeddata.newdata('pntcolor', '#ff0000')
|
|
||||||
pnt.style = quake1m_style
|
|
||||||
|
|
||||||
|
|
||||||
# saving the KML file
|
|
||||||
kml.save('quakes.kml')
|
|
||||||
+16
-124
@@ -24,35 +24,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
var map, mapargs;
|
var map;
|
||||||
|
|
||||||
/* Main function to create the map */
|
/* Main function to create the map */
|
||||||
function init(showGoogle, showStations, showQuakes, noFrils) {
|
function init(showGoogle, showStations, showQuakes, noFrils) {
|
||||||
|
|
||||||
/* get parameters from url */
|
|
||||||
mapargs = OpenLayers.Util.getParameters();
|
|
||||||
if (mapargs['print']) {
|
|
||||||
if (mapargs['print'] == 'true') {
|
|
||||||
noFrils = true;
|
|
||||||
} else {
|
|
||||||
noFrils = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mapargs['quakes']) {
|
|
||||||
if (mapargs['quakes'] == 'true') {
|
|
||||||
showQuakes = true;
|
|
||||||
} else {
|
|
||||||
showQuakes = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mapargs['stations']) {
|
|
||||||
if (mapargs['stations'] == 'true') {
|
|
||||||
showStations = true;
|
|
||||||
} else {
|
|
||||||
showStations = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Creating map */
|
/* Creating map */
|
||||||
if ( !noFrils ) {
|
if ( !noFrils ) {
|
||||||
map = new OpenLayers.Map(
|
map = new OpenLayers.Map(
|
||||||
@@ -68,7 +44,7 @@ function init(showGoogle, showStations, showQuakes, noFrils) {
|
|||||||
new OpenLayers.Control.Navigation(),
|
new OpenLayers.Control.Navigation(),
|
||||||
new OpenLayers.Control.OverviewMap(),
|
new OpenLayers.Control.OverviewMap(),
|
||||||
new OpenLayers.Control.PanZoomBar({zoomWorldIcon: true}),
|
new OpenLayers.Control.PanZoomBar({zoomWorldIcon: true}),
|
||||||
new OpenLayers.Control.Permalink({anchor: noFrils}),
|
new OpenLayers.Control.Permalink(),
|
||||||
new OpenLayers.Control.ScaleLine({geodesic: true})
|
new OpenLayers.Control.ScaleLine({geodesic: true})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -83,7 +59,7 @@ function init(showGoogle, showStations, showQuakes, noFrils) {
|
|||||||
new OpenLayers.Control.Attribution(),
|
new OpenLayers.Control.Attribution(),
|
||||||
new OpenLayers.Control.KeyboardDefaults(),
|
new OpenLayers.Control.KeyboardDefaults(),
|
||||||
new OpenLayers.Control.Navigation(),
|
new OpenLayers.Control.Navigation(),
|
||||||
new OpenLayers.Control.Permalink({anchor: noFrils}),
|
new OpenLayers.Control.Permalink({anchor: true}),
|
||||||
new OpenLayers.Control.ScaleLine({geodesic: true})
|
new OpenLayers.Control.ScaleLine({geodesic: true})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -95,13 +71,13 @@ function init(showGoogle, showStations, showQuakes, noFrils) {
|
|||||||
var osmde_map_layer = new OpenLayers.Layer.OSM(
|
var osmde_map_layer = new OpenLayers.Layer.OSM(
|
||||||
'OpenStreetMap (DE)',
|
'OpenStreetMap (DE)',
|
||||||
[
|
[
|
||||||
"http://a.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png",
|
"https://a.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png",
|
||||||
"http://b.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png",
|
"https://b.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png",
|
||||||
"http://c.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png"
|
"https://c.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png"
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
attribution: 'Kartenbasis: Daten von <a href="http://www.openstreetmap.org/">OpenStreetMap</a> - Veröffentlicht unter <a href="http://opendatacommons.org/licenses/odbl/">ODbL</a><br />' +
|
attribution: 'Geobasisdaten: Copyright © 2013 <a href="http://www.openstreetmap.org/">OpenStreetMap</a> und Mitwirkende;' +
|
||||||
'Seismische Daten von <a href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs">Ruhr-Universität Bochum</a> - Veröffentlicht unter <a href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>'
|
'Lizenz: <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons BY-SA 2.0.</a>'
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
var osm_map_layer = new OpenLayers.Layer.OSM('OpenStreetMap (Standard)');
|
var osm_map_layer = new OpenLayers.Layer.OSM('OpenStreetMap (Standard)');
|
||||||
@@ -136,24 +112,8 @@ function init(showGoogle, showStations, showQuakes, noFrils) {
|
|||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
// OpenMapQuest
|
|
||||||
var omq_map_layer = new OpenLayers.Layer.OSM(
|
|
||||||
'OpenMapQuest',
|
|
||||||
[
|
|
||||||
"http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",
|
|
||||||
"http://otile2.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",
|
|
||||||
"http://otile3.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",
|
|
||||||
"http://otile4.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg"
|
|
||||||
],
|
|
||||||
{
|
|
||||||
attribution: 'Kartenbasis: Daten von <a href="http://www.openstreetmap.org/">OpenStreetMap</a> - Veröffentlicht unter <a href="http://opendatacommons.org/licenses/odbl/">ODbL</a><br />' +
|
|
||||||
'Seismische Daten von <a href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs">Ruhr-Universität Bochum</a> - Veröffentlicht unter <a href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>'
|
|
||||||
}
|
|
||||||
);
|
|
||||||
map.addLayers([omq_map_layer]);
|
|
||||||
|
|
||||||
// ESRI
|
// ESRI
|
||||||
/* var esri_map_layer = new OpenLayers.Layer.XYZ(
|
var esri_map_layer = new OpenLayers.Layer.XYZ(
|
||||||
'ESRI',
|
'ESRI',
|
||||||
"https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}",
|
"https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}",
|
||||||
{
|
{
|
||||||
@@ -162,36 +122,14 @@ function init(showGoogle, showStations, showQuakes, noFrils) {
|
|||||||
'This work is licensed under the Web Services and API <a href="http://links.esri.com/agol_tou" target="_blank">Terms of Use</a>.'
|
'This work is licensed under the Web Services and API <a href="http://links.esri.com/agol_tou" target="_blank">Terms of Use</a>.'
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
map.addLayers([esri_map_layer]); */
|
map.addLayers([esri_map_layer]);
|
||||||
|
|
||||||
// Show quakes
|
// Show quakes
|
||||||
quakes_layer = loadKML(OpenLayers.i18n("Events"), 'quakes.kml', false, true);
|
quakes_layer = loadKML(OpenLayers.i18n("Events"), 'quakes.kml', false, true);
|
||||||
quakes_layer.events.on({'loadend': setQuakesMapkeyVisibility});
|
quakes_layer.events.on({'visibilitychanged': toggleQuakesMapkey});
|
||||||
quakes_layer.events.on({'visibilitychanged': setQuakesMapkeyVisibility});
|
|
||||||
map.addLayer(quakes_layer);
|
map.addLayer(quakes_layer);
|
||||||
quakes_layer.setVisibility(showQuakes);
|
quakes_layer.setVisibility(showQuakes);
|
||||||
|
|
||||||
// color coding of events
|
|
||||||
var day2sec = 86400.;
|
|
||||||
var timeNow = new Date().getTime()/1000.;
|
|
||||||
var timeCoding;
|
|
||||||
if (mapargs['timeCoding']) {
|
|
||||||
switch ( mapargs['timeCoding'] ){
|
|
||||||
case 'decade':
|
|
||||||
timeCoding = {
|
|
||||||
'colors': [ '#0000ff', '#ff0000', '#ffa500', '#ffff00'],
|
|
||||||
'times': [1262300400, 946681200, 631148400, 315529200]
|
|
||||||
// 1.1.2010, 1.1.2000, 1.1.1990, 1.1.1980
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
if (!mapargs['timeCoding'] || !timeCoding ) {
|
|
||||||
timeCoding = {
|
|
||||||
'colors': ['#0000ff', '#ff0000', '#ffa500', '#ffff00'],
|
|
||||||
'ages': [7*day2sec, 30.4375*day2sec, 182.625*day2sec, 365.25*day2sec]
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// Adding custom style to quakes
|
// Adding custom style to quakes
|
||||||
var quake_style_default = new OpenLayers.Style({
|
var quake_style_default = new OpenLayers.Style({
|
||||||
fillColor: '${pntcolor}', fillOpacity: 0.2,
|
fillColor: '${pntcolor}', fillOpacity: 0.2,
|
||||||
@@ -201,45 +139,10 @@ function init(showGoogle, showStations, showQuakes, noFrils) {
|
|||||||
{
|
{
|
||||||
context: {
|
context: {
|
||||||
pntcolor: function(feature){
|
pntcolor: function(feature){
|
||||||
try {
|
return feature.data.pntcolor.value;
|
||||||
return feature.data.pntcolor.value;
|
|
||||||
} catch (e) {
|
|
||||||
return "#E020F0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/* if (timeCoding['ages']) {
|
|
||||||
quakeAge = feature.data.age.value;
|
|
||||||
// quakeAge = timeNow - feature.data.stime.value;
|
|
||||||
for ( level = 0; level < timeCoding['ages'].length; level += 1 ) {
|
|
||||||
if ( quakeAge <= timeCoding['ages'][level] ) {
|
|
||||||
return timeCoding['colors'][level];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
} else if (timeCoding['decade']) {
|
|
||||||
return feature.data.pntcolor.value;
|
|
||||||
} else {
|
|
||||||
quakeTime = timeNow + feature.data.age.value;
|
|
||||||
// quakeTime = feature.data.stime.value;
|
|
||||||
for ( level = 0; level < timeCoding['times'].length; level += 1 ) {
|
|
||||||
if ( quakeTime >= timeCoding['times'][level] ) {
|
|
||||||
return timeCoding['colors'][level];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
//return '#ffffff00';
|
|
||||||
}, */
|
|
||||||
pntsize: function(feature){
|
pntsize: function(feature){
|
||||||
try {
|
return feature.data.pntsize.value;
|
||||||
// quakeAge = feature.data.age.value;
|
|
||||||
// quakeAge = timeNow - feature.data.time.value;
|
|
||||||
// if ( timeCoding['ages'] && quakeAge > timeCoding['ages'][timeCoding['ages'].length-1] ) {
|
|
||||||
// return 0;
|
|
||||||
// } else {
|
|
||||||
return feature.data.pntsize.value;
|
|
||||||
//}
|
|
||||||
} catch (e) {
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -259,7 +162,7 @@ function init(showGoogle, showStations, showQuakes, noFrils) {
|
|||||||
|
|
||||||
// Adding custom style to stations
|
// Adding custom style to stations
|
||||||
var station_style_default = new OpenLayers.Style({
|
var station_style_default = new OpenLayers.Style({
|
||||||
fillColor: '${pointColor}', fillOpacity: 0.8, // #8dae10
|
fillColor: '#8dae10', fillOpacity: 0.8,
|
||||||
strokeColor: 'black', strokeWidth: 2,
|
strokeColor: 'black', strokeWidth: 2,
|
||||||
label: "${text}", labelXOffset: 15, labelAlign: 'l',
|
label: "${text}", labelXOffset: 15, labelAlign: 'l',
|
||||||
fontColor: "${tcolor}", fontFamily: 'sans-serif', fontWeight: 'bold',
|
fontColor: "${tcolor}", fontFamily: 'sans-serif', fontWeight: 'bold',
|
||||||
@@ -268,13 +171,6 @@ function init(showGoogle, showStations, showQuakes, noFrils) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
context: {
|
context: {
|
||||||
pointColor: function(feature){
|
|
||||||
if (feature.attributes.count) {
|
|
||||||
return '#8dae10';
|
|
||||||
} else {
|
|
||||||
return '#8dae10'; //return feature.data.pntcolor.value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
text: function(feature){
|
text: function(feature){
|
||||||
if (feature.attributes.count) {
|
if (feature.attributes.count) {
|
||||||
var c = feature.attributes.count;
|
var c = feature.attributes.count;
|
||||||
@@ -440,16 +336,12 @@ function onFeatureUnselect(event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Function to activate map legend */
|
/* Function to activate map legend */
|
||||||
function setQuakesMapkeyVisibility() {
|
function toggleQuakesMapkey() {
|
||||||
var mapkey_div = document.getElementById('mapkey');
|
var mapkey_div = document.getElementById('mapkey');
|
||||||
var quakes_visibility = quakes_layer.getVisibility();
|
var quakes_visibility = quakes_layer.getVisibility();
|
||||||
if (quakes_visibility) {
|
if (quakes_visibility) {
|
||||||
mapkey_div.style.display = "block";
|
mapkey_div.style.display = "block";
|
||||||
mapkey_div.style.visibility = "visible";
|
|
||||||
} else {
|
} else {
|
||||||
if (mapkey_div) {
|
mapkey_div.style.display = "none";
|
||||||
mapkey_div.style.visibility = "hidden";
|
|
||||||
mapkey_div.style.display = "none";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+44
-31
@@ -28,47 +28,60 @@ import simplekml
|
|||||||
kml = simplekml.Kml()
|
kml = simplekml.Kml()
|
||||||
|
|
||||||
# create empyt folder to contain styles and stations
|
# create empyt folder to contain styles and stations
|
||||||
stationsFolder = kml.newfolder(name="Stations")
|
stations_folder = kml.newfolder(name="Stations")
|
||||||
|
|
||||||
|
# style of broad-band stations
|
||||||
|
BBstyle = simplekml.Style()
|
||||||
|
BBstyle.iconstyle.icon.href = 'https://maps.google.com/mapfiles/ms/micons/red-dot.png'
|
||||||
|
BBtcolor = '#003560'
|
||||||
|
|
||||||
|
# style of short periode stations
|
||||||
|
SPstyle = simplekml.Style()
|
||||||
|
SPstyle.iconstyle.icon.href = 'https://maps.google.com/mapfiles/ms/micons/orange-dot.png'
|
||||||
|
SPtcolor = '#003560'
|
||||||
|
|
||||||
|
# style of short periode stations
|
||||||
|
AUXstyle = simplekml.Style()
|
||||||
|
AUXstyle.iconstyle.icon.href = 'https://maps.google.com/mapfiles/ms/micons/yellow-dot.png'
|
||||||
|
AUXtcolor = '#003560'
|
||||||
|
|
||||||
# station types
|
|
||||||
stationTypes = {
|
|
||||||
'broadband': {'textColor': '#003560', 'pointSize': 10, 'pointColor': '#ff0000'},
|
|
||||||
'shortperiod': {'textColor': '#003560', 'pointSize': 10, 'pointColor': '#ffa500'},
|
|
||||||
'auxiliary': {'textColor': '#003560', 'pointSize': 8, 'pointColor': '#ffff00'},
|
|
||||||
'geothermie': {'textColor': '#003560', 'pointSize': 10, 'pointColor': '#ffff00'}
|
|
||||||
}
|
|
||||||
# setting station info
|
# setting station info
|
||||||
stations = {
|
stations = {
|
||||||
'BUG, BKLB': [( 7.2693, 51.4406), 'broadband', 1, "GRSN station BUG, STS-2 seismometer<br />RuhrNet station BKLB, GS-13 seismometer"],
|
'BUG, BKLB': [(7.2693, 51.4406), "GRSN station BUG, STS-2 seismometer<br />RuhrNet station BKLB, GS-13 seismometer", BBstyle, 10, '#ff0000', 'BUG (Bochum University Germany), BKLB (Bochum - Klosterbusch)', BBtcolor, 1],
|
||||||
'BULI': [( 7.2602, 51.4544), 'auxiliary', 0, 'RuhrNet station BULI, Mark L4c-3D seismometer'],
|
'BULI': [(7.2602, 51.4544), 'RuhrNet station BULI, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'BULI', AUXtcolor, 0],
|
||||||
'BTEZ': [( 7.2790, 51.4490), 'auxiliary', 0, 'RuhrNet station BTEZ, GS-13 seismometer'],
|
'BTEZ': [(7.2790, 51.4490), 'RuhrNet station BTEZ, GS-13 seismometer', AUXstyle, 8, '#ffff00', 'BTEZ', AUXtcolor, 0],
|
||||||
'BPFI': [( 7.2276, 51.4185), 'auxiliary', 0, 'RuhrNet station BBFI, Mark L4c-3D seismometer'],
|
'BHOF': [(7.2614, 51.4289), 'RuhrNet station BHOF, GS-13 seismometer', AUXstyle, 8, '#ffff00', 'BHOF', AUXtcolor, 0],
|
||||||
'HMES': [( 7.7263, 51.6578), 'broadband', 0, 'RuhrNet station HMES, Trillium 40 seismometer'],
|
'BPFI': [(7.2276, 51.4185 ), 'RuhrNet station BBFI, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'BPFI', AUXtcolor, 0],
|
||||||
'BRHE': [( 6.5710, 51.5155), 'shortperiod', 0, 'RuhrNet station BRHE, Mark L4c-3D seismometer'],
|
'HMES': [(7.7263, 51.6578), 'RuhrNet station HMES, Trillium 40 seismometer', BBstyle, 10, '#ff0000', 'HMES', BBtcolor, 0],
|
||||||
'ZERL': [( 6.8695, 51.6207), 'shortperiod', 0, 'RuhrNet station ZERL, Mark L4c-3D seismometer'],
|
'BRHE': [(6.5710, 51.5155), 'RuhrNet station BRHE, Mark L-4C 3D seismometer', SPstyle, 10, '#ffa500', 'BRHE', SPtcolor, 0],
|
||||||
'ZER1': [( 6.8252, 51.5947), 'auxiliary', 0, 'RuhrNet station ZER1, Mark L4c-3D seismometer'],
|
'ZERL': [(6.8695, 51.6207), 'RuhrNet station ZERL, Mark L-4C 3D seismometer', SPstyle, 10, '#ffa500', 'ZERL', SPtcolor, 0],
|
||||||
'ZER2': [( 6.9060, 51.5871), 'auxiliary', 0, 'RuhrNet station ZER2, Mark L4c-3D seismometer'],
|
'ZER1': [(6.8252, 51.5948), 'RuhrNet station ZER1, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'ZER1', AUXtcolor, 0],
|
||||||
'ZER3': [( 6.8384, 51.6128), 'auxiliary', 0, 'RuhrNet station ZER3, Mark L4c-3D seismometer'],
|
'ZER2': [(6.9062, 51.5871 ), 'RuhrNet station ZER2, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'ZER2', AUXtcolor, 0],
|
||||||
'BAVN': [( 7.1220, 51.7380), 'broadband', 0, 'RuhrNet station BAVN, STS-2 seismometer'],
|
'ZER3': [(6.8384, 51.61274), 'RuhrNet station ZER3, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'ZER3', AUXtcolor, 0],
|
||||||
'BAVS': [( 7.1331, 51.7000), 'auxiliary', 0, 'RuhrNet station BAVS, Mark L4c-3D seismometer'],
|
'BAVN': [(7.1220, 51.7380), 'RuhrNet station BAVN, STS-2 seismometer', BBstyle, 10, '#ff0000', 'BAVN', BBtcolor, 0],
|
||||||
'IBBN': [( 7.7566, 52.3072), 'broadband', 0, 'GEOFON station IBBN, STS-2 seismometer'],
|
'BAVS': [(7.13307, 51.7000), 'RuhrNet station BAVS, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'BAVS', AUXtcolor, 0],
|
||||||
'IBBE': [( 7.7943, 52.2998), 'auxiliary', 0, 'RuhrNet station IBBE, Mark L4c-3D seismometer'],
|
'IBBN': [(7.7566, 52.3072), 'GEOFON station IBBN, STS-2 seismometer', BBstyle, 10, '#ff0000', 'IBBN', BBtcolor, 0],
|
||||||
'IBBS': [( 7.7486, 52.2843), 'auxiliary', 0, 'RuhrNet station IBBS, Mark L4c-3D seismometer'],
|
'IBBE': [(7.7943, 52.2998), 'RuhrNet station IBBE, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'IBBE', AUXtcolor, 0],
|
||||||
'KERA': [(23.5577, 35.3692), 'broadband', 0, 'GEOFON station KERA, STS-2 seismometer'],
|
'IBBS': [(7.7486, 52.2843), 'RuhrNet station IBBS, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'IBBS', AUXtcolor, 0],
|
||||||
'KARP': [(27.1612, 35.5472), 'broadband', 0, 'GEOFON station KARP, STS-2 seismometer']
|
'KERA': [(23.55769, 35.36919), 'GEOFON station KERA, STS-2 seismometer', BBstyle, 10, '#ff0000', 'KERA', BBtcolor, 0],
|
||||||
|
'KARP': [(27.16117, 35.54717), 'GEOFON station KARP, STS-2 seismometer', BBstyle, 10, '#ff0000', 'KARP', BBtcolor, 0]
|
||||||
}
|
}
|
||||||
|
# 'BSHA': [(7.2445, 51.4469), 'RuhrNet station BSHA, GS-13 seismometer', AUXstyle, 8, '#ffff00', '', 'black'],
|
||||||
|
# 'BKLB': [(7.2697, 51.4401), 'RuhrNet station BKLB, GS-13 seismometer', AUXstyle, 8, '#ffff00', 'BKLB', AUXtcolor],
|
||||||
|
|
||||||
# adding station markers
|
# adding station markers
|
||||||
for key, value in stations.iteritems():
|
for key, value in stations.iteritems():
|
||||||
pnt = stationsFolder.newpoint(
|
pnt = stations_folder.newpoint(
|
||||||
name = key,
|
name = key,
|
||||||
coords = [(value[0][0], value[0][1])],
|
coords = [(value[0][0], value[0][1])],
|
||||||
description = value[3]
|
description = value[1]
|
||||||
)
|
)
|
||||||
pnt.extendeddata.newdata('pntsize', stationTypes[value[1]]['pointSize'])
|
pnt.style = value[2]
|
||||||
pnt.extendeddata.newdata('pntcolor', stationTypes[value[1]]['pointColor'])
|
pnt.extendeddata.newdata('pntsize', value[3])
|
||||||
pnt.extendeddata.newdata('tcolor', stationTypes[value[1]]['textColor'])
|
pnt.extendeddata.newdata('pntcolor', value[4])
|
||||||
pnt.extendeddata.newdata('extrastation', value[2])
|
pnt.extendeddata.newdata('text', value[5])
|
||||||
|
pnt.extendeddata.newdata('tcolor', value[6])
|
||||||
|
pnt.extendeddata.newdata('extrastation', value[7])
|
||||||
|
|
||||||
# saving the KML file
|
# saving the KML file
|
||||||
kml.save('stations.kml')
|
kml.save('stations.kml')
|
||||||
Reference in new issue
Block a user