|
Replies:
26
-
Pages:
2
[
1
2
| Next
]
-
Last Post:
Feb 25, 2013 6:01 AM
by: griffilo
|
Threads:
[
Previous
|
Next
]
|
|
Posts:
66
Registered:
7/7/09
|
|
|
|
Errors and Corrections
Posted:
Jan 4, 2011 10:09 PM
|
|
Please post all errata here.
|
|
Posts:
6
From:
New Jersey
Registered:
11/20/10
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 19, 2011 7:18 PM
in response to:
luke.bace
|
|
In chapter 1, after importing the shapfile.
I added geom attribute based on the script below: SELECT AddGeometryColumn('ch01', 'roads', 'geom', 2163, 'MULTILINESTRING',2);
Then.... The following script generates an error. UPDATE ch01.roads SET geom = ST_Transform(geom_4269, 2163); //------------------------------------------------------------------- ERROR: Input geometry has unknown (-1) SRID SQL state: XX000 //------------------------------------------------------------------ I am not sure why it is doing it. SRID -> 2163 is valid Any help would appreciate it. Chris
|
|
Posts:
211
Registered:
5/6/09
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 19, 2011 8:33 PM
in response to:
Greener
|
|
Check to make sure your geom_4269 has an SRID other than 0 or -1.
SELECT ST_SRID(geom_4269) from ch01.roads;
If it doesn't have a alid srid, then I think ST_Transform gives that error because it wouldn't know the formula to use to transform from unknown to 2163.
What command did you use to import the table or did you use the gui loader? Its possible you missed the -s 4269 switch or there is a bug in the loader version you have.
If that is the case, the easy remedy is to do this instead:
UPDATE ch01.roads SET geom = ST_Transform(ST_SetSRID(geom_4269,4269), 2163);
|
|
Posts:
211
Registered:
5/6/09
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 19, 2011 8:35 PM
in response to:
regina.leo
|
|
slight correction:
SELECT DISTINCT ST_SRID(geom_4269) from ch01.roads;
|
|
Posts:
6
From:
New Jersey
Registered:
11/20/10
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 21, 2011 4:40 PM
in response to:
regina.leo
|
|
Hello Regina, I used to GUI PostGIS shapeloader tool. You are correct that I had value -1. I used your update sql and it worked. I was able to perform the rest of other queries in the chapter 1. Onto the chapter 2... Excellent book; and very happy that you are present on the forum.
Thank you for your assistance. Chris
|
|
Posts:
13
Registered:
12/30/10
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 26, 2011 4:02 AM
in response to:
luke.bace
|
|
After the code in listing 5.12:
There are three import things about using DISTINCT ON.
maybe important?
|
|
Posts:
211
Registered:
5/6/09
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 26, 2011 5:14 AM
in response to:
Gyula_58
|
|
Thanks. -- that one slipped by too
|
|
Posts:
13
Registered:
12/30/10
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 31, 2011 1:56 AM
in response to:
regina.leo
|
|
Example in App.C.
SELECT c.city_name FROM city As c LEFT JOIN airports As a ON a.city_code=c.city_code WHERE a.airport_code IS NULL;
text in bold is missing from the code
|
|
Posts:
13
Registered:
12/30/10
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 31, 2011 2:10 AM
in response to:
Gyula_58
|
|
Chapter 7.
ogr2ogr -f "MapInfo file" /gisdata/biketrip.tab PG:"host=localhost user=postgres port=5432 dbname=postgis_in_action password=mypassword" –select "SELECT track_seg_point_id, ele, time" -where "time BETWEEN '2009-07-18 04:33-04' AND '2009-07-18 04:34-04'" staging.aus_biketrip_narangba
SELECT in bold is needless and the same applies to the similar KML example as well. After correcting the select surplus, the script was not still operating, I suppose because of the format of timestamps, but I did not have more time to play with it.
|
|
Posts:
13
Registered:
12/30/10
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 31, 2011 2:58 AM
in response to:
Gyula_58
|
|
Appendix C
SELECT p.product_name, s.state, p.base_price * (1 + s.tax) As total_price FROM products AS p CROSS JOIN state AS s; -- 1 Can also be written as
SELECT p.product_name, s.state,p.base_price * (1 + s.tax) As total_price FROM products AS p, state AS s
...added the part in bold still is necessary...
|
|
Posts:
13
Registered:
12/30/10
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 31, 2011 4:31 AM
in response to:
Gyula_58
|
|
Appendix C.
SELECT c.last_name, c.first_name, r.rental_id, p.amount, p.payment_date FROM customer As C INNER JOIN rental As r ON C.customer_id = r.customer_id LEFT JOIN payment As p ON (p.customer_id = r.customer_id AND p.rental_id r.customer_id);
Well, AND requires boolean data types on both sides. I guess, neither p.rental_id nor r.customer_id are boolean values, so something must be missing here...
|
|
Posts:
211
Registered:
5/6/09
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 31, 2011 5:33 AM
in response to:
Gyula_58
|
|
Good catch. Thanks.
|
|
Posts:
211
Registered:
5/6/09
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 31, 2011 6:12 AM
in response to:
Gyula_58
|
|
We seem to have made the same mistake with the KML one.
Regarding the other issue you are having why its still not working. I'm afraid its the evils of MS Word at work. Somewhere along the line, I think it replaced our - with a smart dash and the " possibly with smart quotes.
|
|
Posts:
13
Registered:
12/30/10
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 31, 2011 7:47 AM
in response to:
Gyula_58
|
|
Appendix C.
SELECT n.nei_name, SUM(ST_Length(road.the_geom)) as total_road_length, ST_Extent(road.the_geom) As total_extent, COUNT(DISTINCT road.road_name) As count_of_roads FROM neighborhoods As n INNER JOIN roads ON ST_Intersects(neighborhoods.the_geom, roads.the_geom) WHERE n.city = 'Boston' GROUP BY n.nei_name HAVING ST_Area(ST_Extent(road.the_geom)) > 1000;
the table names underlined in the code should be roads...
|
|
Posts:
2
Registered:
3/5/11
|
|
|
|
Re: Errors and Corrections
Posted:
Mar 5, 2011 6:32 PM
in response to:
luke.bace
|
|
3.3 (Using rules and triggers). Minor but...
The two mechanism for handling the conditional
Should be mechanisms
|
|
|
Legend
|
|
Gold: 300
+
pts
|
|
Silver: 100
- 299
pts
|
|
Bronze: 25
- 99
pts
|
|
Manning Author
|
|
Manning Staff
|
|