>>I 've region objects and I want to boundries as  "- - - -" dashes. but at
>>intersecting edges it seems like straight line. Is there any solution?
>>because my prinouts seems not correct otherwise.

>A major MI drawback. A border is treated as a continous pline from its
>starting point, and patterns originate from that starting point. When 2
>regions have one segment in common, the border there is drawn twice, and
>nothing guarantees that the pattern drawing will be exactly "in phase"; most
>probably it will not be in phase and the 'dashes' will be "extended" by
>overlap to the point of being continuous.
>
>The only way dash patterns can remain intact is to build a separate layer of
>"single" plines, exactly as other gis programs define space (single plines
>with region to right and region to left).
>
>I would be interested to know if some utility of that nature exists : from
>regions to "single" plines.

Jacques is correct. Here is a MapBasic utility which creates a polyline
copy of all selected regions. I can e-mail the mbx to anyone who needs it.


'*****************************************************************************
'       Copyright (c) 1999, MAPINFO CORPORATION
'       All rights reserved.
'       Confidential Property of MAPINFO CORPORATION
'
' $Workfile:   Regions2Lines.mb  $
' $Revision:   1.0  $
' $Author:   DRESSEL  $
' $Date:   21 Jan 1999 16:14:56  $
'
' Module Description:
'
' MapBasic program to convert selected regions into lines.
'
' Revision History:
'
'    Rev 1.0   21 Jan 1999 16:14:56   DRESSEL
' Initial revision.
'
'
'*****************************************************************************
Include "MapBasic.def"

Declare Sub Main
Declare Sub Regions2Lines
Declare Sub About
Declare Sub GoodBye

Sub Main

  OnError Goto HandleError

  Create Menu "&Regions2Lines" As

    "&Convert selected regions to lines"  Calling Regions2Lines,
    "(-",
    "&About  Regions2Lines... "  Calling About,
    "E&xit Regions2Lines" Calling Goodbye

  Alter Menu "Tools" Add "&Regions2Lines" As "&Regions2Lines"

  Exit Sub

HandleError:
  Note "Main: " + Error$()
  Resume Next

End Sub

Sub Regions2Lines

  OnError Goto HandleError

  Dim oObj As Object
  Dim i, j, k, iRegions, iSections, iNodes As Integer
  Dim x1, y1, x2, y2 As Float

  If SelectionInfo(SEL_INFO_NROWS) > 0 Then
    Set CoordSys Window FrontWindow()
    Select * From Selection Into ~Work1
    iRegions = TableInfo(~Work1, TAB_INFO_NROWS)
    Close Table Selection
    Create Table ~Work (ID SmallInt)
    Create Map For ~Work CoordSys Window FrontWindow()

    k = 0
    Fetch First From ~Work1
    Do While Not EOT(~Work1)
      k = k + 1
      If ~Work1.Obj Then
        oObj = ~Work1.Obj
        If ObjectInfo(oObj, OBJ_INFO_TYPE) = OBJ_TYPE_REGION Then
          Select * From ~Work Where obj Within oObj Into ~Work2
          If TableInfo(~Work2, TAB_INFO_NROWS) > 0 Then
            Print "  Deleting " + TableInfo(~Work2, TAB_INFO_NROWS) + "
duplicate segments."
            Delete From ~Work2
          End If
          iSections = ObjectInfo(oObj, OBJ_INFO_NPOLYGONS)
          For i = 1 to iSections
            iNodes = ObjectInfo(oObj, OBJ_INFO_NPOLYGONS+i)
            Print "Region " + k + " of " + iRegions + ", Section " + i + " of "
+ iSections + " with " + iNodes + " nodes."
            For j = 1 to iNodes
              x1 = ObjectNodeX(oObj, i, j)
              y1 = ObjectNodeY(oObj, i, j)
              If j > 1 Then
                Insert Into ~Work (obj) Values(CreateLine(x1, y1, x2, y2))
              End If
              x2 = x1
              y2 = y1
            Next
          Next
        End If
      End If
      Fetch Next From ~Work1
    Loop

    Select * From ~Work
    Objects Combine
    Close Table ~Work1
    Close Table ~Work2
    Map From ~Work
    Set Map Window FrontWindow() Zoom Entire
    Note "Selected Regions converted into Lines in table ~Work."
  Else
    Note "No objects selected. Select some objects and try again."
  End If

  Exit Sub

HandleError:
  Note "Regions2Lines: " + Error$()
  Resume Next

End Sub

Sub About

  OnError Goto HandleError

  Dialog
     Title "About the Regions2Lines"
     Control StaticText
        Title "Convert selected regions to lines and remove overlapping"
Position 10, 10
     Control StaticText
        Title "segments. This can be very useful when trying to show" Position
10, 20
     Control StaticText
        Title "region borders with certain (dashed or dotted) line" Position 10,
 30
     Control StaticText
        Title "styles." Position 10, 40
     Control Button Title "&Auto-Load..." Calling HandleInstallation Position
45, 80 Width 45
     Control OKButton Title  "&OK" Position 95, 80 Width 45

  Exit Sub

HandleError:
  Note "About: " + Error$()
  Resume Next

End Sub

Sub GoodBye

  OnError Goto HandleError

  End Program

  Exit Sub

HandleError:
  Note "GoodBye: " + Error$()
  Resume Next

End Sub

' End of File


----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to