rhurlin (9) [Avatar] Offline
Before chapter 1.6 the tables 'fastfoods', 'lu_franchises', 'roads' and 'roads_geog' were successfully created. After that, in chapter 1.6.1 the proximity queries want to use fields like ft.franchise_name, ff.ff_id etc. This fields are not existent at this time.

In 1.6. there is only a small textually hint, that 'we transformed all the disparate data sets into a common planar spatial reference system, ...'.

As far as I can see there is no example code for this. Is this intended? Because I am new to PostGIS it would be a great help to have some code for it.


P.S.: I really like the practically orientated way of the book.
regina.leo (265) [Avatar] Offline
Re: [CH01] 1.6 Transforming into common planar spatial reference system

Regarding section 1.6 -- the ff and ft are SQL alias for the tables. It's mostly for saving typing and writing a shorter query. Check out Appendix C for explanation of aliasing.

So for example in FROM we have "ch01.fastfoods As ff" "ch01.lu_franchises As ft"

We have francise_name in the lu_franchises table.

The transformation referred to in 1.6 is the code in Listing 1.4. There we transform the orginal data from NAD 83 longitude latitude (4269 which is pretty close to WGS 84 long lat that is commonly used in GPS) -- to National Atlas LAEA (2163) - a meter based spatial reference more or less accurate for North America.

Glad you like the book so far and I hope the above explanation is clear.

rhurlin (9) [Avatar] Offline
Re: [CH01] 1.6 Transforming into common planar spatial reference system
many thanks for the very fast and detailed answer. Yes, your explanation is clear.

I just became aware of the aliases for myself. So the code in 1.6.1 works without creating any new fields or indexes before.

Sorry for the noise.