[GRASSLIST:412] Re: GRASS How to- An Indian example

RAVI KUMAR ravivundavalli at yahoo.com
Mon Mar 27 06:50:22 EST 2006



Vishal Mehta <vishalm1975 at gmail.com> wrote:    Hi Ravi,
Like i said, all i have (relevant to this problem', are the 2 tables in a postgresql database. Table 'stations' is a list of 38 cities, WMOID,  lat, long and elevation. So one record for each city.
The 'data' table is a 10Mb file, containing, for each city, the WMOID and 7 variables.

I want to:
1. Use the 'station' table to create a simple point vector map. I dont know if i can do this using this table. One option i saw on the listserve is to export table as csv, then to use v.in.ascii.
  This should work, as DBF it self.

2. Then i want to link the  data table with the stations table. Previously i tried to use dbf. although i was able to connect the tables, i was not able to do any queries- my interpretation of the error message was that it did'nt like that the 'key' column i had identified, WMOID, has, obviously, many repetitions (see extract of data table in earlier message). So here i deduced that i dont know how to link the tables correctly. I had thought that i would use the WMOID column, in both station table and data table, as the link. I am not sure what exactly to do here to link the tables and be able to query it. 

3. The purpose of doing this, is finally to be able to write and run a script, where 
a) each variable, for each day, can become a separate vector map;
b) each vector map is converted to raster
c) and interpolated to cover my region of interest which would be India..

  I think even a dbf will work for U.
  So U need not wait to learn PGSQL for this
  
thanks,
vishal

Ravi Kumar
  On 3/27/06, RAVI KUMAR <ravivundavalli at yahoo.com> wrote:      Hi Vishal,
  I used ordinary google to take a lot of JPG images of nearly same scale.
  Then I have put then together through GIMP. Georeferrencing helped me
  make it a GRASS Raster data. The vectors followed by digitisation. A few labels here and there and THERE U have a GRASS Dataset.
   
  Ur data.........
  Pl give details.
  

  1.What are the GRASS data sets (Raster + Vector ) U have (created).
  2. Ur data shows from Amritsar to Agartala.. that is a Map of India itself,
      if Bangalore is added.
  3. GRASS uses DBF as default. Through open office U can manipulate this.
  4. If U are learning, PGSql, why dont U 1st experiment with just DBF instead.
      U can shift from DBF to PGSql after U master it. 
  5. v.in.ascii is easy to use on Ur GRASS data, from a cvs file, which U have attached 
      here.
  If Ur problems are not answered, then, Iam sure U need help on PGSql it self. 
  Do clarify
  Ravi Kumar

    

Vishal Mehta <vishalm1975 at gmail.com> wrote:
  Hi Ravi,
  
Nice example. One question, did you use the image from Google Earth the free version or the paid version that allows incorporating own data?

I looked at your India example and got the sense that you might be able to provide some insights into my vector data challenges. I am more familiar with raster GRASS operations so far.. I have my data in a postgresql database (something i am also just learning)
  
So far I have 2 tables in my postgresql database. One is my masterfile, a table called 'stations ' that looks like this: WMoID, city, lat, long

420710,AMRITSAR, 31.63,74.86
421010,PATIALA,30.33,76.46
421310,HISSAR,29.16,75.73
421820,DELHI,28.58,77.20

and i prepared a table called 'data', which looks like this (i'm copying from openoffice thats why it looks a bit strange): 

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          WMOID,N,10,0  CITY,C,50  YEAR,N,5,0  YDAY,N,4,0  TMAX,N,10,2  TMIN,N,10,2  TDAY,N,10,2  RAIN,N,10,2  VPD,N,10,2  SRAD,N,10,2  DAYLEN,N,10,0  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
    427240  Agartala  1995  1  26  8.5  21.19  0  1112.83  341.2  37998  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
    427240  Agartala  1995  2  24  7.39  19.43  0  1082.93  339.33  38019  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
    427240  Agartala  1995  3  22.72  4.89  17.82  0  1097.42  360.24  38041  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
    427240  Agartala  1995  4  24  4  18.5  0  1084.58  377.3  38065  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
    427240  Agartala  1995  5  25.11  5.22  19.64  0  1155.05  374.59  38091  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  

for each station.

What i want to do, and dont know how to (i looked at the GRASS online help which is just not enough for someone new to databases):
1. I want to use the 'stations' table to bring in as a vector map. Earlier, when i had the 'stations' as a csv file, i used v.in.ascii. i dont know what to use when its in a table in a pg database.

2. I also want to link the 'stations' to the 'data' table. i did this using v.db.connect and it seemed to work. But i dont know how its linking. When i had used v.in.ascii on a csv file, i had defined the WMOID as cat; and then in ' v.db.connect i had WMOID in the 'data' file be the key. But then it did'nt like it at all when i tried a SQL query- it seemed to not like having WMOID as the key, because it had duplicates. But how else can i link the 2 tables?

3. My final goal is to be able to write a script, where i can have every day's data from a particular column, become a vector map, then a raster using interpolation. To do this would i need my intial points vector file to be a 3d vector file?

any help would be great!
thanks,
vishal

  On 3/23/06, RAVI KUMAR < ravivundavalli at yahoo.com> wrote:       Hi,
  an indian example is here.
  http://freegis.gnu.org.in/grass_geosciencedataset.pdf 

    Ravi Kumar

    
  
---------------------------------
  Blab-away for as little as 1�/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.   





    
  
---------------------------------
  New Yahoo! Messenger with Voice. Call regular phones from your PC for low, low rates.   





		
---------------------------------
Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20060327/9e9489f4/attachment.html


More information about the grass-user mailing list