POST
|
Hi Victor, We have the same issue, but the arcgis.mapping WebMap() class has dependancies to ipython. Any other ideas for how to interact with a webmap through wfastcgi and the api?
... View more
01-12-2022
02:42 AM
|
0
|
0
|
2591
|
POST
|
Hello. I have this issue too, any ideas anyone? Cheers!
... View more
07-06-2020
04:14 AM
|
0
|
0
|
419
|
POST
|
Hi, I am trying to code a widget that edits the symbology of an output map service. I have a widget that works using a predefined path, so that part im ok with: e.g. mapservice/0 I need to somehow run a Geoprocessing Tool, then pass the jobid/mapservice/0 to my existing widget. (Or write a new widget, whatever is required!) Does anyone have any ideas how this should be accomplished? Maybe I just need to get the output JobID into a javascript variable and can work it out from there, does the geoprocessing widget emit any events? Possibly these threads are relevant but im not sure: Using result map service in web applications—ArcMap | ArcGIS Desktop Send a layer to the Attribute Table widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers
... View more
06-02-2020
04:38 AM
|
0
|
0
|
295
|
POST
|
Its because you have it setup like this: #aprx project that MXD(s) are being imported into
aprx = arcpy.mp.ArcGISProject(r"C:\gisfile\GISmaps\AtlasMaps\MXDtoAPRX_tempdelete\MXDtoAPRX.aprx")
for mxd in mxdlist:
add to my aprx file When really, you need it setup like this:
for mxd in mxdlist:
#Reload the empty "Template project"
aprx = arcpy.mp.ArcGISProject(r"C:\gisfile\GISmaps\AtlasMaps\MXDtoAPRX_tempdelete\MXDtoAPRX.aprx")
#import the mxd
#Save as a copy, but dont overwrite the blank template!
# (close the template project, so it can be reopened fresh and clean for the next mxd)
del aprx
... View more
11-29-2019
07:45 AM
|
1
|
1
|
5113
|
POST
|
Your code looks good. You mention other stuff also happens, perhaps your error is somehow there! You could try defining a feature layer in the script to see if that helps. (If you are running from desktop, it shouldn't make a difference) Make Feature Layer—Data Management toolbox | ArcGIS Desktop
... View more
11-25-2019
02:24 AM
|
2
|
1
|
2033
|
POST
|
Ive done something similar using the approach below: Simplify every parcel, to just 4 vertices A quick and dirty method is to use minimum rectangle - by area. Minimum Bounding Geometry—Data Management toolbox | ArcGIS Desktop Use Feature Vertices To Points—Data Management toolbox | ArcGIS Desktop to get a point for each vertex. Use Split Line at Point—Data Management toolbox | ArcGIS Desktop to convert each parcel, into 4 "Side" line features. Spatial join the sides to the roads, for each parcel, the side with the smallest distance, is the frontage on the road.
... View more
10-28-2019
04:42 AM
|
0
|
0
|
966
|
POST
|
Hello All, Is there anywhere I can type the full path to a file, to add it to the map, like in the old add data dialog of ArcMap? In my pro, it only takes me to the workspace, and doesnt add the dataset. Would especially like to be able to type in a colon delimited string like in the old days. C:\dataset1.shp;C:\dataset2.shp Thanks!
... View more
10-11-2019
10:44 AM
|
0
|
3
|
646
|
POST
|
Look up python Raw Strings, or paths generally. In short, when python sees: \ It starts looking for special characters, like \n which means new line in python speak. So, to tell it to read the text exactly as you have it entered, we add a "r" to say this is Raw string data, and ignore any fancy stuff. So basically, you need to change the code from: "E:\cnnGDB" to r"E:\cnnGDB"
... View more
08-22-2019
08:05 AM
|
0
|
0
|
347
|
POST
|
I wrote this script based on my understanding of your explanation (Which was a little hazy!) I kept your existing code exactly as it was just moved it into a function, then added one new function, and a Loop. Hopefully this helps
import arcpy
import time
def update_database():
# Input property
inPropertypntfc = r"G:\GIS\ESRI\Staging\Survey123\Testing\New File Geodatabase.gdb\propertypnts"
print(inPropertypntfc)
# input survey feature class
inSurveyfc = r"G:\GIS\ESRI\Staging\Survey123\Testing\New File Geodatabase.gdb\retailpt2"
print(inSurveyfc)
# Make feature layer of feature classes to allow selection
arcpy.MakeFeatureLayer_management(inPropertypntfc, "Propertypntlyr")
arcpy.MakeFeatureLayer_management(inSurveyfc, "Surveylyr")
# select intersecting points
arcpy.SelectLayerByLocation_management("Propertypntlyr", "INTERSECT", "Surveylyr")
print ("select")
# Update Cursor for point layer
cursor = arcpy.da.UpdateCursor("Propertypntlyr", ["CompleteY_N"])
print (cursor)
for row in cursor:
cursor.updateRow(["Completed"])
print ("Done")
del row
del cursor
arcpy.Delete_management("Propertypntlyr")
arcpy.Delete_management("Surveylyr")
def all_surveys_complete():
inPropertypntfc = r"G:\GIS\ESRI\Staging\Survey123\Testing\New File Geodatabase.gdb\propertypnts"
# Make feature layer of feature classes to allow selection
arcpy.MakeFeatureLayer_management(inPropertypntfc, "Propertypntlyr")
# Select features that are not complete
arcpy.SelectLayerByAttribute_management("Propertypntlyr", 'NEW_SELECTION',
""" "CompleteY_N" <> 'Completed' """)
#Check if we got a selection
desc = arcpy.Describe("Propertypntlyr")
if desc.FIDSet == '':
#If there is no selection, all surveys are complete
arcpy.Delete_management("Propertypntlyr")
return True
else:
arcpy.Delete_management("Propertypntlyr")
return False
#Main Script logic
#Carry on forever (until we "break" the loop)
while True:
#Existing code
update_database()
#Check if all are complete
if all_surveys_complete() == True:
#Exit the while loop
break
#Wait for 10 mins for more surveys to be completed and added to the retailpt2 layer
time.sleep(600)
print "All surveys are complete!"
... View more
08-22-2019
07:57 AM
|
1
|
1
|
839
|
POST
|
Yes, unless you install a copy of ArcGIS Desktop, or alternative ArcGIS suite products that contain arcpy on that machine. (Im not aware of any "free" products that contain arcpy, but it does come with Desktop basic!)
... View more
08-14-2019
07:54 AM
|
1
|
1
|
2360
|
POST
|
I must say it looks like you are doing very well with the pythons Sadly, I dont think you can do what you are hoping, using the GIS API. This is largely for managing of "content" on the online ecosystem, and less involved with the actual raw data and map services behind the content. (For example, if you clone a map layer, both copies still point to the same published REST service on ArcGIS Server) ------------ I am not certain as haven't tried this workflow, but I think you have a data type issue, rather than a python. It is likely that this code: search_results = gis.content.search('{}'.format(Item_ID))
Trail_Data = search_results[0] Probably returns a "ArcGIS Portal Layer", this has properties such as the name, title, sharing information etc. However, this type of data cannot be used inside a "Geo-Processing Tool". Possibly someone else can but in here, but I dont think that the features on a map service, are exposed in this manner. (As an example, If you tried dragging the services layers manually into an arcmap window, then dragging those layers into a geoprocessing tool, I think you will find even this is not permitted, possibly if the layer is published as a feature service instead of a map service they may work?) I think you would need to either: Look into ArcGIS Offline editing and synchronisation. Enable layers for offline mapping—Portal for ArcGIS | ArcGIS Enterprise create a geoprocessing tool, on the server, that exports it to a shapefile/gdb format, similar to the clip and ship example: Geoprocessing service example: Clip And Ship—Documentation | ArcGIS Enterprise
... View more
08-13-2019
08:22 AM
|
0
|
0
|
1140
|
POST
|
As you discovered, I think that you cant using basic arcpy functions, but there are workarounds, such as: you can replace its source have image elements, that are located 'off the page', then in the code you can move them into the right location as required and away again when not needed. Maybe others?
... View more
08-13-2019
08:07 AM
|
0
|
0
|
382
|
POST
|
Theres no specific way to do this, this is likely a design decision, as features can have theoretically unlimited vertexes so loading all this info to populate a dictionary etc, could be expensive and have potential to massively slow down cursors. Check out this article, that tells you the exact same thing I could but using many more words and much more coherently: Reading geometries—ArcPy Get Started | ArcGIS Desktop The code at the bottom should allow you to do as you require. import arcpy
infc = arcpy.GetParameterAsText(0)
# Enter for loop for each feature
#
for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@"]):
# Print the current multipoint's ID
#
print("Feature {}:".format(row[0]))
partnum = 0
# Step through each part of the feature
#
for part in row[1]:
# Print the part number
#
print("Part {}:".format(partnum))
# Step through each vertex in the feature
#
for pnt in part:
if pnt:
# Print x,y coordinates of current point
#
print("{}, {}".format(pnt.X, pnt.Y))
else:
# If pnt is None, this represents an interior ring
#
print("Interior Ring:")
partnum += 1p
... View more
08-13-2019
07:54 AM
|
1
|
0
|
617
|
POST
|
The error mentions 'drop field, requires a value' so I imagine it might not be a path issue. This probably means, that your 'intersection' of fields between delete these and the fcs, is returning none. So you are passing in effectively no parameter! You could try something along lines of: If len(remove_fields) >0: Remove them
... View more
07-29-2019
09:00 AM
|
0
|
0
|
7304
|
Title | Kudos | Posted |
---|---|---|
1 | 11-29-2019 07:45 AM | |
1 | 05-13-2013 07:11 AM | |
1 | 05-24-2011 07:53 AM | |
1 | 05-22-2017 05:01 AM | |
2 | 07-29-2019 05:34 AM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|