Author Topic: Seratoga Quake Scripts to add image layer  (Read 1420 times)

0 Members and 1 Guest are viewing this topic.

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Seratoga Quake Scripts to add image layer
« on: October 29, 2019, 05:53:02 AM »
Hello Sir ken,

I would like to ask if theres a way that I can insert image layer on maps for the quake script that can be also udjust its opacity? because I would like to insert a Philippine maps with latest FAULTLINES embedded, so that I can easily identify whic epicenter on map correlates with exact position of fauiltlines which may help easily to locate with.

below attach is our land with faultlines listed.

Thank You and Regards

-Mike-

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Seratoga Quake Scripts to add image layer
« Reply #1 on: October 29, 2019, 11:55:56 AM »
Hi Mike,
Can't really do that with a static map image, but... it may be possible to add an ArcGIS/ESRI dynamic layer with Philippine faults.
The data exists here and there's an ESRI plugin to Leaflet that likely can handle it.  I'll do a bit of exploring to see what might be done.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Seratoga Quake Scripts to add image layer
« Reply #2 on: October 29, 2019, 06:24:22 PM »
Well, that was a fun coding exercise.  I found a ArcGIS shapefile for Philippines earthquake faults, and the esri-leaflet.js plugin to enable easy usage, then spent several hours getting it all to work with the existing quake-json script base.

I've attached a set of files in the .zip that are all -ph.* named to not interfere with the existing quake-json set.  unzip to your home directory and wxquake-ph.php page should show the quakes AND the fault traces.  Clicking on a fault trace will bring up it's description.

Enjoy...
Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: Seratoga Quake Scripts to add image layer
« Reply #3 on: October 29, 2019, 06:53:43 PM »
 :shock: They will want it for everywhere now  #-o
Imagine what you will KNOW tomorrow !

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Seratoga Quake Scripts to add image layer
« Reply #4 on: October 29, 2019, 07:00:32 PM »
Funny... I was just pondering how to do that too... :)

There are some open ArcGIS feeds for other geographies .. The USGS has one, and I think GB and other European countries might just have them too.  I'll do some more exploring.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Seratoga Quake Scripts to add image layer
« Reply #5 on: October 29, 2019, 07:04:38 PM »
As always a great job and response Ken, you are the coding man  =D>

CW3699

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Seratoga Quake Scripts to add image layer
« Reply #6 on: October 30, 2019, 06:12:37 AM »
You're the Man ken,

fast replies, Great Job Ken, Its now updated on my web page there, but as I click each red lines, some still not updated, I hope i can change or add labes to each fault lines, because its important to identify what kind of fault line is, well I will see if theres any thing I can do to add labels inside ARCGIS to appear on the fault lines that doesnt have a label yet.


regards


