POST
|
I have a GP service which takes as input a GPDataFile. I want to be able to upload a file from a local machine and then let a GP service to process it. This functionality is working as expected when I use the Upload Item with ArcGIS Server. However I am wondering if this is really necessary. Is it possible to supply the html file object directly? HTML code to browse to a file. <input id="uploadInput" type="file" name="myFile"> JavaScript code to get the file. Returns an File object. document.getElementById("uploadInput").files[0] Can this File object be given as input directly to a GP service which accepts GPDataFile as input?
... View more
05-03-2015
11:16 PM
|
1
|
1
|
2353
|
POST
|
import arcpy, math
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"C:\GIS\Temp\test.gdb"
tempworkspace = arcpy.env.workspace
in_poly_fc = r"C:\GIS\Temp\test.gdb\CirclesFeatureClass"
clip_lines_fc = r"ClipLines"
sum_lines_fc = r"SumClipLines"
#converting an existing fc with circles to Geometry objects
geometries = arcpy.CopyFeatures_management(in_poly_fc,arcpy.Geometry())
for feature in geometries:
#obtaining a centroid of the circle centroid via Geometry class attribute
centroid_Point = feature.trueCentroid
centroid_xy = []
#obtaining XY coordinates of the centroid via Point class attribute
centroid_xy.append(centroid_Point.X)
centroid_xy.append(centroid_Point.Y)
#obtaining the radius
#have to add a small overhead value to make sure the radius end point will overshoot the polygon
#otherwise may get undershooting lines which depends on the precision of the coordinates
#and XY tolerance of the source data
radius = math.sqrt(feature.area / math.pi) + 1
#supply the list of angles for bearing
bearing_angles = [0,60,120,180,240,300,360]
#creating bearing angles table and adding fields
bearing_table = arcpy.CreateTable_management(tempworkspace,"BearingDataTable")
arcpy.AddField_management(bearing_table,"Xcoord","Double")
arcpy.AddField_management(bearing_table,"Ycoord","Double")
arcpy.AddField_management(bearing_table,"Bearing","Double")
arcpy.AddField_management(bearing_table,"Distance","Double")
#inserting all required lines constructed from centroid with the radius and bearing angle
with arcpy.da.InsertCursor(bearing_table,["Xcoord","Ycoord","Bearing","Distance"]) as ins_cursor:
for bearing_angle in bearing_angles:
ins_cursor.insertRow((centroid_xy[0],centroid_xy[1],bearing_angle,radius))
del ins_cursor
#projected coordinate system used for output lines feature classes generated
project_coordsys = """PROJCS['NAD_1927_StatePlane_Alabama_East_FIPS_0101',GEOGCS['GCS_North_American_1927',
DATUM['D_North_American_1927',SPHEROID['Clarke_1866',6378206.4,294.9786982]],PRIMEM['Greenwich',0.0],
UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],
PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-85.83333333333333],
PARAMETER['Scale_Factor',0.99996],PARAMETER['Latitude_Of_Origin',30.5],
UNIT['Foot_US',0.3048006096012192]];-17948200 -43887100 3048,00609601219;
-100000 10000;-100000 10000;3,28083333333333E-03;0,001;0,001;IsHighPrecision"""
arcpy.BearingDistanceToLine_management(bearing_table,clip_lines_fc,"Xcoord","Ycoord",
"Distance","Feet","Bearing",spatial_reference=project_coordsys)
#adding each circle's 8 lines in iteration to the sum output line feature class
arcpy.Append_management(clip_lines_fc,sum_lines_fc,"NO_TEST")
#deleting temp feature classes to avoid locking issues at next iteration
arcpy.Delete_management(bearing_table)
arcpy.Delete_management(clip_lines_fc)
#cutting each circle in the polygon feature class by using the lines obtained earlier
arcpy.FeatureToPolygon_management([in_poly_fc,sum_lines_fc],"Quadrants","#","ATTRIBUTES","#")
... View more
04-30-2014
12:30 AM
|
0
|
0
|
547
|
POST
|
I would suggest using Python for that. You would need to use xlrd package. When you will read each column, the cell values you will get become input parameters values for the Create Feature Class GP tool. There is a good tutorial on how to read the Excel sheet here.
... View more
10-23-2013
10:51 PM
|
0
|
0
|
237
|
POST
|
Jamal, start simple and go through the tutorial using the ArcTutor data: http://resources.arcgis.com/en/help/main/10.2/index.html#/Shortest_Route/00570000009q000000/. When your model works fine in Desktop, you will be able to publish it successfully as a GP service, but first make sure you understand the model logic. It may take some time since you are working with a fairly complex business process.
... View more
10-17-2013
01:20 AM
|
0
|
0
|
1536
|
POST
|
Jamal, hope you understand that the tools you have mentioned are in ArcMap and cannot be reached directly from the SL Viewer. Just fyi, some of the tools do exist as GP tools. You cannot create a new network dataset from scratch, but you are able to create a network dataset and then use GP tools to modify some of its properties and then run Build Network Dataset tool. Make Route Layer Add Locations Look at the overview of the GP tools available in NA.
... View more
10-16-2013
11:38 PM
|
0
|
0
|
1536
|
POST
|
Jamal, there is no support widget-wise for using a map service with Network Analysis capability. If you want to integrate routing function within ArcGIS Viewer for Silverlight, you need to write own widget. Another worth considering alternative is to use GP services for routing/service area/VRP solvers. They are very easy to publish since 10.1 and there is no special configuration required. Geoprocessing service example: Shortest route on a street network
... View more
09-30-2013
03:36 AM
|
0
|
0
|
1536
|
POST
|
I would definitely recommend going ArcGIS for Server: Site Configuration and Administration 10.2, since in Migrating to ArcGIS 10.2 for Server there is too much specific information for 10.0 (SOM, SOC, etc) which are not relevant for you any longer since you have already obtained hands-on experience with 10.1 architecture. However, there is no architectural difference between 10.1 and 10.2, so you should also consider if you really need to go this course 🙂 ArcGIS for Server: Site Configuration and Administration in general gives you anyway a good understanding of the 10.1/10.2 architecture, so worth going through the materials.
... View more
09-30-2013
03:30 AM
|
0
|
0
|
337
|