POST
|
I am trying to overwrite the existing service but I am getting the error below. The python version I am using is 3.5 and ArcGIS PRO version is 2.0. I am also attaching the Python script I am using. Traceback (most recent call last): File "\\i-file\Sprint\Network\02\NGN\RingConstruction\AlteryxScripts\publishtest.py", line 56, in <module> arcpy.UploadServiceDefinition_server(r"\\i-file\Sprint\Network\02\NGN\RingConstruction\DarkFiberProgressReport\NNI\NNItest.sd", "My Hosted Services", "NNItest", "EXISTING","NNI", "STARTED") File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\server.py", line 876, in UploadServiceDefinition raise e File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\server.py", line 873, in UploadServiceDefinition retval = convertArcObjectToPythonObject(gp.UploadServiceDefinition_server(*gp_fixargs((in_sd_file, in_server, in_service_name, in_cluster, in_folder_type, in_folder, in_startupType, in_override, in_my_contents, in_public, in_organization, in_groups), True))) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 506, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: ERROR 001398: Service name 'NNItest' already exists. Failed to execute (UploadServiceDefinition). Any help is appreciated.
... View more
09-18-2018
08:39 AM
|
0
|
1
|
507
|
POST
|
Hi, I am using the Select by attribute tool to select the records. I have a date field name T: (A 1305) Site Walk-Finish so I need to select only those records which has the date (T: (A 1305) Site Walk-Finish) which are in last 7 days of today's date. I am not sure how to write the expression. Thanks
... View more
07-26-2017
12:54 PM
|
0
|
1
|
689
|
POST
|
I am trying to get the popup info from multiple layers in one info window, including address, lat and long. I am not able to add address, lat long info in the same window . Also, when I click on the map it doesn’t remove the old info from the popup and keeps adding the new one. Attached is the JavaScript and the screenshot for your reference. Any help is appreciated. Thanks
... View more
07-25-2017
08:24 AM
|
0
|
1
|
1101
|
POST
|
I have found the solution below is the code in which you can see the address and XY in the same popup window. // Set up a locator task using the world geocoding service var locator = new Locator("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"); map.on("click", function(evt) { locator.locationToAddress(evt.mapPoint, 100); }); locator.on('location-to-address-complete', function(evt) { console.log(evt); var location = webMercatorUtils.geographicToWebMercator(evt.address.location) var screenPoint = map.toScreen(location); console.log(screenPoint); // dig out the best attribute from matched address to display in popup map.infoWindow.setTitle("Coordinates/Address"); map.infoWindow.setContent("Latitude: " + evt.address.location.x.toFixed(3) + "<br>Longitude: " + evt.address.location.y.toFixed(3) + "<br> Address: " + evt.address.address.LongLabel); map.infoWindow.show(screenPoint); // add an if/else and use the map click xy that you saved from the other event listener if no address was found })
... View more
07-21-2017
09:02 AM
|
0
|
0
|
1459
|
POST
|
Hi Harsh, I have tried this script and the problem , I am having is to add the address also if there is one otherwise it should give the coordinates and “no address is at this location” Thanks Manjari Goyal
... View more
05-11-2017
11:25 AM
|
0
|
1
|
1095
|
POST
|
Hi Yue Wu, I have already looked in to this and the problem is I write two independent script one for geocode the address and other for reverse geocode it works fine but when I tried to create one script where I can get both the address and lat long and it doesn't work. below is the screenshot which I am trying to create in javascript 3.12
... View more
05-10-2017
02:48 PM
|
0
|
0
|
1459
|
POST
|
I am trying to click on map and get lat, long and address in one popup window, but its not getting the address. Attached is the screenshot. Any help is appreciated. var locator = new Locator("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"); var infoTemplate = new InfoTemplate("Location", "Address: ${Address}<br/>" + "City: ${City}<br/>" + "State: ${Region}<br/>"); var symbol = new SimpleMarkerSymbol().setStyle( SimpleMarkerSymbol.STYLE_CIRCLE).setColor( new Color([0,0,255,0.5]) ); locator.on("location-to-address-complete", function(evt) { map.graphics.clear(); console.log(evt); if (evt.address.address) { var address = evt.address.address; var location = webMercatorUtils.geographicToWebMercator(evt.address.location); var graphic = new Graphic(location, symbol, address, infoTemplate); map.graphics.add(graphic); var screenPnt = map.toScreen(location); map.infoWindow.resize(300,100); } }); map.on("click", function(evt) { map.infoWindow.setTitle("Coordinates/Address"); map.infoWindow.setContent("lat/lon : " + evt.mapPoint.y.toFixed(3) + ", " + evt.mapPoint.x.toFixed(3) + "<br>Address: " + evt.mapPoint.address); map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint)); });
... View more
05-10-2017
01:37 PM
|
0
|
3
|
2241
|
POST
|
I am trying to add XY coordinates as well as address of that location. And if there is no address then it should show no address found for this location. Thanks Manjari Goyal
... View more
05-09-2017
02:14 PM
|
0
|
0
|
1095
|
POST
|
Is there any way we can add address also along with longitude and latitude. Below is the script I wrote for address but don't know how add XY info in it. map = new Map("mapDiv", { basemap: "topo", center: [-95.249, 38.954], zoom: 5, sliderStyle: "large" }); // Set up a locator task using the world geocoding service var locator = new Locator("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"); var infoTemplate = new InfoTemplate("Location", "Address: ${Address}<br/>" + "City: ${City}<br/>" + "State: ${Region}<br/>"); var symbol = new SimpleMarkerSymbol().setStyle( SimpleMarkerSymbol.STYLE_CIRCLE).setColor( new Color([0,0,255,0.5]) ); locator.on("location-to-address-complete", function(evt) { map.graphics.clear(); console.log(evt); if (evt.address.address) { var address = evt.address.address; var location = webMercatorUtils.geographicToWebMercator(evt.address.location); var graphic = new Graphic(location, symbol, address, infoTemplate); map.graphics.add(graphic); map.infoWindow.setTitle(graphic.getTitle()); map.infoWindow.setContent(graphic.getContent()); //display the info window with the address information var screenPnt = map.toScreen(location); map.infoWindow.resize(300,100); map.infoWindow.show(screenPnt, map.getInfoWindowAnchor(screenPnt), evt.mapPoint); } }); map.on("click", function(evt) { map.graphics.clear(); var mp = webMercatorUtils.webMercatorToGeographic(evt.mapPoint); locator.locationToAddress(mp, 100); }); Thanks
... View more
05-09-2017
01:45 PM
|
0
|
2
|
1095
|
POST
|
Hello, I have created a JavaScript where it geocode the address when you click on the map and added a polygon feature layer. But I am having issues with the popup. When I click on the polygon it only shows the popup for the geocoded address but not the polygon layer popup. What I want to do is when I click on the polygon it should give me the popup from that layer as well as the geocoded address for the location I clicked on the map. below is the screen shot of the map and also attaching the code file for the reference.
... View more
05-01-2017
07:54 AM
|
0
|
0
|
562
|
POST
|
I am trying to work with Group filter and the issue I am having is with the drop down. I added one layer "Test Sites" and picked a field from the layer "Category" and checked the use value option. When I click on the group filter it shows me 6 drop downs instead of one drop down under the group name. I am not sure why is that so. Any help is appreciated.
... View more
03-09-2017
07:34 AM
|
0
|
0
|
830
|
POST
|
Seems like I don't have this defense mapping extension. Is there any other way to do it.
... View more
10-12-2016
08:21 AM
|
0
|
2
|
576
|
POST
|
I am trying to convert the label for a point layer to annotation. Below is my script and the error I am getting. import arcpy from arcpy import env import arcpy.mapping # Set environment settings env.workspace = "C:\Users\Documents" arcpy.env.overwriteOutput = True #define projection Prjfile = r"C:\\Users\\Documents\\WGS1984.prj" spRef = arcpy.SpatialReference(Prjfile) #Local Variables FC7 = r"C:\Users\Documents\South.gdb\Search_Ring" mxd = arcpy.mapping.MapDocument(r"C:\Users\Documents\Demo_South.mxd") df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0] ## Convert Feature class to feature layer arcpy.MakeFeatureLayer_management(FC7, r"C:\Users\Documents\Search_Ring.lyr") layer7 = arcpy.mapping.Layer(r"C:\Users\Documents\Search_Ring.lyr") Sym_layer7 = r"C:\Users\Documents\Search Ring.lyr" ## Apply symbology and add layer to MXD arcpy.ApplySymbologyFromLayer_management (layer7, Sym_layer7) arcpy.mapping.AddLayer(df, layer7, "TOP") lyr7 = arcpy.mapping.ListLayers(mxd, "", df)[0] ## Add the labels and its format lyr7.labelClasses[0].expression = '"{}" + [Candidate_Code] + "{}"'.format("<CLR blue='255'><FNT size = '9'><BOL>", "</BOL></FNT></CLR>") lyr7.showLabels = True ## Convert label to Annotation arcpy.ConvertLabelsToAnnotation_defense (mxd, "") ## Add Layer Properties lyr7.visible = False lyr7.name = "Search_Ring" lyr7.maxScale = 0; lyr7.minScale = 5000000; lyr7.transparency = 25; arcpy.RefreshActiveView() arcpy.RefreshTOC() ## Save the mxd mxd.saveACopy(r"C:\Users\Documents\South.mxd") del mxd,df ERROR: Any help is appreciated. Thanks
... View more
10-12-2016
07:54 AM
|
0
|
4
|
1572
|
POST
|
I have tried before save and after save it doesn't work. I don't think it has anything to do with refresh as my other layer RF Decision shows correct symbology.
... View more
10-05-2016
11:02 AM
|
0
|
0
|
600
|
POST
|
Dan, I have tried it but it doesn't work with Reresh TOC. Below is the complete script. import arcpy from arcpy import env import arcpy.mapping # Set environment settings env.workspace = "C:\Users\Documents\NGN\Regions" arcpy.env.overwriteOutput = True #define projection Prjfile = r"C:\Users\Documents\NGN\Regions\WGS1984.prj" spRef = arcpy.SpatialReference(Prjfile) #Local Variables FC3 = r"C:\Users\Documents\NGN\Regions\South_DO.gdb\MW_Decision" FC4 = r"C:\Users\Documents\NGN\Regions\South_DO.gdb\RF_Decision" mxd = arcpy.mapping.MapDocument(r"C:\Users\Documents\NGN\DO Maps\Demo_South.mxd") df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0] arcpy.MakeFeatureLayer_management(FC4, r"C:\Users\Documents\NGN\Regions\RF_Decision.lyr") layer4 = arcpy.mapping.Layer(r"C:\Users\Documents\NGN\Regions\RF_Decision.lyr") Sym_layer4 = r"C:\Users\Documents\NGN\Symbology layer new\RF_Decision.lyr" arcpy.ApplySymbologyFromLayer_management (layer4, Sym_layer4) arcpy.mapping.AddLayer(df, layer4, "TOP") lyr4 = arcpy.mapping.ListLayers(mxd, "", df)[0] lyr4.visible = False lyr4.name = "RF_Decision" arcpy.MakeFeatureLayer_management(FC3, r"C:\Users\Documents\NGN\Regions\MW_Decision.lyr") layer3 = arcpy.mapping.Layer(r"C:\Users\Documents\NGN\Regions\MW_Decision.lyr") Sym_layer3 = r"C:\Users\Documents\NGN\Symbology layer new\MW_Decision.lyr" arcpy.ApplySymbologyFromLayer_management (layer3, Sym_layer3) arcpy.mapping.AddLayer(df, layer3, "TOP") lyr3 = arcpy.mapping.ListLayers(mxd, "", df)[0] lyr3.visible = False lyr3.name = "MW_Decision" mxd.saveACopy(r"C:\Users\Documents\NGN\DO Maps\South.mxd") arcpy.RefreshActiveView() arcpy.RefreshTOC() del mxd,df print "save South mxd"
... View more
10-05-2016
08:07 AM
|
0
|
2
|
600
|
Title | Kudos | Posted |
---|---|---|
1 | 10-29-2014 07:08 AM | |
1 | 09-27-2016 02:01 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|