Include "MapBasic.def" Declare Sub Main Declare Function CreateAnnulusSector( ByVal oCenterPoint As Object , ByVal fInnerRadius As Float 'in meters , ByVal fOuterRadius As Float 'in meters , ByVal fStartAngle As Float , ByVal fEndAngle As Float , ByVal nResolution As Integer ) As Object Sub Main Dim i, nMID As Integer, fX, fY, fInnerRadius, fOuterRadius, fAngleStart As Float, fAngleEnd as Float, oSector, oPoint As Object nMID = FrontWindow() If nMID = 0 Then Note "Open a map window!" Exit Sub End If If not WindowInfo(nMID, WIN_INFO_TYPE) = WIN_MAPPER Then Note "Open a map window!" Exit Sub End If Set CoordSys Window nMID 'fX = MapperInfo(nMID, MAPPER_INFO_CENTERX) 'fY = MapperInfo(nMID, MAPPER_INFO_CENTERY) Fetch First From Live_cell While Not EOT (Live_cell) fX = Live_cell.actual_longitude fY = Live_cell.actual_latitude 'Print "Create Point @ " & FormatNumber$(fX) & " | " & FormatNumber$(fY) oPoint = CreatePoint(fX, fY) Insert Into WindowInfo(nMID, WIN_INFO_TABLE) (OBJ) Values (oPoint) Set Distance Units "m" 'fOuterRadius = MapperInfo(nMID, MAPPER_INFO_ZOOM) / 5 fOuterRadius = Live_cell.Radius fInnerRadius = 0 'no need of donut fAngleStart = Live_cell.Brg2a fAngleEnd = Live_cell.Brg2b oSector = CreateAnnulusSector(oPoint, fInnerRadius * (i - 1), fOuterRadius, fAngleStart , fAngleEnd , 120) Insert Into WindowInfo(nMID, WIN_INFO_TABLE) (OBJ) Values (oSector) Fetch Next From Live_cell wend End Sub Function CreateAnnulusSector( ByVal oCenterPoint As Object , ByVal fInnerRadius As Float 'in meters , ByVal fOuterRadius As Float 'in meters , ByVal fStartAngle As Float , ByVal fEndAngle As Float , ByVal nResolution As Integer ) As Object Dim oSector, oCutter As Object, fAngle, fRotatedAngle, fX, fY, fDistance As Float, i As Integer, oPoint As Object CreateAnnulusSector = oCenterPoint '**Create concentric circle 'oSector = CartesianBuffer(oCenterPoint, nResolution, fOuterRadius, "m") oSector = Buffer(oCenterPoint, nResolution, fOuterRadius, "m") If fInnerRadius > 0 Then oSector = Erase(oSector, Buffer(oCenterPoint, nResolution, fInnerRadius, "m")) End If '**Find center coordinates fX = CentroidX(oCenterPoint) fY = CentroidY(oCenterPoint) '**Calculate distance for cutter object fDistance = 3 * fOuterRadius 'fDistance = fOuterRadius Create Pline Into Variable oCutter 1 (fX, fY) oPoint = Offset(oCenterPoint, 90-fStartAngle , fDistance, "m") Alter Object oCutter Node Add (CentroidX(oPoint),CentroidY(oPoint)) oPoint = Offset(oCenterPoint, 90-fEndAngle , fDistance, "m") Alter Object oCutter Node Add (CentroidX(oPoint),CentroidY(oPoint)) '**Convert cutter polyline to a polygon oCutter = ConvertToRegion(oCutter) '**Erase the concentric circle where the cutter object doesn't overlap oSector = Overlap(oSector, oCutter) CreateAnnulusSector = oSector End Function