[GRASS-user] Re: grassuser Digest, Vol 11, Issue 55

Richard Chirgwin rchirgwin at ozemail.com.au
Sun Mar 25 04:08:03 EDT 2007


grassuser-request at grass.itc.it wrote:
> Message: 1
> Date: Sat, 24 Mar 2007 17:24:46 -0400
> From: Kurt Springs <ferret_bard at mac.com>
> Subject: [GRASS-user] Postgresql/postgis making databases
> To: grassuser at grass.itc.it
> Message-ID: <372DA460-DD8A-4C6D-8796-9317D9F94EFF at mac.com>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> Hi folks,
>
> I have finally gotten postgresql and postgis installed along with  
> pgadm3 on OS X 10.4.9, which leaves me at the point of "What Now?"
>
> Keep in that my familiarity is with Filemaker and Access, which, I am  
> sure every one will agree, are fairly "turn key" as the old  
> expression goes.  Potgresql is another matter.  I need someone's help  
> get to the next step.  I believe passwords and permissions need to be  
> sorted out, then In need to create my data bases.  I will need to  
> create tables, categories, populate the databases, and be able to  
> edit the information.  Also, I need to be able to move the database  
> file(s) from my desktop to my laptop.  Step by step instructions  
> would be best.
>
> I am planning on starting work on my PhD research this summer, and  
> would like to use postgresql/postgis to create and maintain my  
> archaeological database.
>
> Anyone's help would be appreciated.
>   
I'll try, although I am also relatively new to this.

First you'll need to get your connection sorted out. In Grass, this is 
in the db.Connect and db.Login modules (in the Mac interface, this is 
under the Databases menu item, Manage Databases).

In db.Connect, use Connect to Database to open the appropriate 
interface. Check the Postgres instructions in the Wiki here:
*http://grass.ibiblio.org/grass61/manuals/html61_user/pg.html

*This will show you what the Postgres interface expects for database 
name and host identification. If you're using the GUI, do *not* put 
quote marks around your hostname, driver, etc. If you are using a local 
database, then you will have host=localhost

Then use Login to Database for username and password.

Use db.tables -p to see if you're connected - you will get a list of 
tables in the "Output" panel if it's worked.

You will need to decide what you intend to store in Postgres, and how to 
connect it to mapping data. I'm still working on this, so regrettably I 
can't help here. Trying to associate population data with map regions is 
doing my head in ... If you have any suggestions I'd love it!

A final thought about database connections.

If you've imported maps (for eg, from MapInfo vector files, etc), then 
they will probably be stored in local dbf files. If you're using some 
local files and some Postgres files, then you need to swap your connect 
and login between the two.

In particular, this means remembering that the local login is:
driver=dbf
database name: $GRASSFILES/$LOCATION_NAME/$MAPSET/dbf/

This is *not* intuitive and is not explained anywhere in particular! 
...And also: if you have set a schema parameter for Postgres (don't know 
if you need to) then in the swap back to local, you need to clear this 
connection. Put a space into the Database Schema panel in the GUI to 
clear the schema to null.

Richard C
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 24 Mar 2007 16:30:05 -0500
> From: Seb <spluque at gmail.com>
> Subject: Re: [GRASS-user] 'where' sql command in d.vect and others
> To: grassuser at grass.itc.it
> Message-ID: <87odmie3du.fsf at patagonia.sebmags.homelinux.org>
> Content-Type: text/plain; charset=us-ascii
>
> On Sat, 24 Mar 2007 12:05:05 -0500,
> Seb <spluque at gmail.com> wrote:
>
> [...]
>
>   
>> However, the same doesn't work within the display manager with, for
>> instance, d.vect.  In that case, the 'where' parameter ends up within
>> braces in the actual call.
>>     
>
> Some more fiddling led me to find out the correct syntax in display
> manager:
>
> str_3='"W Arctic"'
>
> which creates a valid sql query and the map plots correctly.  However,
> this runs into another problem with d.out.file from a display of the
> queried map and says:
>
>
> Sorry <Arctic'> is not a valid option
>
>
> Could this be a bug?  If the 'where' statement does its job with this
> string, I would have expected d.out.file to work too.
>
>
> Cheers,
>
>   




More information about the grass-user mailing list