[GRASSLIST:4848] Re: transition probability

Michael Barton michael.barton at asu.edu
Tue Nov 16 10:51:27 EST 2004


Dylan,

Thanks for summarizing this. I've tried to follow this and more or less see
what you did, although I'd actually need to go through it to really
understand it.

I've got a similar, but slightly different problem. I will be trying to
figure out how to do it, but hope you or someone else out there can suggest
a solution. It is a general problem that many people might run into.

I have a lot of CAD maps that are digitizations in MicroCAD (*.dgn) of
topographic maps from an area in Spain. When I import them in v.in.ogr, I
get the vector shapes I need. However, the attributes that need to be
attached to the vectors are actually attached to points that mark where the
CAD folks put the label for the vector shape. So, for example, for each
topographic line, I have a nice line without an attribute and a point
somewhere near the line with the elevation value. The same goes for roads,
streams, etc. I can extract each kind of vector shape and each kind of point
to separate maps. 

I've done this for areas, but these are lines. I suspect that I can
associate points with their vector shapes  geographically by giving each
point a tiny buffer so that it overlays the associated line. But where do I
go from here? If I could get the relevant line cat value into the proper
point attribute table, I could reconnect the lines to the attributes, but
I'm not quite sure how to do this.

I am hoping for a systematic solution that I can put into a shell script to
process these many maps.

Thanks for any advice.

Michael Barton

On 11/15/04 11:26 AM, "Dylan Beaudette" <dylan at iici.no-ip.org> wrote:

> On Monday 15 November 2004 01:01 am, you wrote:
>> You have to join the tables in Postgres.
>> I hope to add join table to v.overlay later.
>> 
>> Radim
> 
> Thanks for the tip Radim.
> 
> I was able to get the tables joined and re-attached to the vector layers by
> using MySQL.
> 
> if anyone is interested, I have started documenting the process here;
> http://169.237.35.250/~dylan/grass_and_tp/
> 
> i have noticed that the attribute management section on the GRASS 57 tutorial
> that -pertains to MySQL is empty. I would be willing to add to that section
> if anyone is interested.
> 
> Thank again!
> 
> Dylan
> 
>> Dylan Beaudette wrote:
>>> On Saturday 13 November 2004 12:45 am, you wrote:
>>>> Dylan Beaudette wrote:
>>>>> If it hasn't, I am wondering if there are a couple of vector commands
>>>>> that could do the following:
>>>>> 
>>>>> given an input polygon map of several categories, and a line drawn
>>>>> across these categories,
>>>>> 
>>>>> 1. sample the polygon boundaries(and their respective category) that the
>>>>> line intersects
>>>>> 
>>>>> 2. put the above information into a new vector line that contains line
>>>>> segments that have an attribute that matches the category of the polygon
>>>>> that they intersected.
>>>> 
>>>> v.overlay
>>>> 
>>>> Radim
>>> 
>>> Seems that I just figured out the answer to my last question in regards
>>> to line vector types.
>>> 
>>> However, I now have another perhaps more complicated problem..
>>> 
>>> i have two maps:
>>> 
>>> t_1 = line map containing a single line
>>> 
>>> fresno_west = ploygon map with many polygons, and mulitple attributes per
>>> polygon:
>>> -------------------------
>>>  db.describe -c fresno_west
>>> Column 1: cat
>>> Column 2: AREA
>>> Column 3: PERIMETER
>>> Column 4: CA653_A_
>>> Column 5: CA653_A_ID
>>> Column 6: MUSYM
>>> Column 7: MUKEY
>>> ...
>>> ------------------------------
>>> when i use v.overlay with ainput=t_1 atype=line binput=fresno_west
>>> btype=area output=r_1 operator=and ...
>>> I get a map with the following attribute columns:
>>> ---------------------------
>>> db.describe -c r_1
>>> Column 1: cat
>>> Column 2: cata
>>> Column 3: catb
>>> ---------------------------
>>> 
>>> this is almost what i want, as each of the line segments in the resulting
>>> map (r_1) is labeled with the category number corresponding to the
>>> polygon that it intersected in the catb attribute column:
>>> (http://basho.dept-lawr.ucdavis.edu/~dylan/temp/tp1.png)...
>>> 
>>> this is great, but i need to join the attributes from the original
>>> polygon file to the new line file r_1. i imagine that it would be a join
>>> on: r_1.catb ---> fresno_west.cat
>>> ...which should then allow corresponding attributes from fresno_west (the
>>> polygon layer) to be connected to r_1 (the output from v.overlay)...
>>> 
>>> i am able to connect the attribute table from fresno_west to r_1 with the
>>> command;
>>> v.db.connect map=r_1 table=fresno_west key=catb field=2 -o
>>> 
>>> ...but this does not produce the results that i am looking for as the
>>> fresno_west table does not contain a 'catb' column...
>>> 
>>> .... perhaps I am not fully comprehending the GRASS 57 vector attribute
>>> system.. any ideas?
>>> 
>>> many thanks!

______________________________
Michael Barton, Professor of Anthropology
School of Human, Evolution and Social Change
Arizona State University
Tempe, AZ  85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton




More information about the grass-user mailing list