[GRASS-user] Help: Completely confused about multi-layered
vectors trying to import TIGER/Line files
Tom Russo
russo at bogodyn.org
Thu Feb 28 14:12:37 EST 2008
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.
> v.db.connect -o NewMap layer=3 table=NewTable
>
> #to remove all centroids you do not want:
> v.edit tool=delete
> or
> v.extract
>
> There might be an easier way, though...
I sure hope so.
> I think that you also might want to file a few wishes in the tracker, such
> as:
>
> - extend v.category with an option to use a column linked to an existing
> layer as the cat for a new layer
> - allow v.extract to write the results to another layer of the same file
> instead of a different file
> - extend v.patch to allow to patch different maps into different layers of
> the output map
> - create a v.copy.layers to copy elements of one layer to another
Once I actually understand the steps of what I really need to do, then
perhaps I could intelligently formulate a real wish for the tracker.
At this point I'm simply adrift in a sea of v. and db. commands and
SQL queries with no compass.
--
Tom Russo KM5VY SAR502 DM64ux http://www.swcp.com/~russo/
Tijeras, NM QRPL#1592 K2#398 SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
one trick, rational thinking, but when you're good and crazy, oooh, oooh,
oooh, the sky is the limit!" --- The Tick
More information about the grass-user
mailing list