Discussion:
[mapguide-users] What buffering method does MapGuide use Euclidean or Geodesic?
RenoSun
2017-03-29 23:29:13 UTC
Permalink
I was using Turf.js to buffer the geojson generated from MapGuide-Rest with
LL84 coordinate system. Then, I use OpenLayers 3 to transform the buffer
feature geometry to WGS 84.Pseudo-Mercator coordinate system. However, the
buffer distance was incorrect. I tested on MapGuide Fusion to use buffer
tool on both LL84, and WGS 84.Pseudo-Mercator. Both generated the accurate
results as I expected.

I ended up to request the geojson from mapguide-rest in
WGS84.Pseudo-Mercator coordinate system, and buffer the geojson. The buffer
distance was really off, but it generated the right shape. Therefore, I
manually change the distance value, and it works great with various units
such as meter, km, and feet.

geojson = turf.buffer(geojson, $('#bufferDist').val() / 0.000005845,
$('#bufferUnit').val());

The questions that I posted on OpenLayers 3 github.


Understanding Geodesic Buffering

You may try our new Buffer function on our web GIS. Select any features on
the map, and click Buffer The Feature button. Converted the buffer result to
map layer, and you may use the measurement tools to check the accuracy of
the buffer layer.

I think what the MapGuide fusion buffer the feature geometry with the same
coordinate system that the map is using, and didn't do any geometry
coordinate transformations. When the map is in LL84, it use Geodesic
Buffering, and if it's using any projected coordinate system, it will use
Euclidean Buffering.

I think Turf.js did the Geodesic Buffering with my LL84 geojson, and I
transform the result geojson it into WGS 84.Pseudo-Mercator. Therefore, it
will not give me the result that I expected to see that only Euclidean
Buffering will provide me. Should always transform the original feature into
the final coordinate system of the buffering result first, than buffer it
with the appropriate buffering method in order to get the correct result.

Any thoughts? <http://WGS 84.Pseudo-Mercator>



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/What-buffering-method-does-MapGuide-use-Euclidean-or-Geodesic-tp5314871.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
Jackie Ng
2017-03-30 00:12:09 UTC
Permalink
According to this, turf's buffering is not geodesic as it is an enhancement
ticket that needs help

https://github.com/Turfjs/turf-buffer/issues/3
https://github.com/Turfjs/turf/issues/110#issuecomment-103413360

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/What-buffering-method-does-MapGuide-use-Euclidean-or-Geodesic-tp5314871p5314872.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
Flipper
2017-03-30 14:40:48 UTC
Permalink
The Attempt at geodesic on Turf is fatally flawed.
There is a branch that had begun that had some promise but I found it to
create some really poor and garbled results when Utilized on Complex
geometries like soils, etc.
Pull Request
<https://github.com/Turfjs/turf-buffer/pull/33#issuecomment-280460502>
The person who was working on this has ceased working on it.

Mapguide has always generated Geodesic buffers that I have found accurate.



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/What-buffering-method-does-MapGuide-use-Euclidean-or-Geodesic-tp5314871p5314993.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
RenoSun
2017-03-30 18:37:50 UTC
Permalink
I tried JSTS <https://github.com/bjornharrtell/jsts> , and it won't
recognize the coordinate system of the geometry. It buffer the geometry in
UNIT which I should be in meters.

// create a buffer of 40 meters around each line

var buffered = jstsGeom.buffer(40);

However, when I buffered the geometry in WGS84.Pseudomercator 10 meters, it
generated the geometry only buffered about 6.54 meters. Therefore, I had to
manually change the user input values again.

Therefore, I decided to just use Turf.js to buffer the geometry. At least,
it can recognize the unit that I sent to it.

Equidistant Buffer possible? with JSTS?
<https://github.com/bjornharrtell/jsts/issues/238>



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/What-buffering-method-does-MapGuide-use-Euclidean-or-Geodesic-tp5314871p5315045.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

Loading...