[GRASS-user] Tessellation of a set of polygons

Thomas Leduc thomas.leduc at cerma.archi.fr
Tue Feb 25 08:54:58 PST 2014


Dear GRASS-users & developpers,

As summed up below, I've tried to tessellate the enclosed datasource (a
shapefile composed of several building footprints) using 2 different
approaches:

g.remove vect=buildings,plots rast=buildings_r,plots_r
v.in.ogr -o dsn=/tmp/buildings.shp output=buildings

1st method:
v.voronoi -a --overwrite input=buildings output=vor smoothness=0.15
v.out.ogr --overwrite input=vor type=area dsn=/tmp/src olayer=vor layer=1
format=ESRI_Shapefile

2nd method:
g.region vect=buildings nsres=0.25 ewres=0.25
v.to.rast --overwrite input=buildings output=buildings_r use=attr
attrcolumn=gid
r.grow --overwrite input=buildings_r output=plots_r metric=euclidean
radius=4800
r.to.vect --o input=plots_r output=plots type=area
v.out.ogr --o input=plots type=area dsn=/tmp/src olayer=plots layer=1
format=ESRI_Shapefile

As may be observed with the screenshot, (both) output results does not
match expectations.

Do you have any idea of the reason why it's wrong?

Many thanks for your help,

Thomas

[image: Inline image 1]



On Tue, Sep 10, 2013 at 3:10 PM, Thomas Leduc
<thomas.leduc at cerma.archi.fr>wrote:

> Dear Markus,
>
> Impressive responsiveness. Thanks for the dedicated development.
> http://trac.osgeo.org/grass/changeset/57621 is fully operative on the
> given dataset.
>
> It took me some time to test it, because I'm a complete newby with GRASS
> community. Just to keep it written somewhere, I first had to checkout,
> configure, compile, and install GRASS7 snapshot on my Debian 6.0.7:
>
>     svn checkout https://svn.osgeo.org/grass/grass/trunk grass7_trunk
>     cd ./grass7_trunk
>     ./configure --enable-64bit
> -with-freetype-includes=/usr/include/freetype2
> --prefix=/usr/local/misc/grass7-snapshot --with-sqlite
>     make
>     make install
>
> Then, in the GRASS console, I've copied and pasted the following
> instructions:
>
>     g.remove vect=buildings,vor
>   v.in.ogr -o dsn=/tmp/src/src.shp output=buildings
>   v.voronoi -a --overwrite input=buildings output=vor segment=0.15
>   v.out.ogr --overwrite input=vor type=area dsn=/tmp/src olayer=vor
> layer=1 format=ESRI_Shapefile
>
> Many thanks once again.
>
> Thomas
>
>
> On Sun, Sep 8, 2013 at 7:49 PM, Markus Metz <markus.metz.giswork at gmail.com
> > wrote:
>
>> On Thu, Aug 29, 2013 at 5:38 PM, Thomas Leduc
>> <thomas.leduc at cerma.archi.fr> wrote:
>> > Let's consider a set of input polygons (represented by dark gray
>> polygonal
>> > footprints in the enclosed screenshot [1]). I wonder whether there
>> already
>> > exists a (set of) GRASS instructions to produce the "surrounding
>> > tessellation". I mean, could you please tell me how to compute the set
>> of
>> > multicolor polygons in the enclosed screenshot?
>> >
>> > As an example, the blue polygon is the set of points that are:
>> >   - overlayed by the dark gray polygon labeled #1
>> >   - or closer to the dark gray polygon labeled #1 than to any other
>> input
>> > polygon.
>> >
>> I have added tessellation of areas to v.voronoi in trunk r57621. You
>> need to use the new -a flag and can control the smoothness of the
>> output with the new segment option. With your example, segment=0.15
>> produces reasonably smooth output.
>>
>> This implementation ignores shared boundaries (not present in your
>> example) which would need to be patched in afterwards. An alternative
>> would be to use v.overlay to obtain areas outside the original input
>> areas.
>>
>> HTH,
>>
>> Markus M
>>
>> > Thanks a lot for any help/advice.
>> >
>> > Thomas Leduc
>> >
>> > PS: I'm aware there already exist in GRASS some functions such as
>> > "v.to.rast, r.grow.distance, and r.contour" which could help in
>> building map
>> > of distances, and isocontours... I'm also aware there already exist
>> > "v.to.rast, r.thin, and r.to.vect feature=line" to build some sort of
>> medial
>> > axis transform or skeleton.
>> >
>> > PPS: input data set
>> >
>> > create table b(gid int, the_geom GEOMETRY(POLYGON, 2D));
>> > insert into b values (0, GeomFromText('POLYGON ((0 0, 10 0, 10 10, 0
>> 10, 0
>> > 0))'));
>> > insert into b values (1, GeomFromText('POLYGON ((30 0, 30 -30, 10 -30,
>> 10
>> > -40, 40 -40, 40 0, 30 0))'));
>> > insert into b values (2, GeomFromText('POLYGON ((20 20, 100 20, 100 40,
>> 60
>> > 40, 60 30, 40 30, 40 60, 20 60, 20 20))'));
>> > insert into b values (3, GeomFromText('POLYGON ((60 10, 60 -20, 100
>> -10, 100
>> > 10, 60 10))'));
>> > insert into b values (4, GeomFromText('POLYGON ((-10 -10, -10 -40, -40
>> -40,
>> > -40 -20, -60 -20, -60 0, -50 0, -50 -10, -10 -10))'));
>> > insert into b values (5, GeomFromText('POLYGON ((-40 20, -40 40, -10
>> 40, -10
>> > 30, -20 20, -40 20))'));
>> >
>> > [1] this screenshot of about 11 KB is also downloadable at
>> > https://dl.dropboxusercontent.com/u/8846569/tessellation.png
>> >
>> >
>> > _______________________________________________
>> > grass-user mailing list
>> > grass-user at lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/grass-user
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>
>
>
> --
> Thomas LEDUC
>



-- 
Thomas LEDUC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140225/7296e1d8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tessellation.png
Type: image/png
Size: 235243 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140225/7296e1d8/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buildings.zip
Type: application/zip
Size: 72781 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140225/7296e1d8/attachment-0001.zip>


More information about the grass-user mailing list