[mapserver-users] Buffer

Jeppe Lund Andersen JXA at cowi.dk
Tue Dec 23 05:46:59 EST 2008


Hello

Thank you for running the code

Okay there is an error in the buffer function.
The reason why I have less vertices/segments is because I have changed the code to take a parameter to tell how many vertices/segments.

Jeppe


> -----Original Message-----
> From: José María Michia [mailto:jose.maria.michia at gmail.com] 
> Sent: Tuesday, December 23, 2008 2:36 AM
> To: Jeppe Lund Andersen
> Cc: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Buffer
> 
> 2008/12/22 Jeppe Lund Andersen <JXA at cowi.dk>:
> > Hello all
> >
> > I need a little help here
> > If I run the following
> >
> > $NewShapeFromWkt = ms_shapeObjFromWkt( "MULTIPOLYGON(((566725.7595 
> > 6131923.3645, 566755.923 6131916.786, 566774.0885 6131912.417, 
> > 566794.538 6131907.418, 566798.6035 6131901.309, 566788.164 
> > 6131836.8625, 566779.4235 6131830.6935, 566724.0525 6131841.7915, 
> > 566723.665 6131863.507, 566714.6605 6131868.216, 566718.157 
> > 6131885.2325, 566725.7595 6131923.3645)),
> > ((566655.975 6131935.652, 566661.6235 6131937.282, 566696.924 
> > 6131929.5735,
> > 566694.755 6131919.4455, 566702.3 6131917.506, 566704.304 
> 6131927.964,
> > 566725.6935 6131923.2945, 566718.091 6131885.1625, 566652.446 
> > 6131899.0795,
> > 566655.975 6131935.652)))" );
> >
> > $new_shape = $NewShapeFromWkt->Buffer(-0.1); 
> > echo($new_shape->toWkt());
> >
> > I get this shape, and it remove one of the shapes in the 
> multipolygon 
> > can any one try and see if they get the same error ?
> >
> > POLYGON ((566725.8376634185000000 6131923.2451023338000000, 
> > 566755.9006510233700000 6131916.6885235561000000, 
> > 566774.0649345762800000 6131912.3198161256000000, 
> > 566794.4763613325800000 6131907.3301233519000000, 
> > 566798.4985129962400000 6131901.2862604791000000, 
> > 566788.0720058706400000 6131836.9199698064000000, 
> > 566779.4009780341300000 6131830.8000029027000000, 
> > 566724.1510484541100000 6131841.8737367792000000, 
> > 566723.7649840826600000 6131863.5087841563000000, 
> > 566723.7113416689700000 6131863.5956140496000000, 
> > 566714.7736214522700000 6131868.2696908442000000, 
> > 566718.2549535385300000 6131885.2123727966000000, 
> > 566718.2550698703900000 6131885.2129474934000000, 
> > 566725.8376634185000000 6131923.2451023338000000))
> >
> 
> I execute your code, with its data, in my system, with the following
> results: One of the polygons has been eliminated, just like 
> as in their case. In addition, my result, it has more 
> vertices. In the attached image you can see the differences 
> (or at least part of them).
> I don't know which is the reason for the difference in 
> resolution (number of vertices).
> 
> My result:
> 
> POLYGON ((566725.8376634184969589 6131923.2451023338362575,
> 566755.9006510233739391 6131916.6885235561057925,
> 566774.0649345762794837 6131912.3198161255568266,
> 566794.4763613325776532 6131907.3301233518868685,
> 566798.4985129962442443 6131901.2862604791298509,
> 566788.0720058706356212 6131836.9199698064476252,
> 566779.4009780341293663 6131830.8000029027462006,
> 566724.1510484541067854 6131841.8737367792055011,
> 566723.7649840826634318 6131863.5087841562926769,
> 566723.7647452256642282 6131863.5141337206587195,
> 566723.7642203503055498 6131863.5194628285244107,
> 566723.7634109617210925 6131863.5247561996802688,
> 566723.7623193806502968 6131863.5299986554309726,
> 566723.7609487375011668 6131863.5351751623675227,
> 566723.7593029623385519 6131863.5402708780020475,
> 566723.7573867744067684 6131863.5452711889520288,
> 566723.7552056685090065 6131863.5501617584377527,
> 566723.7527658988256007 6131863.5549285616725683,
> 566723.7500744614517316 6131863.5595579305663705, 
> 566723.7471390739083290 6131863.5640365900471807,
> 566723.7439681534888223 6131863.5683516971766949,
> 566723.7405707928119227 6131863.5724908793345094,
> 566723.7369567337445915 6131863.5764422677457333,
> 566723.7331363394623622 6131863.5801945300772786,
> 566723.7291205649962649 6131863.5837369086220860,
> 566723.7249209255678579 6131863.5870592454448342,
> 566723.7205494635272771 6131863.5901520121842623,
> 566723.7160187140107155 6131863.5930063417181373,
> 566723.7113416689680889 6131863.5956140495836735, 
> 566714.7736214522738010 6131868.2696908442303538,
> 566718.2549535385333002 6131885.2123727966099977,
> 566718.2550698703853413 6131885.2129474934190512,
> 566725.8376634184969589 6131923.2451023338362575))
> 
> Saludos
> José María
> 
> 


More information about the mapserver-users mailing list