Martin Davis | 1 Feb 2010 19:26
Favicon

Re: rgeos interface to R classes (sp, others)

Can you post the WKT/WKB of your test case? 

Roger Bivand wrote:
> On Mon, 1 Feb 2010, Martin Davis wrote:
>
>> Roger,
>>
>> The technique of using buffer(0) to union polygons is now deprecated 
>> in favour of using Unary Union (Geometry.union() - not sure what the 
>> exact GEOS signature is).  Unary Union is usually faster and more 
>> robust than the previous technique.  You might want to check this out.
>
> Martin,
>
> Thanks, I've replaced buffer(0) by GEOSUnionCascaded (C API). But the 
> artefact remains. For input MULTIPOLYGON:
>
> ---------
> |   |   |
> |   |   |
> |--------
> |   |
> |   |
> -----
>
> I still get the same MultiPolygon out when the bounding box is 
> (0,0)(0.2,0.2), but correctly Polygon:
>
> ---------
> |       |
(Continue reading)

Roger Bivand | 1 Feb 2010 21:27
Picon

Re: rgeos interface to R classes (sp, others)

On Mon, 1 Feb 2010, Martin Davis wrote:

> Can you post the WKT/WKB of your test case?

If this is WKT, then:

> SP2WKT(spol0)
[1] "MULTIPOLYGON(((0 0.1,0 0.2,0.1 0.2,0.1 0.1,0 0.1)),
   ((0.1 0.1,0.1 0.2,0.2 0.2,0.2 0.1,0.1 0.1)),
   ((0 0,0 0.1,0.1 0.1,0.1 0,0 0)))"
> SP2WKT(spolx0)
[1] "MULTIPOLYGON(((0 100,0 200,100 200,100 100,0 100)),
   ((100 100,100 200,200 200,200 100,100 100)),
   ((0 0,0 100,100 100,100 0,0 0)))"
>

I don't think that there is an OGR driver, is there? So this is a text 
representation for the two objects, each with 3 Polygon members, and only 
differing in scale (the coordinates of the second are 1000 times those of 
the first). I see the same difference on GEOS 3.2.0/C API 1.6.0 on x86_64 
RHEL5 and with an MSYS-built GEOS 3.2.0/C API 1.6.0 on Win 32 R.

Hope this is good enough, grateful for any ideas,

Roger

> Roger Bivand wrote:
>> On Mon, 1 Feb 2010, Martin Davis wrote:
>> 
>>> Roger,
(Continue reading)


Gmane