示例#1
0
    lineSlope_out = lineSlope
  if (lineCent == "random"):
    if numShapes > 1: 
      Xcent = random.uniform(L,R); Ycent = random.uniform(B,T)
    else:
      Xcent = L + ((R-L)/2.0); Ycent = B + ((T-B)/2.0)
  if (length < 0.0):
    length_out = random.uniform(1, 100)
  else:
    length_out = length
  #
  #generate the points
  #
  if scatter == 0.0:
    if theType == "Random":
      pnts = PM.line_on(n, Xcent, Ycent, lineSlope_out, length_out, "True")
    else:
      pnts = PM.line_on(n, Xcent, Ycent, lineSlope_out, length_out, "False")
  else:
    if theType == "Random":
      pnts = PM.line_about(n, Xcent, Ycent, lineSlope_out, length_out, "True", scatter)
    else:
      pnts = PM.line_about(n, Xcent, Ycent, lineSlope_out, length_out, "False", scatter)
  #
  outPnts.append(pnts)
#
#optional shapefile creation
if outFC != "#":
  fieldsToAdd = [["Group", "LONG", "9", "#"],
                 ["X", "DOUBLE", 16, 7],
                 ["Y", "DOUBLE", 16, 7]]