とらりもんHOME  Index  Search  Changes  Login

とらりもん - PostGIS Cookbook Diff

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

2018/11/22 Jin Katagi

{{toc}}
Solution when you can not run as book wrote

! Chap01
!! P10
You can get firenews.csv from https://github.com/PacktPublishing/PostGIS-Cookbook-Second-Edition/tree/master/Chapter01 .

You cannot unzip data.zip.001 and data.zip.002.

You can extract by using 7zip command:
$ sudo apt install p7zip-full p7zip-rar
$ 7z e data.zip.001
$ 7z e data.zip.002

!! P12
x $ psql -U me -d postgis_cookbook
o $ psql -d postgis_cookbook # by your user_name

x > CREATE EXTENSION postgis;
   ERROR:  permission denied to create extension "postgis"
o $ psql --username=postgres --dbname=postgis_cookbook -c "CREATE EXTENSION postgis;"
  
The default password of postgres user is "postgres"

!! P26
If it is the first time to connect PostGIS from QGIS, you should set some setting.
x Layer -> Add Layer -> Add PostGIS layers
o Layer -> Add Layer -> Add PostGIS layers -> New

Type
Name: db@localhost
Service:
Host: localhost
Port: 5432
database: postgis_cookbook

And click test, and type your name and password (if you made database as postgres user, then user name and password are postgres).

!! P27
You can't find "wborders.shp".
Instead, you can see 'TM_WORLD_BORDERS-0.3.shp'.

So, you should rename 'TM_WORLD_BORDERS-0.3.shp' to 'wborders.shp'.

!! P28
x SELECTST_AsText(the_geom) AS the_geom, bright_t31 FROM chp01.global_24h ORDER BY bright_t31 DESC LIMIT 100;
o SELECT ST_AsText(the_geom) AS the_geom, bright_t31 FROM chp01.global_24h ORDER BY bright_t31 DESC LIMIT 100;

!! P49
3.
$ rename 's/([0-9]+)/sprintf("%02d",$1)/e' *