DOC
|
Jake Skinner in a web browser if I go to: http://<domain name>/arcgis/admin/generateToken then there is a message saying that administrative access has been disabled. In a web browser if I go to: http://<domain>:6080/arcgis/tokens or http://<domain>:6080/arcgis/tokens/generateToken then the browser says that the connection timed out. In a web browser if I go to the same urls as above but without the :6080, i.e.: http://<domain>/arcgis/tokens or http://<domain>/arcgis/tokens/generateToken then it eventually does load a page which would generate a token but it is taking a long time (in the region of 30-60 seconds for the page to load). However putting the same urls into the python script gives the error message about "URL is incorrect...". Is it possible that the problem is with the amount of time it seems to be taking to generate the token?
... View more
08-21-2018
07:38 AM
|
0
|
0
|
6442
|
DOC
|
Apologies Jake Skinner, I wasn't actually putting in the server name (the variable in that part of the script is named 'server' and I was just using that variable name). I don't know the server name so what I had used in the script was: http://<domain name>:6080/arcgis/admin/generateToken but it still gives the same error message. Any ideas why?
... View more
08-21-2018
02:55 AM
|
0
|
0
|
6442
|
DOC
|
Thanks for the suggestion, unfortunately it's still showing the same error message. If I change the script to: tokenURL = 'http://' + server + ':6080/arcgis/admin/generateToken' It still gives the "URL is incorrect. Or, Service is secure, please enter username and password" message. If I go to that url in a browser, the page times out from taking too long to respond. Still in a browser if I go to http://<domain>/arcgis/tokens or http://<domain>/arcgis/tokens/generateToken it loads a page that you can generate a token on. But if I then change the script to: tokenURL = 'http://' + server + '/arcgis/tokens/generateToken' It still gives the "URL is incorrect. Or, Service is secure, please enter username and password" message.
... View more
08-17-2018
06:50 AM
|
0
|
0
|
5491
|
DOC
|
Thanks Jake Skinner. It says that I can only send a message to people that are following me, please can you follow me?
... View more
08-17-2018
02:56 AM
|
0
|
0
|
5491
|
DOC
|
Hi Jake Skinner, I'm trying to use your lovely tool to download data from a secure ArcGIS Server feature service but I'm getting an error message saying "URL is incorrect. Or, Service is secure, please enter username and password." I've checked the URL and username and password that I'm entering and I'm sure I've entered them correctly because I used the same credentials to view the data in ArcGIS Desktop. Before I got this error message I was getting a different error message, an InsecureRequestWarning saying that an "Unverified HTTPS request is being made." I trust the connection so after some brief investigations I added a couple of lines to the top of your script to disable warnings about the connection being insecure: from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) But now I get the message "URL is incorrect. Or, Service is secure, please enter username and password." I'm now unsure as to what to do next. Are you able to offer any advice about why I'm seeing this message or how I might overcome it?
... View more
08-16-2018
09:06 AM
|
0
|
0
|
5491
|
POST
|
Thanks for getting back to me Joshua. I've edited the original post with the code and some data
... View more
02-10-2017
10:11 AM
|
0
|
1
|
2062
|
POST
|
I'm writing a Python script that will take a csv containing point data, create an xy event layer from the csv and then create a file geodatabase feature class from that xy event layer (and then will do some more things with the feature class). One of the text fields in the csv has entries that in some cases have more than 255 characters and I'm struggling to work out how to get the csv/xy event layer to convert to a file geodatabase feature class. I had thought to use the arcpy.CopyFeatures_management tool but it won't work with the entries that have more than 255 characters. I next looked into manually creating an empty feature class with all of the fields already in it (editing the length of that one field to contain 1,000 characters) and use the arcpy.Append_management tool to append the features into feature class but the append tool won't take an xy event layer as the input. I have the empty feature class created with the field length edited to contain 1,000 characters so I've also tried to use cursor.insertRow to insert the features from the xy event layer in to the empty feature class but I'm getting an error I think when I define the cursor: cursor = arcpy.da.InsertCursor("D:\\GISData\\AccidentAnalysis\\AccidentAnalysis.gdb\\aa13To16", "*") Perhaps this is the way to go but I've not used the cursor much and I can't figure out why this isn't working. I'm looking for other ways to get this csv converted to a feature class but haven't found one yet. Any suggestions? Or any advice on how to get the cursor.insertRow to work? Cheers, Mike Edit: arcpy code: import arcpy sr = arcpy.SpatialReference(27700) inputCsv = "D:\\GISData\\AccidentAnalysis\\TestData.csv" aaLayer = "aaLayer" arcpy.MakeXYEventLayer_management(inputCsv, "easting", "northing", aaLayer, sr) cursor = arcpy.da.InsertCursor("D:\\GISData\\AccidentAnalysis\\AccidentAnalysis.gdb\\aa13To16", "*") for feature in aaLayer: cursor.insertRow(feature) del cursor
... View more
02-10-2017
09:09 AM
|
0
|
4
|
5629
|
POST
|
D'oh! Thanks very much Robert, that has fixed it. Cheers, Mike
... View more
02-29-2016
02:55 AM
|
0
|
0
|
1622
|
POST
|
Thanks Ken. Actually it should work with the square brackets and I've already tried it without the square brackets but it still doesn't work.
... View more
02-26-2016
07:45 AM
|
0
|
2
|
1622
|
POST
|
I'm having a problem using popup.show, when I pass a point into it an error message appears in Chrome developer tools saying "TypeError: Cannot read property 'toScreen' of undefined(…)". I've gone over it but I can't see what I'm doing wrong. The map I'm developing should allow people to find the relevant polling station for their address. The polling station name, address and coordinates are attributes of a polling district boundary dataset. I want the map to: - perform an address search using a custom locator - when the select-result event is fired use the location returned by the address search as the input geometry to a featureLayer.queryFeatures task - the query features task will query the polling district polygons feature layer - when the query finishes get the attributes, create a new point for the location of the polling station - center and zoom the map on the point - then show the name and address of the polling station in a popup. I know that the point exists because the centerAndZoom works and I can also create a graphic from the point and add that to the map. It's just when I try popup.show(pollingStation) that the error appears Any help would be greatly appreciated. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Polling places</title> <link rel="stylesheet" href="http://js.arcgis.com/3.15/esri/css/esri.css"> <style> html, body, #map { height: 100%; width: 100%; margin: 0; padding: 0; } body { background-color: #FFF; overflow: hidden; font-family: "Trebuchet MS"; } #search { display: block; position: absolute; z-index: 2; top: 20px; left: 75px; } #mapCopyright { height: 20px; width: 250px; position: absolute; bottom: 1px; left: 5px; z-index: 0; } </style> <script src="http://js.arcgis.com/3.15/"></script> <script> var map, popup; var locatorUrl = "http://edinburghcouncilmaps.info/locatorhub/arcgis/rest/services/CAG/ADDRESS/GeocodeServer/"; require(["esri/map", "esri/dijit/Popup", "esri/layers/ArcGISTiledMapServiceLayer", "esri/layers/FeatureLayer", "esri/geometry/Extent", "esri/geometry/Point", "esri/tasks/query", "esri/tasks/locator", "esri/dijit/Search", "dojo/_base/array", "dojo/DeferredList", "esri/arcgis/utils", "esri/graphic", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "dojo/_base/Color", "esri/SpatialReference", "esri/symbols/PictureMarkerSymbol", "esri/InfoTemplate", "esri/config", "dojo/dom-construct", "dojo/domReady!"], function(Map, Popup, ArcGISTiledMapServiceLayer, FeatureLayer, Extent, Point, Query, Locator, Search, arrayUtils, DeferredList, arcgisUtils, Graphic, SimpleMarkerSymbol, SimpleLineSymbol, Color, SpatialReference, PictureMarkerSymbol, InfoTemplate, esriConfig, domConstruct) { popup = new Popup(null, domConstruct.create("div")); popup.resize(180, 200); map = new Map("map", { extent : new Extent({ "xmin" : 324660, "ymin" : 673800, "xmax" : 325650, "ymax" : 674150, "spatialReference" : { "wkid" : 27700 } }), }); var basemapUrl = "http://edinburghcouncilmaps.info/arcgis/rest/services/Basemaps/basemap/MapServer"; var basemap = new ArcGISTiledMapServiceLayer(basemapUrl); map.addLayer(basemap); var infoT = new InfoTemplate(); infoT.setTitle("Your polling station is"); infoT.setContent("${POLLING_PL}<br/>" + "${FULL_AD}<br/>"); var pollingDistricts = new FeatureLayer("http://edinburghcouncilmaps.info/arcgis/rest/services/Misc/INSPIRE/MapServer/28", { mode : FeatureLayer.MODE_SELECTION, infoTemplate : infoT, outFields : ["*"] }); map.addLayer(pollingDistricts); pollingDistricts.hide(); //create search widget for address searching search = new Search({ sources : [{ //Pass in the custom locator to the sources locator : new Locator(locatorUrl), enableSuggestions : false, singleLineFieldName : "LH_ADDRESS", outFields : ["*"], placeholder : "Search addresses", showInfoWindowOnSelect : false, }], map : map, enableSearchingAll : false, }, "search"); search.startup(); //when a result is found, search polling districts and get the map to zoom to the location of the polling station search.on("select-result", showPollingStation); function showPollingStation(evt) { popup.hide(); popup.clearFeatures(); pollingDistricts.clearSelection(); var point = evt.result.feature.geometry; var query = Query(); query.geometry = point; pollingDistricts.selectFeatures(query, pollingDistricts.SELECTION_NEW, function(results) { }); //once polling district found, center the map on the polling station and show name and address in popup pollingDistricts.on("selection-complete", showAddress); } function showAddress(event) { var results = pollingDistricts.getSelectedFeatures(); x = results[0].attributes["X"]; y = results[0].attributes["Y"]; var station = results[0].attributes["POLLING_PL"]; var address = results[0].attributes["FULL_AD"]; console.log("polling station coordinates: " + x + ", " + y + " " + station + ", " + address); //create new point for polling station var pollingStation = new Point([x, y], new SpatialReference({ wkid : 27700 })); popup.setContent(station + "</br> " + address); //center the map on the polling station map.centerAndZoom(pollingStation); symbol = SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 12, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 0, 0]), 2), new Color([255, 0, 0])); newGraphic = new Graphic(pollingStation, symbol); map.graphics.add(newGraphic); //show popup popup.show(pollingStation); } }); </script> </head> <body> <div id="search"></div> <div id="map"></div> <span id = "mapCopyright" style="font-family:arial;color:black;font-size:9px;"> © Crown Copyright and database right. All rights reserved. </br> Ordnance Survey License number 100023420. </span> </body> </html>
... View more
02-26-2016
06:43 AM
|
0
|
4
|
4743
|
POST
|
Thanks very much Robert for the fix and thanks Tracey for the suggestions. Yes Robert, it does work just fine. That's great both of you, really appreciated. Cheers, Mike
... View more
07-30-2014
09:37 AM
|
0
|
0
|
836
|
POST
|
Hi, really sorry for the delay in getting back to you, I got pulled onto another project. Yeah, here it is: Edit fiddle - JSFiddlehttp://jsfiddle.net/nPqS8/ There seems to be two problems. 1. If searching for addresses in the same polygon, sometimes after searching for a second consecutive address in the same polygon, the map starts to zoom to the second address and then the zoom jumps back to the first address. 2. If searching for addresses in the same polygon in the feature layer that is being queried, sometimes after searching for a new address in the same polygon, the extent changes to centre on the new address but the popup containing the information about that polygon remains displayed over the old address. Here are some example addresses that should highlight the problems: 17 home street 17 brougham place 1 lauriston gardens 94 fountainbridge These problems don't seem to occur if searching for addresses that fall into different polygons from the previously selected polygon. Cheers
... View more
07-29-2014
08:05 AM
|
0
|
0
|
836
|
POST
|
I'm coming back to this because I never got it sorted before. I've got the reference to the proxy in my code. If I don't include the line esriConfig.defaults.io.alwaysUseProxy = true; then the buffer operation executes using GET. If I include the flag to set alwaysUseProxy to be true I can see that the requests for loading my ArcGISTiledMapServiceLayer tiles are going through the proxy, however the buffer operation doesn't execute (the buffer doesn't appear in the network requests and there aren't any errors in the console). Any suggestions how I can work out what's going on? Cheers
... View more
06-30-2014
03:25 AM
|
0
|
0
|
1182
|
POST
|
I've worked it out. var xcoord = new Number(getUrlVars()["x"]); var ycoord = new Number(getUrlVars()["y"]); creates objects var xcoord = Number(getUrlVars()["x"]); var ycoord = Number(getUrlVars()["y"]); creates numbers. And now that the url parameters are numbers the point is displaying
... View more
06-26-2014
03:10 AM
|
0
|
0
|
352
|
POST
|
Hi, I'm trying to have a simple map that will show an ArcGISTiledMapServiceLayer as the basemap. On top of this I want to add a graphic (a point) created with x and y values given as url parameters. The first problem I had was that I was getting an error saying map.graphics is null. I came across this forum post that says that I need to wait until the map load event is fired before adding the graphic. I tested that this works by manually typing x and y coordinates into the arguments I'm passing into the mapLoadHandler method like so: map.on("load", function(){mapLoadHandler(325000, 675000);}); But in reality I want to pass the x and y values from the url parameters as arguments into the mapLoadHandler method and if I do this then the graphic doesn't appear (and there aren't any error messages). Interestingly the map does centerAndZoom successfully to the location of the x and y coordinates passed into the method but I don't understand why it then doesn't draw the graphic. Here is the code: var xcoord = new Number(getUrlVars()["x"]);
var ycoord = new Number(getUrlVars()["y"]);
map.on("load", function(){mapLoadHandler(xcoord, ycoord);});
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {
vars[key] = value;
});
return vars;
}
function mapLoadHandler(xcoord, ycoord) {
//resizeMap();
var incident = new Point([xcoord, ycoord], new SpatialReference({
wkid : 27700
}));
console.log("incident.x = " + incident.x);
map.centerAndZoom(incident, 7);
var symbol = SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 18, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 105, 255]), 2), new Color([255, 0, 0]));
var newGraphic = new Graphic(incident, symbol);
map.graphics.add(newGraphic);
} Cheers, Mike
... View more
06-25-2014
08:13 AM
|
0
|
1
|
614
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|