Database Reference
In-Depth Information
postgis_cookbook=# SELECT
ST_AsText(the_geom) AS the_geom,
bright_t31
FROM chp01.global_24h
ORDER BY bright_t31 DESC LIMIT 100;
The output of the preceding command is as follows:
the_geom | bright_t31
--------------------------------------------------------------
POINT(-13361233.2019535
4991419.20457202) | 360.6
POINT(-13161080.7575072
8624445.64118912) | 359.6
POINT(-13359897.3680639
4991124.84275376) | 357.4
...
(100 rows)
5. YouwanttofigureoutinwhichAfricancountriesthesehotspotsarelocated.
For this purpose, you can do a spatial join with the africa_countries
table produced in the previous step:
postgis_cookbook=# SELECT
ST_AsText(f.the_geom) AS the_geom,
f.bright_t31, ac.iso2, ac.country_name
FROM chp01.global_24h as f
JOIN chp01.africa_countries as ac
ON ST_Contains(ac.the_geom,
ST_Transform(f.the_geom, 4326))
ORDER BY f.bright_t31 DESC
LIMIT 100;
The output of the preceding command is as follows:
Search WWH ::




Custom Search