Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a vector file containing the river lines of an area. I want to extract a specific water line from the vector. I used: v.db.select but it only displayed:

   cat|F_CODE_DES|HYC_DESCRI|NAM|ISO|NAME_0
    1|River/Stream|Perennial/Permanent|UNK|PHL|Philippines
    2|River/Stream|Perennial/Permanent|UNK|PHL|Philippines
    3|River/Stream|Perennial/Permanent|UNK|PHL|Philippines
...

then i used v.extract to select a specific area and it displayed this error:

v.extract input=vector_waterLines@PERMANENT output=vector_1 where=1             
DBMI-DBF driver error:
ERROR: Unable select records from table <vector_waterLines>
share|improve this question

1 Answer 1

up vote 3 down vote accepted

The where switch should be an SQL statement. From the GRASS manual:

where=sql_query WHERE conditions of SQL statement without 'where' keyword Example: income < 1000 and inhab >= 10000

For example, if you want to extract only perennial streams:

v.extract input=vector_waterLines@PERMANENT output=vector_1 where="HYC_DESCRI = 'Perennial/Permanent'"

share|improve this answer
    
I want to extract only a specific line, but I'm not sure what is the label of that line. I tried v.extract input=vector_waterLines@PERMANENT output=vector_2 where="cat = '3'" but it displayed: DBMI-DBF driver error: ERROR: Unable select records from table <vector_waterLines> –  teamAngat Mar 16 '11 at 14:17
    
the names in the database of my vector file have several "UNK" (unknown) values. That is why I cannot query well. Is there a site wherein I can download another vector file for the river lines? I got mine from (diva-gis.org/gdata) or is it possible for me to extract a specific river line since I can pinpoint it in the GIS Map display? –  teamAngat Mar 16 '11 at 14:25
    
I'm pretty sure you can extract specific vector lines using the cat values. There must be something wrong with your dbf tables. –  maning Mar 17 '11 at 2:10
    
Regarding river lines, I haven't seen diva-gis' data but you can get very good river lines on selected areas of the Philippines in Openstreetmap. –  maning Mar 17 '11 at 2:11
    
I searched for the Openstreetmap and it was just viewable and cannot be downloaded in order to be opened in GRASS as a vector –  teamAngat Mar 17 '11 at 6:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.