[GRASSLIST:801] Live Earthquake Map: GRASS/PHP

Hi,

just some fun:

http://grass.itc.it/spearfish/php_grass_earthquakes.php
Recent Earthquakes: map generated by GRASS on the fly with PHP

Not nice (yet) but working in real time.

Cheers

Markus

Nicie!

I only suggest to generate maps from crontab every 5 min or so and not
on-fly. It would make it work faster and lower load on server.
(Imagine posting link on /. :wink:

Maris.

On 4/21/06, Markus Neteler <neteler@itc.it> wrote:

Hi,

just some fun:

http://grass.itc.it/spearfish/php_grass_earthquakes.php
Recent Earthquakes: map generated by GRASS on the fly with PHP

Not nice (yet) but working in real time.

Cheers

Markus

just some fun:

http://grass.itc.it/spearfish/php_grass_earthquakes.php
Recent Earthquakes: map generated by GRASS on the fly with PHP

Not nice (yet) but working in real time.

neat. Maybe change the color rule to move ocean -> black down to 5-8 km
instead of 500m? (that color scale was designed for showing detail in
the coastal shelf)

For finer-grained circle sizes, with ps.map you can use the sizecol
option with the vpoints command. Or d.vect.chart can do this, or
'v.buffer bufcol='.

maybe better to plot circles as e^boom as it's based on a log scale?

Hamish

ps - I know one of those circles quite well. :slight_smile:

On Sat, Apr 22, 2006 at 08:54:43PM +1200, Hamish wrote:

> just some fun:
>
> http://grass.itc.it/spearfish/php_grass_earthquakes.php
> Recent Earthquakes: map generated by GRASS on the fly with PHP
>
>
> Not nice (yet) but working in real time.

neat. Maybe change the color rule to move ocean -> black down to 5-8 km
instead of 500m? (that color scale was designed for showing detail in
the coastal shelf)

I just grabbed the Blue Marble via r.in.wms. So it won't be that
easy to modify the color table.

For finer-grained circle sizes, with ps.map you can use the sizecol
option with the vpoints command. Or d.vect.chart can do this, or
'v.buffer bufcol='.

maybe better to plot circles as e^boom as it's based on a log scale?

I liked the d.vect.thematic, maybe improve this?
For now I have used the "nint" parameter to define more classes. For
unknown reasons the use of
  themecalc="custom_breaks" breakpoints="0 1 2 3 4 5 6 7 8 9 10"
fails in the PHP script (no time now to investigate) which would be
better.

I also tried to play with the where option to recolor the circles
on their age as USGS does. But I didn't come up with a working
SQL statement (to select field values minus some days etc). The use
of v.reclass would be good, but one has to figure out how to do
classification on dates.

Hamish

ps - I know one of those circles quite well. :slight_smile:

:slight_smile:

Markus

On Fri, Apr 21, 2006 at 09:51:34PM +0300, M?ris Narti?s wrote:

Nicie!

I only suggest to generate maps from crontab every 5 min or so and not
on-fly. It would make it work faster and lower load on server.
(Imagine posting link on /. :wink:

No bad idea. But next week we'll hopefully substitute the
server to a new machine. Currently it takes 4 seconds on the old
500MHz grass.itc.it, the new server will be happy to do it in
real time :slight_smile:
Then I'll also add to make a smaller map with the option to
enlarge it. The smaller static map will then be linked into
the snapshot section. Coming soon, once the server is migrated.

Markus

Maris.

On 4/21/06, Markus Neteler <neteler@itc.it> wrote:
> Hi,
>
> just some fun:
>
> http://grass.itc.it/spearfish/php_grass_earthquakes.php
> Recent Earthquakes: map generated by GRASS on the fly with PHP
>
>
> Not nice (yet) but working in real time.
>
> Cheers
>
> Markus
>
>

--
Markus Neteler <neteler itc it> http://mpa.itc.it
ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy

> I only suggest to generate maps from crontab every 5 min or so and not
> on-fly. It would make it work faster and lower load on server.
> (Imagine posting link on /. :wink:

I would second Maris' suggestion...
I was tempted to post in to /. =D

Other than that, great work.
--
Paulo Marcondes = PU1/PU2PIX
-22.915 -42.229 = GG87vc (http://www.amsat.org/cgi-bin/gridconv)
Debian GNU/Linux = http://rj.debianbrasil.org = http://www.debian.org

On Mon, Apr 24, 2006 at 08:44:21AM -0300, pmarc wrote:

> > I only suggest to generate maps from crontab every 5 min or so and not
> > on-fly. It would make it work faster and lower load on server.
> > (Imagine posting link on /. :wink:

I would second Maris' suggestion...
I was tempted to post in to /. =D

Other than that, great work.

Did you try in the last 12 hours? I changes a bit (and
observe a nice USGS map bug with only negative Longitudes...)

I think that 2-3 seconds are acceptable - or how long does
it take for you? My intention was to show real-time processing,
not a batched one. Again, with the new server I try to reach
the millisecond range :slight_smile:

Markus

Did you try in the last 12 hours? I changes a bit (and
observe a nice USGS map bug with only negative Longitudes...)

Yep, I tried this morning (it's still morning =D)

I think that 2-3 seconds are acceptable - or how long does
it take for you? My intention was to show real-time processing,
not a batched one. Again, with the new server I try to reach
the millisecond range :slight_smile:

Something in that range...
Except that now, at first no eathquakes were shown on the small map.
then, the hi-res image was showing lots of them...

I noticed that the grass/php map does not show anything below 0
latitude, the same as the USGS list, but not the same as USGS map...

I'm not sure if you were refering to that...

cheers.
--
Paulo Marcondes = PU1/PU2PIX
-22.915 -42.229 = GG87vc (http://www.amsat.org/cgi-bin/gridconv)
Debian GNU/Linux = http://rj.debianbrasil.org = http://www.debian.org

> > I only suggest to generate maps from crontab every 5 min or so and
> > not on-fly. It would make it work faster and lower load on server.
> > (Imagine posting link on /. :wink:

I would second Maris' suggestion...
I was tempted to post in to /. =D

Other than that, great work.

This is more appropriate for slashgeo I think, http://slashgeo.org

Anyway, if anyone posts anything to shashdot, for maximum benefit please
wait until a few weeks after a new release and link to one of the big
website mirrors, not the main grass.itc.it server :slight_smile:

If you were going to link to e.g. ibiblio even, it might be nice to tell
them in advance.

Hamish

> > http://grass.itc.it/spearfish/php_grass_earthquakes.php
> > Recent Earthquakes: map generated by GRASS on the fly with PHP

..

> For finer-grained circle sizes, with ps.map you can use the sizecol
> option with the vpoints command. Or d.vect.chart can do this, or
> 'v.buffer bufcol='.
>
> maybe better to plot circles as e^boom as it's based on a log scale?

I liked the d.vect.thematic, maybe improve this?

I haven't touched d.vect.thematic but it can be done a bit simpler now,
I've just added symbol support to d.graph. (via a new D_symbol() library fn)
Some time ago d.mapgraph was merged into d.graph as well (-m).

For now I have used the "nint" parameter to define more classes. For
unknown reasons the use of
  themecalc="custom_breaks" breakpoints="0 1 2 3 4 5 6 7 8 9 10"
fails in the PHP script (no time now to investigate) which would be
better.

Don't know.

I also tried to play with the where option to recolor the circles
on their age as USGS does. But I didn't come up with a working
SQL statement (to select field values minus some days etc). The use
of v.reclass would be good, but one has to figure out how to do
classification on dates.

Probably have to do a little YYYYMMDD -> julian day or YYYY.YYYYYY
conversion first, then floating point classification. Maybe a SQL
guru knows an easier way..

I notice on the USGS page they center the world on 180 lon. May I
suggest the same for your map? "g.region w=0 e=360"

oops, that won't work anymore.. the >90 lat tweak broke it:
G61> g.region w=0 e=360
G61> d.redraw
WARNING: Fixing subtle input data rounding error of east boundary
         (180>1e-06)
G61> g.region -p
WARNING: Fixing subtle input data rounding error of east boundary
         (180>1e-06)
projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 90N
south: 90S
west: 0
east: 180E
nsres: 0:05
ewres: 0:05
rows: 2160
cols: 2160

This needs to be fixed, lon needs to be able to go up to 360
(remember mars example...)

The previous code allowed you to go endlessly east or west on input, so
just rip out east/west boundary fixes? (ie only keep >90lat fix)

Hamish