POST
|
thnk for your reply but in rest api 5 minutes not meet real result. when i add polygon of service area on my map it is drawing so little area... to accomplish this i multiplication 5 minutes with 100 for getting correct result... my breaks_length : 10 polygon distance :100 outsr : 3857 is it to be involved with upper stettings?
... View more
10-27-2011
12:12 PM
|
0
|
0
|
502
|
POST
|
hi i am working with Network analysis in ArcGIS rest api and i didnt understand what the meaning of Default Breaks in rest structure .. when i write 1000 in this input field it was giving me big polygon from 500... is it meaning of 1000 meter or 10 minutes from added point? thank you
... View more
10-27-2011
02:07 AM
|
0
|
3
|
3403
|
POST
|
hi, i am working on some camera data. I have some points which consist of azimuth, angle, distance(1000 mt), and of course coordinate field attributes. In arcmap I want to draw shapes like pie chart ... i write some code inspritaions from some similar code .. but when i choose all necessity column from my shp file and make code run , i am getting error to my except point in code...
import arcpy, string, operator, math
try:
#Collect azimuth, angle and x,y parameters
fc = string.replace(arcpy.GetParameterAsText(0),"\\","/")
fields = arcpy.ListFields(fc)
descfc = arcpy.Describe(fc)
sr = descfc.spatialReference
azimuth = arcpy.GetParameterAsText(1)
angle = arcpy.GetParameterAsText(2)
x = arcpy.GetParameterAsText(3)
y = arcpy.GetParameterAsText(4)
#Check for output featureclass
outfc = string.replace(fc, ".shp", "_range.shp")
lstfc = string.split(fc, "/")
for fd in lstfc:
fn = fd
#If existance
if arcpy.Exists(outfc):
arcpy.AddMessage("Deleting " + outfc)
arcpy.Delete_management(outfc)
#folder name
folder = string.replace(fc, "/" + fn, "")
arcpy.RefreshCatalog(folder)
arcpy.env.workspace = folder
#Create the feature class
arcpy.AddMessage("Creating a polygon featureclass " + outfc)
sf = string.replace(outfc,folder + "/", "")
arcpy.CreateFeatureclass_management(folder, sf, "POLYGON", fc, "SAME_AS_TEMPLATE", "SAME_AS_TEMPLATE", sr)
arcpy.RefreshCatalog(folder)
#Open search and insert cursors
n = 0
insrecs = arcpy.InsertCursor(outfc)
recs = arcpy.SearchCursor(fc)
rec = recs.next()
while rec:
x = rec.getValue(x)
y = rec.getValue(y)
angle = rec.getValue(angle)
azimuth = rec.getValue(azimuth)
azimuth = operator.mod(azimuth, 360)
if azimuth <= 90:
azimuth = 90 - azimuth
elif azimuth <= 360:
azimuth = 360 - (azimuth -90)
arr = arcpy.Array()
azimuth1 = azimuth - (angle/2)
azimuth2 = azimuth + (angle/2)
azimuthSo = azimuth1
arr.add(x,y)
while True:
tx = x + math.cos((math.pi/180) * azimuthSo) * 1000
ty = y + math.sin((math.pi/180) * azimuthSo) * 1000
point = arcpy.Point()
point.x = tx
point.y = ty
arr.add(point)
if azimuthSo >= azimuth2:
break
azimuthSo +=5
arr.add(x,y)
#arcpy.AddMessage(add)
#Add feature
insrec = insrecs.newRow()
insrec.Shape = arr
fld = fields.reset()
fld = fields.next()
while fld:
if fld.name <> "Shape" and fld.name <> "FID":
insrec.setValue ( fld.name, rec.getValue(fld.name))
fld = fields.next()
insrecs.insertRow(insrec)
#Next records
n = n + 1
rec = recs.next()
#arcpy.AddMessageno of features
arcpy.RefreshCatalog(folder)
arcpy.AddMessage("\n" + str(n) + " features stored")
#Completion message
arcpy.AddMessage("\n** Finished **\n")
except:
#Error
arcpy.AddMessage("\n** Error **\n")
finally:
#Cleanup
del arcpy
#arcpy.AddMessage("\n** Finished **\n")
... View more
10-14-2011
04:36 AM
|
0
|
4
|
5019
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|