Closed azad456 closed 7 years ago
Take a look at one of the solutions - http://solutions.arcgis.com/utilities/water/help/high-low-water-consumption/
they provide a process to do this using ArcRest
@azad456 You need to use the arcpymapping for ArcGIS Desktop or the arcpy.mp module (Pro) to create an SD file.
Check out: http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/createmapsddraft.htm
After you have the SD file, all you have to do is add the item and publish it using ArcREST.
Thanks a lot Mike man Andrew
Now I have made a SD file by this script : import arcpy
import arcpy
wrkspc = 'G:/HighLowWaterConsumptionA4W/Maps and GDBs/' mapDoc = arcpy.mapping.MapDocument(wrkspc + 'Byggegrunde.mxd')
service = 'Byggegrunde' sddraft = wrkspc + service + '.sddraft' sd = wrkspc + service + '.sd' summary = 'Byggegrund' tags = 'Byggegrund, Lemvig'
analysis = arcpy.mapping.CreateMapSDDraft(mapDoc, sddraft, service, 'MY_HOSTED_SERVICES', '', True, None, summary, tags)
if analysis['errors'] == {}:
arcpy.StageService_server(sddraft, sd)
else:
print analysis['errors']
did you look at the function in ArcRestHelper, it does all this for you?
Hello I have an MXD file, I want to publish it to ArcGIS Online and creat an application. I will publish it first time "manually" via Arcmap and then using Web App Builder for creating my app . I need to write a script which uploads the MXD and will overwrites the existing services in ArcGIS Online so my application will get updated as well.
I Have found this Script but I am not sure i it is the right one to use.: https://github.com/Esri/ArcREST/blob/681bdca2239e6950dc20ebd97d329fc2f1064fdf/samples/update_features.py Thanks for helping