[GRASSLIST:6791] Re: neighbors of polygons

Daniel Isenegger disen at geo.unizh.ch
Mon May 16 08:32:25 EDT 2005


Radim Blazek schrieb:
Hi Radim,
thanks for your quick answer, but i do net get it: neither the plan nor 
the concrete commands

> Daniel Isenegger wrote:
>
>> Hi,
>> i work with grass 5.7 having the attribute data in postgres-DB.
>>
>> in a polygon-shapefile containing several hundred of polygons i want 
>> to analyze for each polygon which neighboring polygons it has. 
>> Conceptually i see there 2 cases:
>> 1) neighboring polygons sharing a common boundary with the current 
>> polygon: these polygons should be selectable by identifying the 
>> identifiers of the border-lines of the current polygon and search 
>> over all border-lines of all polygons for those identifiers.
>> here my question is: how to identify the identifiers of all 
>> border-lines of a polygon?
>
>
> v.category layer=2 type=boundary to assign cat to boundaries 
> (avaialable parameters: input, output, type, option, cat, field, step)

- v.category: does not have a parameter layer (at least in my grass 5.7)
- assigning cat to boundaries means: having for all boundaries the 
associated cat (ie polygon(s)-IDs) they belong to?

>
> v.to.db option=sides -p 

- v.to.db:  parameter option does not have a value sides (only cat, 
areas, length, count, coor, query)

Dani

>
>
>
>> 2) neighboring polygons not sharing a border with the current 
>> polygon: here i thought of creating buffers with increasing sizes 
>> around the current polygon and looking for
>> - easy case: centers of other polygons located within these buffers
>> - computationally more challenging case: arbitrary point of a polygon 
>> located within these buffers
>> here my questions: this method is not very elegant (conceptual and 
>> technical). do you have better ideas for solving a problem like this
>
>
> use previous boundaries with cats as input for v.to.points
> find nearest areas for created points using v.distance
>
> Radim
>
>
>> Many thanks
>> dani
>>
>> ps i tried to do an approach to do this with v.to.db, but didn't 
>> progress much
>>
>




More information about the grass-user mailing list