Compare commits

...

5 Commits

Author SHA1 Message Date
5d38db389d Merge branch 'develop' into feature/vagrant 2022-02-23 16:54:07 +01:00
9333db3d29 test for "Deutschland" in contryCode when doing geolocation lookup. 2022-02-23 16:53:37 +01:00
2d287ea304 add event bug2020ahxi (Erftstadt 2.9) to specialevents.js 2022-02-23 16:52:44 +01:00
a7d16e5b8a fix scripts/mkGeolocationTable.py
* increase query limit to 10
* increase min_delay_seconds of RateLimiter to 2 seconds
2022-02-23 15:17:08 +01:00
08047bcff8 clean up of file specialevents.js 2022-02-23 15:15:26 +01:00
4 changed files with 8 additions and 38 deletions

View File

@ -52,7 +52,7 @@ def mkGeolocationTable(file=''):
from geopy.exc import GeocoderServiceError from geopy.exc import GeocoderServiceError
## constants ## constants
URL = 'https://photon.komoot.io/reverse?lon={lng:.3f}&lat={lat:.3f}&limit=5' URL = 'https://photon.komoot.io/reverse?lon={lng:.3f}&lat={lat:.3f}&limit=10'
NAMESPACES = {'sc3': 'http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7', NAMESPACES = {'sc3': 'http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7',
'qml': 'http://quakeml.org/xmlns/bed/1.2'} 'qml': 'http://quakeml.org/xmlns/bed/1.2'}
@ -70,7 +70,7 @@ def mkGeolocationTable(file=''):
# parse event.xml # parse event.xml
DOM = ET.parse(stdin).getroot() DOM = ET.parse(stdin).getroot()
geolocator = Photon() geolocator = Photon()
reverse_geolocate = RateLimiter(geolocator.reverse, min_delay_seconds=1) reverse_geolocate = RateLimiter(geolocator.reverse, min_delay_seconds=2)
# iterate over all events # iterate over all events
count = 0 count = 0
@ -88,7 +88,7 @@ def mkGeolocationTable(file=''):
else: else:
logging.info('Processing event {id}'.format(id=publicID)) logging.info('Processing event {id}'.format(id=publicID))
try: try:
locations = reverse_geolocate("{lat:.3f}, {lng:.3f}".format(lat=lat, lng=lng),exactly_one=False,limit=5) locations = reverse_geolocate("{lat:.3f}, {lng:.3f}".format(lat=lat, lng=lng),exactly_one=False,limit=10)
except GeocoderServiceError: except GeocoderServiceError:
logging.warning('Reverse Geolocation failed. Skipping event.') logging.warning('Reverse Geolocation failed. Skipping event.')
continue continue

View File

@ -1,41 +1,11 @@
/* last change 2021-10-30 */ /* last change 2022-20-23 */
var specialEvents = [ var specialEvents = [
//'bug2014ytlk', // Vechta 3.0
//'bug2014wjwx', // Haltern 3.6
//'bug2014ldts', // Darmstadt
//'bug2014kowj', // Vogtland 5.0
//'bug2014jptq', // Seeheim-Jugenheim
//'bug2014infb', // Troisdorf
//'bug2014ilxd', // Bassum
//'bug2014gfzw', // Darmstadt
//'bug2014datb', // Groningen
// 'bug2013yvko', // Haltern 3.4
// 'bug2015fdpy', // Darmstadt 3.0
// 'bug2016ajgm', // CTBT violation North Korea // 'bug2016ajgm', // CTBT violation North Korea
// 'bug2016cqkd', // Taunusstein 2.5
// 'bug2016hdae', // Aldenhoven 2.6
// 'bug2016hdaj', // Aldenhoven 2.4
// 'bug2016kkrq', // Bottrop 3.3
// 'bug2016qphy', // Central Italy 6.1 // 'bug2016qphy', // Central Italy 6.1
// 'bug2016rslt', // CTBT violation North Korea // 'bug2016rslt', // CTBT violation North Korea
// 'bug2016ueqo', // Darmstadt 2.4
// 'bug2016ufpi', // Darmstadt 3.0
// 'bug2016vico', // Central Italy 6.5 // 'bug2016vico', // Central Italy 6.5
// 'bug2016vrnc', // Nörvenich 3.2
// 'bug2016zawb', // St Goar 3.2
// 'bug2017iyhl', // Hürtgenwald 2.1
// 'bug2017omwg', // Brühl 2.3
// 'bug2017rfxe', // CTBT violation North Korea 6.1 // 'bug2017rfxe', // CTBT violation North Korea 6.1
// 'bug2017rjvq', // Dreieich / Hessen 2.6
// 'bug2017vxmm', // Brühl / Hürth 3.1
// 'bug2018nyax' // Ochtendung 2.7
// 'bug2019cxga', // Ochtendung 3.0
// 'bug2019czbt', // Ochtendung 2.9
// 'bug2019fura', // Sprengung Duisburg-Hochheide (Weißer Riese) 2.0 // 'bug2019fura', // Sprengung Duisburg-Hochheide (Weißer Riese) 2.0
// 'bug2019yeij', // Tektonisch, Hambach 2.2 'bug2021vtgi', // Geilenkirchen 1.9
'bug2020fqxf', // Meckenheim, 2.5 'bug2022ahxi' // Erftstadt 2.9
'bug2020skmt', // Heinsberg 1.7
'bug2020skon', // Heinsberg 2.5
'bug2020stdp', // Niederkassel 2.4
'bug2021ryaa' // Thedinghausen 3.2
]; ];

View File

@ -47,7 +47,7 @@ function getGeolocation(id, lat, lng) {
var city = json.features[0].properties.city; var city = json.features[0].properties.city;
var countryCode = json.features[0].properties.country; var countryCode = json.features[0].properties.country;
geolocationTable[id] = city; geolocationTable[id] = city;
( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; ( countryCode != "Germany" && countryCode != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null;
if ( city ) { if ( city ) {
$("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]);
var sort = [[0,1],[1,1],[2,1]]; var sort = [[0,1],[1,1],[2,1]];

View File

@ -47,7 +47,7 @@ function getGeolocation(id, lat, lng) {
var city = json.features[0].properties.city; var city = json.features[0].properties.city;
var countryCode = json.features[0].properties.country; var countryCode = json.features[0].properties.country;
geolocationTable[id] = city; geolocationTable[id] = city;
( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; ( countryCode != "Germany" && countryCode != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null;
if ( city ) { if ( city ) {
$("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]);
var sort = [[0,1],[1,1],[2,1]]; var sort = [[0,1],[1,1],[2,1]];