DotNet Buffer & Overlay

DotNet Buffer & Overlay

O_Eckmann
Mentor Mentor
114 Views
2 Replies
Message 1 of 3

DotNet Buffer & Overlay

O_Eckmann
Mentor
Mentor

Hi,

 

I would like to mimic MAPFDOBUFFERCREATE & MAPGISOVERLAY but with native CAD objects (Point, Insert, Polyline, MPolygon...) with possibly copy of OD from source to target MPolygon.

 

I don't want to reinvent the wheel, so I've found 2 possible ways :

 - SqlServer Spatial : https://learn.microsoft.com/en-us/dotnet/api/system.data.entity.sqlserver.sqlspatialservices.buffer?... 

 - Net Topolgy Suite : https://github.com/NetTopologySuite/NetTopologySuite/wiki/GettingStarted 

 

Has anybody some experience in one of these solution, or a better solution perhaps? I'm looking for leads before taking the plunge.

 

Thanks

 

Olivier Eckmann

EESignature

0 Likes
115 Views
2 Replies
Replies (2)
Message 2 of 3

fieldguy
Advisor
Advisor

I have code that asks the user for a closed polyline and an offset distance. The polyline gets converted to MgGeometry with this:
Polyline bdy = (Polyline)tr.GetObject("pline objectid", OpenMode.ForRead, false);
MgGeometry geom = null;
geom = PolylineGeometryConvert((Polyline)bdy); // returns mgpolygon (closed)
then buffer with this:
MgGeometry buffgeom = geom.Buffer("offset", null);
then convert to pline:
Polyline newp = new Polyline();
newp = PolylineEntityConvert(buffgeom);

This reqiures a reference (using OSGeo.MapGuide) on my pc in C:\Program Files\Autodesk\AutoCAD 2025\Map\bin\GisPlatform (might need all 3 osgeo dll's)

0 Likes
Message 3 of 3

O_Eckmann
Mentor
Mentor

Hi @fieldguy ,

 

Thanks for your answer.

Last month I need to overlay 40 000 points over 100 polygons. I export to SHP and use GisOverlay. It works, but it takes more than 2 minutes where QGIS takes only 18s with same data.

I've also used buffer from FDO lines, but sometimes it fails to create complex buffer (with hole).

I don't know if it's due to API or FDO, but I prefer to test other solution than native Map API.

 

Olivier Eckmann

EESignature

0 Likes