Author Topic: Earthquake Registration Script  (Read 3661 times)

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Earthquake Registration Script
« on: November 21, 2012, 07:29:17 PM »
Hi Jacques,

As always, I'm looking for some interesting additions to my website  :)
I came accross some scripts from Saratoga, one of them is Earthquake registration / Display.
You might think, that's something for Western Canada and California, however I was surprised to see how 'mother Earth' is shaking, even in our 'neighbourhood'..  ???

I've implemented the script in my Weather Blues and it shows the past 30 days within a 500km radius.
(Tab can be found under [Recent Weather])

I used 2 scripts:
'quake-Canada.php' and 'quake-json.php' (I re-named this one quakeson.php)
'The quakeson.php' file 'includes' the 'quake-Canada.php' file.

For actual area display, the scripts refer to Google Map, and superimpose the legend.
However, I only get the World Map displayed (today it climbed from 192 Global quakes  to 213 this evening), but I can't get the area displayed where my data is extracted from (although it says in the script it refers to Lat & Long coordinates for the Map display besides the actual information.)

I don't know if you're familiar with these scripts, but maybe you can give me a hint  ;)

Thanks as always for your help,

Cheers,

Arthur

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Earthquake Registration Script
« Reply #1 on: November 21, 2012, 08:09:18 PM »
Hi Arthur,

Your site is growing and customizing so well!
I've looked at your new page and was surprised too, to see so many
earthquakes in eastern Canada, and much surprised to see that
there is an "agency" to spread these data on the web!!  :-\

I'm again far from home this week and not equiped to "play" with that  ??? ::)
But I'm pretty excited about what you found,,, I'll work on it this week-end... promised!!

Will I have to pay royalties for all these "goodness"??   :D

Best regards,
Jacques
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Earthquake Registration Script
« Reply #2 on: November 22, 2012, 12:41:58 AM »
Hi Jacques,

Thanks for the reply.
Indeed I thought that North American Earthquakes were 'covered' by the USGS (US Geological Survey) only, but Canada seems to be active as well.
BTW: 'Shaky Grounds' there in Quebec  :)

In the script, I've set the highlighted quakes (=red) to 2.5 MN or more on the Richter Scale and surprisingly there's one with a 4.2 measurement in Hawkesbury......!!!

Pls let me know what you can 'tweak' with the existing scripts from Ken.

Thanks,

Arthur

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Earthquake Registration Script
« Reply #3 on: November 24, 2012, 09:12:37 AM »
Hi Arthur,

As promised, this morning I've played with your script and have no good news for you.  >:(
Problem is that quake-Canada.php script take only text from EarthquakesCanada website.

Then, for sure, you want to add a map to these recorded data to be more visual!
But problem is that the script quake-json is made for USGS and since it's a US
agency, it doen't include Canada, apart from it's "World map".. then the script strip
Google map part, since they are no data to display, and give you only a world map.

This world map is real cute, but if you look very closely you'll find that this map show
no point on Canada territory; only a few points are surrounding Canada due to Alaska
and "New-England states" position.

So you can keep it as an "other then Canada" map but to be at best a modification
could be done to quake-Canada.php script to include image from the Canadian
earthquake source. See: http://www.earthquakescanada.nrcan.gc.ca/recent_eq/maps/index_e.php?tpl_region=eon_wqc
(Pretty cute too and a little better for its legend)

Best regards,
Jacques
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Earthquake Registration Script
« Reply #4 on: November 30, 2012, 10:31:06 AM »
Hi Jacques,

For now I'll keep it as it is, although there might be some 'challenges' to be taken on...  :)

I received a reply from Ken as follows:

"I've not tried it, but combining quake-Canada.php and quake-json.php on the same page should be possible -- I don't think any function names overlap, but trying it is best 

The quake-json.php relies on a JSON-formatted feed from the USGS for its data. I see that the Environment Canada all-Canada list of quakes does provide a RSS (XML) feed of the data, so it should be possible to construct another Google map that uses that data, but I'm not sure that two Google maps with different data sources can coexist on the same page.. never tried that either 

Best regards,
Ken


I checked out the Canadian link, but those maps are very 'zoomed-in', since I've set my distance for measurements at 1000km, so I should need at least 3 maps  :)
I'll keep 'playing' on my XAMPP and see if there is a way to integrate a 'decent' map for the Ontario/Quebec region.

Cheers,

Arthur

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Earthquake Registration Script
« Reply #5 on: December 01, 2012, 07:49:48 AM »
Hi Arthur,

It's sure that maps from NR Earthquake site are intended for their needs
so they "cut" the whole Canada map to create their own "sub-map" and since
Ken's script is working with a radius around a particular location, you could
be between 2 maps!

That is the challenge when we want to do something out of the pack!  ;)
Now the way is to find some script that help to "pinpoint" a google map
to show your "spots"  on the map with custom pins! Google has an api
for that, but it is  a bit "hard" to implement. ???  ... see this link

But if you're lucky to find a "pinpoint script"...  ;)

Regards,
Jacques
Please, consider supporting this site