[Mapserver-users] OT: ArcView Line Theme

Kieran J. Ames kames at keyspanenergy.com
Wed Jan 28 08:07:49 EST 2004


--------------5472D2CD0BFEA022A822166E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Many thanks to all for your help
I ended up using a script called pt_ln_pl.ave
While heavy on the processing time (making straight polylines from about 1,500 definitions took about 10 minutes and 100%
cpu), this script did everything I needed.
I include it here since finding it again was quite a task.
Kieran


'PT_LN_PL.AVE
'Original author Daniel Nielsen August 31, 1998
'Modified by Dan Patterson Jan 28, 1999
'
'This script must be run on a Table document. The output will be a polyline shapefile.

'This script will convert a table of points to a polyline shapefile with the option of
'creating line segments between point pairs (as a polyline) or by creating a continuous
'polyline from a sequenced list of points.
'You also have the option of creating a closed-loop polyline which can be used to create polygons
'using the ESRI sample script 'Convert polylines to polygons'.
'
'The input point table must have four fields containing numeric data
'    1  an x-coordinate
'    2  a y-coordinate
'    3  a  polyline identifier field (i.e. all points in the same polyline must have the same ID)
'    4  a vertex ID field which designates the order of the vertices (points) for each polyline.
'    5  an attribute field which contains the attributes that you want to assign to the polylines.
'        Note, the attribute from the first point that is used to form the polyline is used
'        This can be modified in the script if you so choose
'
'*******************************************************************************************************************
'  Get the active table and choose the coordinate, ID and the attribute fields.

theVTab = av.GetActiveDoc.GetVTab
theFields = theVTab.GetFields
chosenfields={}
'
    XField = MsgBox.List(theFields, "Longitude or Easting values", "Select X-coordinates field")
      chosenfields.add(Xfield)
    YField = MsgBox.List(theFields, "Latitude or Northing values", "Select Y-coordinates field")
      chosenfields.add(YField)
    IDField = MsgBox.List(theFields, "Each polyline 'event' must be identified by a unique number", "Select Unique polyline ID field in table")
     chosenfields.add(IDField)
   VertField = MsgBox.List(theFields, "These are the points that define each polyline", "Select the Vertice ID field")
     chosenfields.add(VertField)
    AttribField=MsgBox.List(theFields, "The attribute will be added to the polyline", "Select the Value to add to polyline")
     chosenfields.add(AttribField)

' check to make sure that the x, y, ID and vertex fields are numeric, the attributes can be anything
'
for each i in 0 .. (chosenfields.count-2)
  stringTest=chosenfields.get(i)
  if (stringTest.IsTypeNumber.Not)  then
    MsgBox.Info(stringTest.asstring++" field must be numeric!","Correct Point Table")
    exit
  end
end

