Tagged scripts in www/trunk as tags/20130222. Live Website now uses this scripts.
This commit is contained in:
commit
590f0ff254
Notes:
subgit
2018-03-07 17:58:40 +01:00
r478 www/tags/20130222
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
* text=auto !eol
|
90
index.html
Normal file
90
index.html
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<!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>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<style type="text/css">
|
||||||
|
html, body, #map {
|
||||||
|
margin: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#maptext {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 1em;
|
||||||
|
left: 1em;
|
||||||
|
width: 20%;
|
||||||
|
z-index: 20000;
|
||||||
|
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>
|
||||||
|
<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.9'></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="mapkey">
|
||||||
|
<script type='text/javascript'>initKey(true, false, false);</script>
|
||||||
|
</div>
|
||||||
|
<div id="map">
|
||||||
|
<script type='text/javascript'>init(true, true, false, false);</script>
|
||||||
|
</div>
|
||||||
|
<!-- <div id="maptext">
|
||||||
|
<h3 id="title">Stations</h3>
|
||||||
|
</div> -->
|
||||||
|
</body>
|
||||||
|
</html>
|
347
station_map_www.js
Normal file
347
station_map_www.js
Normal file
@ -0,0 +1,347 @@
|
|||||||
|
/*
|
||||||
|
* JavaScript code to generate maps used by the
|
||||||
|
* Seismological Observatory of the Ruhr-University Bochum
|
||||||
|
*
|
||||||
|
* Copyright 2013 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$
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Global variables */
|
||||||
|
var map;
|
||||||
|
|
||||||
|
/* Main function to create the map */
|
||||||
|
function init(showGoogle, showStations, showQuakes, noFrils) {
|
||||||
|
|
||||||
|
/* Creating map */
|
||||||
|
if ( !noFrils ) {
|
||||||
|
map = new OpenLayers.Map(
|
||||||
|
'map',
|
||||||
|
{
|
||||||
|
projection: new OpenLayers.Projection('EPSG:900913'),
|
||||||
|
displayProjection: new OpenLayers.Projection('EPSG:4326'),
|
||||||
|
controls: [
|
||||||
|
new OpenLayers.Control.Attribution(),
|
||||||
|
new OpenLayers.Control.KeyboardDefaults(),
|
||||||
|
new OpenLayers.Control.LayerSwitcher({}),
|
||||||
|
new OpenLayers.Control.MousePosition(),
|
||||||
|
new OpenLayers.Control.Navigation(),
|
||||||
|
new OpenLayers.Control.OverviewMap(),
|
||||||
|
new OpenLayers.Control.PanZoomBar({zoomWorldIcon: true}),
|
||||||
|
new OpenLayers.Control.Permalink(),
|
||||||
|
new OpenLayers.Control.ScaleLine({geodesic: true})
|
||||||
|
]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
map = new OpenLayers.Map(
|
||||||
|
'map',
|
||||||
|
{
|
||||||
|
projection: new OpenLayers.Projection('EPSG:900913'),
|
||||||
|
displayProjection: new OpenLayers.Projection('EPSG:4326'),
|
||||||
|
controls: [
|
||||||
|
new OpenLayers.Control.Attribution(),
|
||||||
|
new OpenLayers.Control.KeyboardDefaults(),
|
||||||
|
new OpenLayers.Control.Navigation(),
|
||||||
|
new OpenLayers.Control.Permalink({anchor: true}),
|
||||||
|
new OpenLayers.Control.ScaleLine({geodesic: true})
|
||||||
|
]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Base Layers */
|
||||||
|
// OpenStreetMap
|
||||||
|
var osmde_map_layer = new OpenLayers.Layer.OSM(
|
||||||
|
'OpenStreetMap (DE)',
|
||||||
|
[
|
||||||
|
"https://a.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png",
|
||||||
|
"https://b.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png",
|
||||||
|
"https://c.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png"
|
||||||
|
],
|
||||||
|
{
|
||||||
|
attribution: 'Geobasisdaten: Copyright © 2013 <a href="http://www.openstreetmap.org/">OpenStreetMap</a> und Mitwirkende;' +
|
||||||
|
'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)');
|
||||||
|
map.addLayers([
|
||||||
|
osm_map_layer,
|
||||||
|
osmde_map_layer
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Google Maps
|
||||||
|
if (showGoogle) {
|
||||||
|
var googleT_map_layer = new OpenLayers.Layer.Google(
|
||||||
|
OpenLayers.i18n('Google Maps (Terrain)'),
|
||||||
|
{type: google.maps.MapTypeId.TERRAIN,transitionEffect: "resize"}
|
||||||
|
);
|
||||||
|
var googleS_map_layer = new OpenLayers.Layer.Google(
|
||||||
|
OpenLayers.i18n("Google Maps (Satellite)"),
|
||||||
|
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22,transitionEffect: "resize"}
|
||||||
|
);
|
||||||
|
var googleH_map_layer = new OpenLayers.Layer.Google(
|
||||||
|
'Google Maps (Hybrid)',
|
||||||
|
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20,transitionEffect: "resize"}
|
||||||
|
);
|
||||||
|
var googleM_map_layer = new OpenLayers.Layer.Google(
|
||||||
|
OpenLayers.i18n("Google Maps (Streets)"),
|
||||||
|
{numZoomLevels: 20,transitionEffect: "resize"}
|
||||||
|
);
|
||||||
|
map.addLayers([
|
||||||
|
googleT_map_layer,
|
||||||
|
googleS_map_layer,
|
||||||
|
googleH_map_layer,
|
||||||
|
googleM_map_layer
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// ESRI
|
||||||
|
var esri_map_layer = new OpenLayers.Layer.XYZ(
|
||||||
|
'ESRI',
|
||||||
|
"https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}",
|
||||||
|
{
|
||||||
|
sphericalMercator: true,
|
||||||
|
attribution: 'Copyright © 2013 by ESRI. ' +
|
||||||
|
'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]);
|
||||||
|
|
||||||
|
// Show quakes
|
||||||
|
quakes_layer = loadKML(OpenLayers.i18n("Events"), 'quakes.kml', false, true);
|
||||||
|
quakes_layer.events.on({'visibilitychanged': toggleQuakesMapkey});
|
||||||
|
map.addLayer(quakes_layer);
|
||||||
|
quakes_layer.setVisibility(showQuakes);
|
||||||
|
|
||||||
|
// Adding custom style to quakes
|
||||||
|
var quake_style_default = new OpenLayers.Style({
|
||||||
|
fillColor: '${pntcolor}', fillOpacity: 0.2,
|
||||||
|
strokeColor: '${pntcolor}', strokeWidth: 2,
|
||||||
|
pointRadius: '${pntsize}'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
context: {
|
||||||
|
pntcolor: function(feature){
|
||||||
|
return feature.data.pntcolor.value;
|
||||||
|
},
|
||||||
|
pntsize: function(feature){
|
||||||
|
return feature.data.pntsize.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var quake_style_select = quake_style_default.clone();
|
||||||
|
quake_style_select.defaultStyle.fillOpacity = 0.8;
|
||||||
|
|
||||||
|
var quake_style_map = new OpenLayers.StyleMap({
|
||||||
|
'default': quake_style_default,
|
||||||
|
'select': quake_style_select
|
||||||
|
});
|
||||||
|
quakes_layer.styleMap = quake_style_map;
|
||||||
|
|
||||||
|
// Show stations
|
||||||
|
stations_layer = loadKML(OpenLayers.i18n("Stations"), 'stations.kml', false, noFrils);
|
||||||
|
map.addLayer(stations_layer);
|
||||||
|
stations_layer.setVisibility(showStations);
|
||||||
|
|
||||||
|
// Adding custom style to stations
|
||||||
|
var station_style_default = new OpenLayers.Style({
|
||||||
|
fillColor: '#8dae10', fillOpacity: 0.8,
|
||||||
|
strokeColor: 'black', strokeWidth: 2,
|
||||||
|
label: "${text}", labelXOffset: 15, labelAlign: 'l',
|
||||||
|
fontColor: "${tcolor}", fontFamily: 'sans-serif', fontWeight: 'bold',
|
||||||
|
pointRadius: '${pntsize}',
|
||||||
|
graphicName: '${pntsymbol}'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
context: {
|
||||||
|
text: function(feature){
|
||||||
|
if (feature.attributes.count) {
|
||||||
|
var c = feature.attributes.count;
|
||||||
|
for (var i=0; i<feature.cluster.length; i++){
|
||||||
|
c = c + feature.cluster[i].data.extrastation.value * 1.0;
|
||||||
|
}
|
||||||
|
return c + ' ' + OpenLayers.i18n('stations');
|
||||||
|
} else {
|
||||||
|
return feature.data.name;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tcolor: function(feature){
|
||||||
|
if (feature.attributes.count) {
|
||||||
|
return 'black';
|
||||||
|
} else {
|
||||||
|
return feature.data.tcolor.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pntsize: function(feature){
|
||||||
|
if (feature.attributes.count) {
|
||||||
|
return Math.min(feature.attributes.count * 2.0 + 6.0, 12);
|
||||||
|
} else {
|
||||||
|
return feature.data.pntsize.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pntsymbol: function(feature){
|
||||||
|
if (feature.attributes.count) {
|
||||||
|
return 'circle';
|
||||||
|
} else {
|
||||||
|
return 'triangle';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var station_style_select = station_style_default.clone();
|
||||||
|
station_style_select.defaultStyle.strokeWidth = 4;
|
||||||
|
var station_style_map = new OpenLayers.StyleMap({
|
||||||
|
'default': station_style_default,
|
||||||
|
'select': station_style_select
|
||||||
|
});
|
||||||
|
stations_layer.styleMap = station_style_map;
|
||||||
|
|
||||||
|
// Set initial view
|
||||||
|
if (!map.getCenter()) {
|
||||||
|
map.setCenter(new OpenLayers.LonLat(7.5, 51.8).transform('EPSG:4326','EPSG:900913'), 9);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable animated zoom
|
||||||
|
for (var i=map.layers.length-1; i>=0; --i) {
|
||||||
|
map.layers[i].animationEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show description
|
||||||
|
select = new OpenLayers.Control.SelectFeature([quakes_layer, stations_layer]);
|
||||||
|
map.addControl(select);
|
||||||
|
select.activate();
|
||||||
|
|
||||||
|
// Add graticule
|
||||||
|
map.addControl(new OpenLayers.Control.Graticule({layerName: OpenLayers.i18n("Grid"), visible: false}));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function to load KML file */
|
||||||
|
function loadKML(name, file, useStyle, noFrils) {
|
||||||
|
// define layer strategy
|
||||||
|
var layer_strategy
|
||||||
|
if (noFrils){
|
||||||
|
layer_strategy = [
|
||||||
|
new OpenLayers.Strategy.Fixed(),
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
// define cluster parameters
|
||||||
|
var thresholdValue = 4;
|
||||||
|
if (map.getZoom() <= 8){ thresholdValue = 2}
|
||||||
|
if (map.getZoom() >= 10){ thresholdValue = 6}
|
||||||
|
if (noFrils) {
|
||||||
|
thresholdValue = 99;
|
||||||
|
distanceValue = 0
|
||||||
|
};
|
||||||
|
|
||||||
|
var distanceValue = 10;
|
||||||
|
if (map.getZoom() <= 9){ distanceValue = 20}
|
||||||
|
|
||||||
|
layer_strategy = [
|
||||||
|
new OpenLayers.Strategy.Fixed(),
|
||||||
|
new OpenLayers.Strategy.Cluster({distance: distanceValue, threshold: thresholdValue})
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// create kml layer
|
||||||
|
var kml_layer = new OpenLayers.Layer.Vector(
|
||||||
|
name,
|
||||||
|
{
|
||||||
|
strategies: layer_strategy,
|
||||||
|
protocol: new OpenLayers.Protocol.HTTP(
|
||||||
|
{
|
||||||
|
url: file,
|
||||||
|
format: new OpenLayers.Format.KML({
|
||||||
|
extractStyles: useStyle,
|
||||||
|
extractAttributes: true,
|
||||||
|
maxDepth: 1
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
transitionEffect: "resize",
|
||||||
|
projection: new OpenLayers.Projection("EPSG:4326")
|
||||||
|
});
|
||||||
|
kml_layer.events.on(
|
||||||
|
{
|
||||||
|
"featureselected": onFeatureSelect,
|
||||||
|
"featureunselected": onFeatureUnselect
|
||||||
|
});
|
||||||
|
|
||||||
|
// return layer object
|
||||||
|
return kml_layer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function called at closing of a popup */
|
||||||
|
function onPopupClose(evt) {
|
||||||
|
select.unselectAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function called when clicking on a marker */
|
||||||
|
function onFeatureSelect(event) {
|
||||||
|
var feature = event.feature;
|
||||||
|
// Since KML is user-generated, do naive protection against
|
||||||
|
// Javascript.
|
||||||
|
if (feature.attributes.name){
|
||||||
|
var content = "<h3>"+feature.attributes.name + "</h3><p>" + feature.attributes.description + '</p>';
|
||||||
|
if (content.search("<script") != -1) {
|
||||||
|
content = "Content contained Javascript! Escaped content below.<br>" + content.replace(/</g, "<");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var content = '<h3>';
|
||||||
|
for (var i=0; i<feature.cluster.length; i++){
|
||||||
|
content = content + feature.cluster[i].attributes.name;
|
||||||
|
if (i < feature.cluster.length-1) {
|
||||||
|
content = content + ', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
content += '</h3>'+
|
||||||
|
OpenLayers.i18n('Zoom in to resolve individual stations.');
|
||||||
|
}
|
||||||
|
var popup = new OpenLayers.Popup.FramedCloud(
|
||||||
|
"popups",
|
||||||
|
feature.geometry.getBounds().getCenterLonLat(),
|
||||||
|
new OpenLayers.Size(100,100),
|
||||||
|
content,
|
||||||
|
null, true,
|
||||||
|
onPopupClose
|
||||||
|
);
|
||||||
|
feature.popup = popup;
|
||||||
|
map.addPopup(popup);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function to close popups */
|
||||||
|
function onFeatureUnselect(event) {
|
||||||
|
var feature = event.feature;
|
||||||
|
if(feature.popup) {
|
||||||
|
map.removePopup(feature.popup);
|
||||||
|
feature.popup.destroy();
|
||||||
|
delete feature.popup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function to activate map legend */
|
||||||
|
function toggleQuakesMapkey() {
|
||||||
|
var mapkey_div = document.getElementById('mapkey');
|
||||||
|
var quakes_visibility = quakes_layer.getVisibility();
|
||||||
|
if (quakes_visibility) {
|
||||||
|
mapkey_div.style.display = "block";
|
||||||
|
} else {
|
||||||
|
mapkey_div.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
87
stations2kml.py
Executable file
87
stations2kml.py
Executable file
@ -0,0 +1,87 @@
|
|||||||
|
#! /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$
|
||||||
|
"""
|
||||||
|
|
||||||
|
import simplekml
|
||||||
|
|
||||||
|
# create new empty KML file
|
||||||
|
kml = simplekml.Kml()
|
||||||
|
|
||||||
|
# create empyt folder to contain styles and 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'
|
||||||
|
|
||||||
|
# setting station info
|
||||||
|
stations = {
|
||||||
|
'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), 'RuhrNet station BULI, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'BULI', AUXtcolor, 0],
|
||||||
|
'BTEZ': [(7.2790, 51.4490), 'RuhrNet station BTEZ, GS-13 seismometer', AUXstyle, 8, '#ffff00', 'BTEZ', AUXtcolor, 0],
|
||||||
|
'BHOF': [(7.2614, 51.4289), 'RuhrNet station BHOF, GS-13 seismometer', AUXstyle, 8, '#ffff00', 'BHOF', AUXtcolor, 0],
|
||||||
|
'BPFI': [(7.2276, 51.4185 ), 'RuhrNet station BBFI, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'BPFI', AUXtcolor, 0],
|
||||||
|
'HMES': [(7.7263, 51.6578), 'RuhrNet station HMES, Trillium 40 seismometer', BBstyle, 10, '#ff0000', 'HMES', BBtcolor, 0],
|
||||||
|
'BRHE': [(6.5710, 51.5155), 'RuhrNet station BRHE, Mark L-4C 3D seismometer', SPstyle, 10, '#ffa500', 'BRHE', SPtcolor, 0],
|
||||||
|
'ZERL': [(6.8695, 51.6207), 'RuhrNet station ZERL, Mark L-4C 3D seismometer', SPstyle, 10, '#ffa500', 'ZERL', SPtcolor, 0],
|
||||||
|
'ZER1': [(6.8252, 51.5948), 'RuhrNet station ZER1, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'ZER1', AUXtcolor, 0],
|
||||||
|
'ZER2': [(6.9062, 51.5871 ), 'RuhrNet station ZER2, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'ZER2', AUXtcolor, 0],
|
||||||
|
'ZER3': [(6.8384, 51.61274), 'RuhrNet station ZER3, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'ZER3', AUXtcolor, 0],
|
||||||
|
'BAVN': [(7.1220, 51.7380), 'RuhrNet station BAVN, STS-2 seismometer', BBstyle, 10, '#ff0000', 'BAVN', BBtcolor, 0],
|
||||||
|
'BAVS': [(7.13307, 51.7000), 'RuhrNet station BAVS, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'BAVS', AUXtcolor, 0],
|
||||||
|
'IBBN': [(7.7566, 52.3072), 'GEOFON station IBBN, STS-2 seismometer', BBstyle, 10, '#ff0000', 'IBBN', BBtcolor, 0],
|
||||||
|
'IBBE': [(7.7943, 52.2998), 'RuhrNet station IBBE, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'IBBE', AUXtcolor, 0],
|
||||||
|
'IBBS': [(7.7486, 52.2843), 'RuhrNet station IBBS, Mark L-4C 3D seismometer', AUXstyle, 8, '#ffff00', 'IBBS', AUXtcolor, 0],
|
||||||
|
'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
|
||||||
|
for key, value in stations.iteritems():
|
||||||
|
pnt = stations_folder.newpoint(
|
||||||
|
name = key,
|
||||||
|
coords = [(value[0][0], value[0][1])],
|
||||||
|
description = value[1]
|
||||||
|
)
|
||||||
|
pnt.style = value[2]
|
||||||
|
pnt.extendeddata.newdata('pntsize', value[3])
|
||||||
|
pnt.extendeddata.newdata('pntcolor', value[4])
|
||||||
|
pnt.extendeddata.newdata('text', value[5])
|
||||||
|
pnt.extendeddata.newdata('tcolor', value[6])
|
||||||
|
pnt.extendeddata.newdata('extrastation', value[7])
|
||||||
|
|
||||||
|
# saving the KML file
|
||||||
|
kml.save('stations.kml')
|
Loading…
Reference in New Issue
Block a user