-Mike-
« Last Edit: October 30, 2019, 10:13:20 AM by pimohdaimaoh »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Seratoga Quake Scripts to add image layer
« Reply #7 on: October 30, 2019, 12:42:16 PM »
Mike,
The data about the faults comes solely from the ArcGIS published source (see description at https://www.arcgis.com/home/item.html?id=e4b2bc9b68254609b5965b16163eba3b )  You can browse the map/data at https://www.arcgis.com/home/webmap/viewer.html?layers=e4b2bc9b68254609b5965b16163eba3b - click on the table icon to see the raw descriptions.  Not all the faults have names, and you can't edit the data-only display it. (sorry).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Seratoga Quake Scripts to add image layer
« Reply #8 on: October 30, 2019, 01:05:41 PM »
Ah ok Ken, get it now at least it is now useful to locate near faultline of most quake pressures

Regards

-Mike-

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: Seratoga Quake Scripts to add image layer
« Reply #9 on: October 31, 2019, 03:06:06 AM »
@Ken ....

Hmm .. looking at the geojson file it is straightforward enough, but I assume the ESRI 'plug in' is a wee bit convoluted and won't let you host your own copy.

Would it be possible to use mouse hover instead of click for that (faults) layer  tooltip ?
Imagine what you will KNOW tomorrow !

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Seratoga Quake Scripts to add image layer
« Reply #10 on: October 31, 2019, 11:21:52 AM »
I've managed to capture Leaflet and the ESRI-leaflet plugins so you won't have to rely on an external CDN for that source.

I've been working with three fault sources: the Phillippine one above, a USGS source for CONUS faults, USGS Worldwide Plate boundaries, and a GEM source (in geoGSON) for world-wide fault info.   I'm just polishing up the script set for release.  Screen captures shown below.

I've not yet been able to add mouseover tooltip display for the faults, but I'm giving it a try too.  Right now, clicking on a fault will display the data in a popup as shown.

The Layer control box has check-boxes to turn on/off the Faults and/or Plates displays.
« Last Edit: October 31, 2019, 11:25:27 AM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: Seratoga Quake Scripts to add image layer
« Reply #11 on: October 31, 2019, 11:41:26 AM »
Quote
... won't let you host your own copy.
Sorry, I was a bit hazy about that.
I meant, locally host the geojson file - Then eg. Mike would be able to modify name / description of the fault lines.
Imagine what you will KNOW tomorrow !

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Seratoga Quake Scripts to add image layer
« Reply #12 on: October 31, 2019, 12:52:55 PM »
Ahh... The PH map is not done via geoJSON, it's done as a L.esri.featureLayer from the services.arcgis.com server, so it's not possible to edit.

Likewise, the USGS Faults are done via L.esri.dynamicMapLayer from maps1.arcgisonline.com, and the USGS Plates done as L.tileLayer from earthquake.usgs.gov/basemap/tiles/plates .  Unfortunately, there's a CORS restriction on using the Mapserver/Features on the USGS direct earthquake.usgs.gov parts that prevent it's use.  Nifty and full USGS fault data is viewable via an ArcGIS viewer app, but the underlying data is not available to other scripts due to CORS.

The only geoGSON use (via L.geoJSON and XHR request to the raw.github source) is for the World faults data.
Their GitHub distribution and viewer do not have an associated mapserver, so it had to be produced dynamically from their geoJSON  raw data

I'm lothe to allow arbitrary mods to underlying data (like names of faults, or lack thereof) as I feel the owner of the data should be the source of that information .. it's the data distributors responsibility afterall.
« Last Edit: October 31, 2019, 01:02:58 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: Seratoga Quake Scripts to add image layer
« Reply #13 on: October 31, 2019, 11:29:09 PM »
Quote
The only geoGSON use (via L.geoJSON and XHR request to the raw.github source) is for the World faults data.
Their GitHub distribution and viewer do not have an associated mapserver, so it had to be produced dynamically from their geoJSON  raw data
That seems to be the way I'd go. Although you may want to put a loading whirly somewhere  :grin:. They do suggest cloning the file (presumably because of the payload ?).

Using that option, you could go the example way and dumping all data in the tooltip, or being selective (Probably users will want all data just because it's there  ](*,) )

In the main I agree with the editing rationale, although I have had cause to do that with github countries outlines, where many smaller island states were missing - took forever !
Imagine what you will KNOW tomorrow !

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Seratoga Quake Scripts to add image layer
« Reply #14 on: October 31, 2019, 11:35:57 PM »
Mike,
The data about the faults comes solely from the ArcGIS published source (see description at https://www.arcgis.com/home/item.html?id=e4b2bc9b68254609b5965b16163eba3b )  You can browse the map/data at https://www.arcgis.com/home/webmap/viewer.html?layers=e4b2bc9b68254609b5965b16163eba3b - click on the table icon to see the raw descriptions.  Not all the faults have names, and you can't edit the data-only display it. (sorry).

Oh I see, thats bad since upon checking at PHIVOLCS data, most of it are already labelled, but since it cannot be edited I hope the uploader on ARCGIS updated the labels.

Thanks and regards

-Mike-

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Seratoga Quake Scripts to add image layer
« Reply #15 on: October 31, 2019, 11:45:58 PM »
I've managed to capture Leaflet and the ESRI-leaflet plugins so you won't have to rely on an external CDN for that source.

I've been working with three fault sources: the Phillippine one above, a USGS source for CONUS faults, USGS Worldwide Plate boundaries, and a GEM source (in geoGSON) for world-wide fault info.   I'm just polishing up the script set for release.  Screen captures shown below.

I've not yet been able to add mouseover tooltip display for the faults, but I'm giving it a try too.  Right now, clicking on a fault will display the data in a popup as shown.

The Layer control box has check-boxes to turn on/off the Faults and/or Plates displays.

I see most of GEM source are more detailed than o ARCGIS geoGSON, take your time ken at least it gives you another challange regarding this additives in quake scripts. Will wait for the results.


Regards

-Mike-

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Seratoga Quake Scripts to add image layer
« Reply #16 on: November 13, 2019, 05:00:33 AM »
Quote
The only geoGSON use (via L.geoJSON and XHR request to the raw.github source) is for the World faults data.
Their GitHub distribution and viewer do not have an associated mapserver, so it had to be produced dynamically from their geoJSON  raw data
That seems to be the way I'd go. Although you may want to put a loading whirly somewhere  :grin:. They do suggest cloning the file (presumably because of the payload ?).

Using that option, you could go the example way and dumping all data in the tooltip, or being selective (Probably users will want all data just because it's there  ](*,) )

In the main I agree with the editing rationale, although I have had cause to do that with github countries outlines, where many smaller island states were missing - took forever !


Hey Betel, I send yo a PM, hope you can assit me. Thanks

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Seratoga Quake Scripts to add image layer
« Reply #17 on: November 13, 2019, 09:04:07 PM »
I've finished adding tectonic plate and fault maps display (along with two new free maps: NatGeo and Delorme) to quake-json scripts V3.00 -13-Nov-2019

Standalone users: download the .zip file or use the GitHub distribution
Saratoga template users: Use the update tool page with a query of Base-*, *-Plugin, 13-Nov-2019

The script now includes 3 USGS fault displays, one Phillippines display, two Worldwide displays, and one UK-BGS display.
The plate display is from the USGS.

See the attached for sample image outputs.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline wxthomson

  • Senior Member
  • **
  • Posts: 85
    • http://www.minnetonkaweather.com
Re: Seratoga Quake Scripts to add image layer
« Reply #18 on: November 13, 2019, 09:22:26 PM »
Ken,

Is there anyway you could bottle up your coding skills and sell them?

I'm sure there are many of us here that would love to have them!

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Seratoga Quake Scripts to add image layer
« Reply #19 on: November 14, 2019, 04:38:12 AM »
I've finished adding tectonic plate and fault maps display (along with two new free maps: NatGeo and Delorme) to quake-json scripts V3.00 -13-Nov-2019

Standalone users: download the .zip file or use the GitHub distribution
Saratoga template users: Use the update tool page with a query of Base-*, *-Plugin, 13-Nov-2019

The script now includes 3 USGS fault displays, one Phillippines display, two Worldwide displays, and one UK-BGS display.
The plate display is from the USGS.

See the attached for sample image outputs.

Best regards,
Ken


Fantastic Ken, Thank You for this, this will explains to my follower very clearly on my page because its already indicated on the fault system. Thank You so much ken, will try this


Regards

-Mike-

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Seratoga Quake Scripts to add image layer
« Reply #20 on: November 14, 2019, 05:43:40 AM »
This is great, Ken!  Up and running on my site.

Many thanks :!: \:D/ =D> \:D/
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2429
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: Seratoga Quake Scripts to add image layer
« Reply #21 on: November 16, 2019, 04:06:02 AM »
Up and running on my site.

Many thanks :!: \:D/ =D> \:D/

The map doesn't show many fault lines, especially for Oklahoma.

Here is how a fault line map of Oklahoma looks.  Oklahoma is riddled with them.


Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Seratoga Quake Scripts to add image layer
« Reply #22 on: November 16, 2019, 01:58:01 PM »
The faults from the USGS GIS mapservers don't seem to have the data from the Oklahoma Geologic Service.  The OGS doesn't seem to offer an online mapservice with that data.. sorry.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Seratoga Quake Scripts to add image layer
« Reply #23 on: November 16, 2019, 08:35:43 PM »
I hope tsunami warnings too will smeday add on ken's quake scripts, it doesnt mean im too demanding hehehe well its only on my imagination if is possible too.

 

anything