'*******************************************************************************************************************
' ** Create the new shapefile
'
fnDefault = FileName.Make("$HOME").MakeTmp("shape","shp")
fnOutput  = FileDialog.Put( fnDefault,"*.shp","Output Shape File" )
if (fnOutput = nil) then exit end
fnOutput.SetExtension("shp")
'
'   Create the field list and see if fields from the input table are to be appended to the output table
'
ftbOutput = FTab.MakeNew( fnOutput, POLYLINE )
'
X=chosenFields.get(4)                   'get the name of the attribute field in the source table
FldList={"Shape","ID","Attribute"}    'create the field names in the output table
'
ftbOutput.AddFields({Field.Make("ID", #FIELD_LONG, 8, 0)})
ftbOutput.AddFields({Field.make("Attribute", X.gettype, X.getwidth, X.getprecision)})

' ** Get a list of all unique polyline ID values.  These are the polylines that you are going to create
'     The ID number will be assigned to the ID field of each polyline that is created.
'      Also checks to see if there are selected records in the source table.

IDList = List.Make
   if (theVTab.GetSelection.Count = 0) then
     theSet = theVTab
   else
     theSet = theVTab.GetSelection
   end

  for each rec in theSet
    IDList.Add(theVTab.ReturnValueString(IDField, rec))

  end

'*******************************************************************************************************************
' Check for errors, remove duplicate ID numbers, and sorts the list.
'
if (IDList.Count > 0) then
  IDList.RemoveDuplicates
  IDList.Sort(true)
else
  exit
end

theBitMap = theVTab.GetSelection
theBitMap.Clearall
theVTab.SetSelection(theBitMap)

'*******************************************************************************************************************
'  Choose the feature type
'
'  Select whether individual line segments or a continuous polyline is required (i.e. more than 2 points)
'   For example, you could have 4 points delineating the bounds of a rectangle.  You
'   are given the option of creating 4 line segments, 1 polyline connecting points 1 through 4, or
'   a closed-loop polyline which connects points 1 through 4 then closes back on 1 again.
SnapLine=(FALSE)
ChoiceList={"Segmented", "Continuous","Closed-loop"}
FeatureType=msgbox.ListAsString(ChoiceList,"Choose output format of polylines", "Feature Type to Create")
if (FeatureType <> "Segmented") then
  if(FeatureType<> "Continuous") then
    SnapLine = (TRUE)
  end
end

'*******************************************************************************************************************
'
for each ID in IDList
  theVTab.query("[" ++ IDField.AsString ++ "] = " ++ ID.asString, theBitMap, #VTAB_SELTYPE_NEW)
  theVTab.UpdateSelection

'**Gets a sorted list of all vertice ID values
    vertList = {}
    for each rec in theVTab.GetSelection
       vertList.add(theVTab.ReturnValue(VertField, rec))
    end
     vertList.Sort(TRUE)

' **Create a point list and an attribute list and sorts the points by the verticeID numbers.
    pointList = {}
    dataList={}
    for each vertNum in vertList
       theVTab.query("[" ++ IDField.AsString ++ "] = " ++ ID.asString, theBitMap, #VTAB_SELTYPE_NEW)
       theVTab.query("[" ++ VertField.AsString ++ "] = " ++ vertNum.asString, theBitMap, #VTAB_SELTYPE_AND)

'   ** Make the point and get the attributes
        for each rec in theVTab.GetSelection
           aPoint = point.make( theVTab.ReturnValue (XField, rec), theVTab.ReturnValue (YField, rec) )
           pointList.Add(aPoint)
           dataList.add(theVTab.ReturnValue(AttribField, rec))
        end
     end
'
'*******************************************************************************************************************
' ** Optionally create Line segments from points in the polyline theme

     if (FeatureType = "Segmented") then
     i=0
     smallList={}
'    ** Add a new polyline record to the output shapefile and get the data for the point
'        Note in this application, it assigns the attributes for the first point which makes up the polyline segment
'        Change the get(?) option to specify another point to use.  For individual line segments, this can be 0 or 1.

       for each j in 0 .. (pointList.count -2)
          data=dataList.get(j)
           newRec = ftbOutput.AddRecord
           smallList={pointList.get(i), pointlist.get(i+1)}
           newline = Polyline.make({smallList})
           fldShapeOut=ftbOutput.FindField("shape")
           fldIDOut=ftbOutput.findField("id")
           fldDataOut=ftbOutput.findField("attribute")
           ftbOutput.SetValue(fldShapeOut, newRec, newLine) '.AsPolyLine)
           ftbOutput.SetValue(fldIDOut, newRec, ID.AsString)
           ftbOutput.SetValue(fldDataOut, newRec, data)
           i=i+1
       end
     else

' ** Optionally create a continuous polyline from the points in the polyline theme.
'     Specify whether you want a closed loop polyline
'
     If (SnapLine) then
       pointList.Add(pointList.get(0))
     end

' ** add a new polyline record to the output shapefile
'     Note in this application, it assigns the attributes for the first point which makes up the polyline segment
'     Change the get(?) option to specify another point to use.

     data=dataList.get(0)
     newRec = ftbOutput.AddRecord
     newline = Polyline.make({pointList})
     fldShapeOut=ftbOutput.FindField("shape")
     fldIDOut=ftbOutput.findField("id")
     fldDataOut=ftbOutput.findField("attribute")
     ftbOutput.SetValue(fldShapeOut, newRec, newLine) '.AsPolyLine)
     ftbOutput.SetValue(fldIDOut, newRec, ID.AsString)
     ftbOutput.SetValue(fldDataOut, newRec, data)
  end
end
theBitMap.Clearall
theVTab.UpdateSelection
'
'*******************************************************************************************************************
' ** Add the output shapefile to a View
'
viewList = list.make
for each d in av.GetProject.GetDocs
  if (d.Is(View)) then
    viewList.Add(d)
  end
end
viewList.Add("")
addToView = MsgBox.ListAsString( viewList,"Add Theme to:",  "Convert Points to Polylines" )
'
' ** Get the specified view, make the theme, and add it...
if (addToView <> nil) then
  if (addToView = "") then
    addToView = View.Make
    addToView.GetWin.Open
  end
  newTheme = FTheme.Make( ftbOutput )
  addToView.AddTheme( newTheme )
  addToView.GetWin.Activate
end





Howard Mark wrote:

> Kieran,
>
> You'll need to know a bit of avenue script to do this. First you'll need to create a new LINE theme.
> Using an avenue script, you'll need to create a new line shape from the points, and add the shape to the line theme.
> This explanation is a bit simplistic.
> There are sample scripts online at the esri site www.esri.com
>
> Mark
>
> -----Original Message-----
> From: mapserver-users-admin at lists.gis.umn.edu [mailto:mapserver-users-admin at lists.gis.umn.edu]On Behalf Of Kieran J. Ames
> Sent: Monday, January 26, 2004 2:38 PM
> To: mapserver list
> Subject: [Mapserver-users] OT: ArcView Line Theme
>
> List,
> Sorry for the Off-Topic, but...
> I know how to import an event theme (points) into ArcView from text or
> dbf.
> I want to create a line theme (have 2 sets of points... the nodes).
> Can anyone point me to some documentation on how I'd get this
> information into ArcView?
>
> Thanks in advance.
> Kieran
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
> ********************************************************************************
> This message is intended only for the use of the Addressee and may
> contain information that is PRIVILEGED and CONFIDENTIAL.
>
> If you are not the intended recipient, you are hereby notified that any
> dissemination of this communication is strictly prohibited. If you have
> received this communication in error, please erase all copies of the
> message and its attachments and notify Space Imaging immediately.
> ********************************************************************************

--------------5472D2CD0BFEA022A822166E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Many thanks to all for your help
<br>I ended up using a script called pt_ln_pl.ave
<br>While heavy on the processing time (making straight polylines from
about 1,500 definitions took about 10 minutes and 100% cpu), this script
did everything I needed.
<br>I include it here since finding it again was quite a task.
<br>Kieran
<br>&nbsp;
<pre>'PT_LN_PL.AVE
'Original author Daniel Nielsen August 31, 1998
'Modified by Dan Patterson Jan 28, 1999
'
'This script must be run on a Table document. The output will be a polyline shapefile.

'This script will convert a table of points to a polyline shapefile with the option of&nbsp;
'creating line segments between point pairs (as a polyline) or by creating a continuous
'polyline from a sequenced list of points.
'You also have the option of creating a closed-loop polyline which can be used to create polygons
'using the ESRI sample script 'Convert polylines to polygons'.
'
'The input point table must have four fields containing numeric data
'&nbsp;&nbsp;&nbsp; 1&nbsp; an x-coordinate&nbsp;
'&nbsp;&nbsp;&nbsp; 2&nbsp; a y-coordinate
'&nbsp;&nbsp;&nbsp; 3&nbsp; a&nbsp; polyline identifier field (i.e. all points in the same polyline must have the same ID)
'&nbsp;&nbsp;&nbsp; 4&nbsp; a vertex ID field which designates the order of the vertices (points) for each polyline.
'&nbsp;&nbsp;&nbsp; 5&nbsp; an attribute field which contains the attributes that you want to assign to the polylines.
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Note, the attribute from the first point that is used to form the polyline is used
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This can be modified in the script if you so choose
'&nbsp;
'*******************************************************************************************************************
'&nbsp; Get the active table and choose the coordinate, ID and the attribute fields.

theVTab = av.GetActiveDoc.GetVTab
theFields = theVTab.GetFields
chosenfields={}
'&nbsp;
&nbsp;&nbsp;&nbsp; XField = MsgBox.List(theFields, "Longitude or Easting values", "Select X-coordinates field")
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chosenfields.add(Xfield)
&nbsp;&nbsp;&nbsp; YField = MsgBox.List(theFields, "Latitude or Northing values", "Select Y-coordinates field")
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chosenfields.add(YField)
&nbsp;&nbsp;&nbsp; IDField = MsgBox.List(theFields, "Each polyline 'event' must be identified by a unique number", "Select Unique polyline ID field in table")
&nbsp;&nbsp;&nbsp;&nbsp; chosenfields.add(IDField)
&nbsp;&nbsp; VertField = MsgBox.List(theFields, "These are the points that define each polyline", "Select the Vertice ID field")
&nbsp;&nbsp;&nbsp;&nbsp; chosenfields.add(VertField)
&nbsp;&nbsp;&nbsp; AttribField=MsgBox.List(theFields, "The attribute will be added to the polyline", "Select the Value to add to polyline")
&nbsp;&nbsp;&nbsp;&nbsp; chosenfields.add(AttribField)

' check to make sure that the x, y, ID and vertex fields are numeric, the attributes can be anything
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for each i in 0 .. (chosenfields.count-2)
&nbsp; stringTest=chosenfields.get(i)
&nbsp; if (stringTest.IsTypeNumber.Not)&nbsp; then
&nbsp;&nbsp;&nbsp; MsgBox.Info(stringTest.asstring++" field must be numeric!","Correct Point Table")
&nbsp;&nbsp;&nbsp; exit
&nbsp; end
end

'*******************************************************************************************************************
' ** Create the new shapefile
'
fnDefault = FileName.Make("$HOME").MakeTmp("shape","shp")
fnOutput&nbsp; = FileDialog.Put( fnDefault,"*.shp","Output Shape File" )
if (fnOutput = nil) then exit end
fnOutput.SetExtension("shp")
'
'&nbsp;&nbsp; Create the field list and see if fields from the input table are to be appended to the output table
'
ftbOutput = FTab.MakeNew( fnOutput, POLYLINE )
'
X=chosenFields.get(4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'get the name of the attribute field in the source table
FldList={"Shape","ID","Attribute"}&nbsp;&nbsp;&nbsp; 'create the field names in the output table
'
ftbOutput.AddFields({Field.Make("ID", #FIELD_LONG, 8, 0)})
ftbOutput.AddFields({Field.make("Attribute", X.gettype, X.getwidth, X.getprecision)})


' ** Get a list of all unique polyline ID values.&nbsp; These are the polylines that you are going to create
'&nbsp;&nbsp;&nbsp;&nbsp; The ID number will be assigned to the ID field of each polyline that is created.
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Also checks to see if there are selected records in the source table.

IDList = List.Make
&nbsp;&nbsp; if (theVTab.GetSelection.Count = 0) then
&nbsp;&nbsp;&nbsp;&nbsp; theSet = theVTab
&nbsp;&nbsp; else
&nbsp;&nbsp;&nbsp;&nbsp; theSet = theVTab.GetSelection
&nbsp;&nbsp; end

&nbsp; for each rec in theSet
&nbsp;&nbsp;&nbsp; IDList.Add(theVTab.ReturnValueString(IDField, rec))

&nbsp; end

'*******************************************************************************************************************
' Check for errors, remove duplicate ID numbers, and sorts the list.
'
if (IDList.Count > 0) then
&nbsp; IDList.RemoveDuplicates
&nbsp; IDList.Sort(true)
else
&nbsp; exit
end

theBitMap = theVTab.GetSelection
theBitMap.Clearall
theVTab.SetSelection(theBitMap)

'*******************************************************************************************************************
'&nbsp; Choose the feature type
'
'&nbsp; Select whether individual line segments or a continuous polyline is required (i.e. more than 2 points)
'&nbsp;&nbsp; For example, you could have 4 points delineating the bounds of a rectangle.&nbsp; You
'&nbsp;&nbsp; are given the option of creating 4 line segments, 1 polyline connecting points 1 through 4, or&nbsp;
'&nbsp;&nbsp; a closed-loop polyline which connects points 1 through 4 then closes back on 1 again.
SnapLine=(FALSE)
ChoiceList={"Segmented", "Continuous","Closed-loop"}
FeatureType=msgbox.ListAsString(ChoiceList,"Choose output format of polylines", "Feature Type to Create")
if (FeatureType &lt;> "Segmented") then
&nbsp; if(FeatureType&lt;> "Continuous") then
&nbsp;&nbsp;&nbsp; SnapLine = (TRUE)
&nbsp; end&nbsp;&nbsp;
end

'*******************************************************************************************************************
'&nbsp;&nbsp;
for each ID in IDList
&nbsp; theVTab.query("[" ++ IDField.AsString ++ "] = " ++ ID.asString, theBitMap, #VTAB_SELTYPE_NEW)
&nbsp; theVTab.UpdateSelection

'**Gets a sorted list of all vertice ID values
&nbsp;&nbsp;&nbsp; vertList = {}
&nbsp;&nbsp;&nbsp; for each rec in theVTab.GetSelection
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vertList.add(theVTab.ReturnValue(VertField, rec))
&nbsp;&nbsp;&nbsp; end
&nbsp;&nbsp;&nbsp;&nbsp; vertList.Sort(TRUE)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
' **Create a point list and an attribute list and sorts the points by the verticeID numbers.
&nbsp;&nbsp;&nbsp; pointList = {}
&nbsp;&nbsp;&nbsp; dataList={}
&nbsp;&nbsp;&nbsp; for each vertNum in vertList
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; theVTab.query("[" ++ IDField.AsString ++ "] = " ++ ID.asString, theBitMap, #VTAB_SELTYPE_NEW)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; theVTab.query("[" ++ VertField.AsString ++ "] = " ++ vertNum.asString, theBitMap, #VTAB_SELTYPE_AND)

'&nbsp;&nbsp; ** Make the point and get the attributes
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for each rec in theVTab.GetSelection
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aPoint = point.make( theVTab.ReturnValue (XField, rec), theVTab.ReturnValue (YField, rec) )
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pointList.Add(aPoint)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dataList.add(theVTab.ReturnValue(AttribField, rec))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end
&nbsp;&nbsp;&nbsp;&nbsp; end
'
'*******************************************************************************************************************
' ** Optionally create Line segments from points in the polyline theme

&nbsp;&nbsp;&nbsp;&nbsp; if (FeatureType = "Segmented") then
&nbsp;&nbsp;&nbsp;&nbsp; i=0
&nbsp;&nbsp;&nbsp;&nbsp; smallList={}
'&nbsp;&nbsp;&nbsp; ** Add a new polyline record to the output shapefile and get the data for the point
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Note in this application, it assigns the attributes for the first point which makes up the polyline segment
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Change the get(?) option to specify another point to use.&nbsp; For individual line segments, this can be 0 or 1.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for each j in 0 .. (pointList.count -2)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; data=dataList.get(j)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newRec = ftbOutput.AddRecord
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; smallList={pointList.get(i), pointlist.get(i+1)}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newline = Polyline.make({smallList})
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fldShapeOut=ftbOutput.FindField("shape")
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fldIDOut=ftbOutput.findField("id")
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fldDataOut=ftbOutput.findField("attribute")
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ftbOutput.SetValue(fldShapeOut, newRec, newLine) '.AsPolyLine)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ftbOutput.SetValue(fldIDOut, newRec, ID.AsString)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ftbOutput.SetValue(fldDataOut, newRec, data)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i=i+1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; else

' ** Optionally create a continuous polyline from the points in the polyline theme.
'&nbsp;&nbsp;&nbsp;&nbsp; Specify whether you want a closed loop polyline
'
&nbsp;&nbsp;&nbsp;&nbsp; If (SnapLine) then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pointList.Add(pointList.get(0))
&nbsp;&nbsp;&nbsp;&nbsp; end

' ** add a new polyline record to the output shapefile
'&nbsp;&nbsp;&nbsp;&nbsp; Note in this application, it assigns the attributes for the first point which makes up the polyline segment
'&nbsp;&nbsp;&nbsp;&nbsp; Change the get(?) option to specify another point to use.&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp; data=dataList.get(0)
&nbsp;&nbsp;&nbsp;&nbsp; newRec = ftbOutput.AddRecord
&nbsp;&nbsp;&nbsp;&nbsp; newline = Polyline.make({pointList})
&nbsp;&nbsp;&nbsp;&nbsp; fldShapeOut=ftbOutput.FindField("shape")
&nbsp;&nbsp;&nbsp;&nbsp; fldIDOut=ftbOutput.findField("id")
&nbsp;&nbsp;&nbsp;&nbsp; fldDataOut=ftbOutput.findField("attribute")
&nbsp;&nbsp;&nbsp;&nbsp; ftbOutput.SetValue(fldShapeOut, newRec, newLine) '.AsPolyLine)
&nbsp;&nbsp;&nbsp;&nbsp; ftbOutput.SetValue(fldIDOut, newRec, ID.AsString)
&nbsp;&nbsp;&nbsp;&nbsp; ftbOutput.SetValue(fldDataOut, newRec, data)
&nbsp; end
end
theBitMap.Clearall
theVTab.UpdateSelection
'
'*******************************************************************************************************************
' ** Add the output shapefile to a View
'
viewList = list.make
for each d in av.GetProject.GetDocs
&nbsp; if (d.Is(View)) then
&nbsp;&nbsp;&nbsp; viewList.Add(d)
&nbsp; end
end
viewList.Add("")
addToView = MsgBox.ListAsString( viewList,"Add Theme to:",&nbsp; "Convert Points to Polylines" )
'
' ** Get the specified view, make the theme, and add it...
if (addToView &lt;> nil) then
&nbsp; if (addToView = "") then
&nbsp;&nbsp;&nbsp; addToView = View.Make
&nbsp;&nbsp;&nbsp; addToView.GetWin.Open
&nbsp; end
&nbsp; newTheme = FTheme.Make( ftbOutput )
&nbsp; addToView.AddTheme( newTheme )
&nbsp; addToView.GetWin.Activate
end&nbsp;
</pre>
&nbsp;
<p>&nbsp;
<p>Howard Mark wrote:
<blockquote TYPE=CITE>Kieran,
<p>You'll need to know a bit of avenue script to do this. First you'll
need to create a new LINE theme.
<br>Using an avenue script, you'll need to create a new line shape from
the points, and add the shape to the line theme.
<br>This explanation is a bit simplistic.
<br>There are sample scripts online at the esri site www.esri.com
<p>Mark
<p>-----Original Message-----
<br>From: mapserver-users-admin at lists.gis.umn.edu [<a href="mailto:mapserver-users-admin at lists.gis.umn.edu">mailto:mapserver-users-admin at lists.gis.umn.edu</a>]On
Behalf Of Kieran J. Ames
<br>Sent: Monday, January 26, 2004 2:38 PM
<br>To: mapserver list
<br>Subject: [Mapserver-users] OT: ArcView Line Theme
<p>List,
<br>Sorry for the Off-Topic, but...
<br>I know how to import an event theme (points) into ArcView from text
or
<br>dbf.
<br>I want to create a line theme (have 2 sets of points... the nodes).
<br>Can anyone point me to some documentation on how I'd get this
<br>information into ArcView?
<p>Thanks in advance.
<br>Kieran
<p>_______________________________________________
<br>Mapserver-users mailing list
<br>Mapserver-users at lists.gis.umn.edu
<br><a href="http://lists.gis.umn.edu/mailman/listinfo/mapserver-users">http://lists.gis.umn.edu/mailman/listinfo/mapserver-users</a>
<p>********************************************************************************
<br>This message is intended only for the use of the Addressee and may
<br>contain information that is PRIVILEGED and CONFIDENTIAL.
<p>If you are not the intended recipient, you are hereby notified that
any
<br>dissemination of this communication is strictly prohibited. If you
have
<br>received this communication in error, please erase all copies of the
<br>message and its attachments and notify Space Imaging immediately.
<br>********************************************************************************</blockquote>
</html>

--------------5472D2CD0BFEA022A822166E--




More information about the mapserver-users mailing list