[GRASS-user] Help: Completely confused about multi-layered vectors
trying to import TIGER/Line files
Moritz Lennert
mlennert at club.worldonline.be
Thu Feb 28 16:13:53 EST 2008
On 28/02/08 20:12, Tom Russo wrote:
> On Thu, Feb 28, 2008 at 06:54:09PM +0100, we recorded a bogon-computron collision of the <mlennert at club.worldonline.be> flavor, containing:
>> On 28/02/08 16:39, Tom Russo wrote:
>>> I have been trying to wrap my brain around "multi-layered" GRASS vectors and
>>> have only succeeded in wrapping my brain into knots. Perhaps someone here
>>> with a solid understanding of this stuff can help me.
>>>
>> [...]
>>
>>> Since I'm rambling now, I'll just cut to the chase and ask my question:
>>>
>>> Given a GRASS vector with two attached database tables, one of which (layer
>>> 2, attaching attributes to centrois) has a key field POLYID, how can I
>>> create a new layer using a third, much smaller table, that also has a
>>> POLYID field, such that the new layer only contains that subset of
>>> centroids where the third layer table's POLYID matches layer 2's POLYID
>>> for that centroid?
>>>
>>
>> I think at this stage your best bet is probably to do something like this:
>>
>> v.category OldMap option=add layer=3 out=NewMap
>>
>> #find a link between the category numbers created and the original
>> # categories, this should work:
>>
>> v.build OldMap option=cdump > TempFile
>>
>> # You will have to edit TempFile to only take into account layer 2 and
>> # then find a way to import the results into your database
>
> With the potential for tens of thousands of records, anything
> involving manually editing a dump of categories seems an unworkable solution.
With awk / sed magic this should not be too complicated to automate...
Moritz
More information about the grass-user
mailing list