|
POST
|
Hi Bhavin, You'll need another function which will do a case insensitive check on field name and return case sensitive field name which you can use to access the value. Refer below highlighted code changes. function getCaseSensitiveAttributeName(fieldAliases, fieldName){ for (var key in fieldAliases) { if (key.toUpperCase() === fieldName.toUpperCase()){ return key; } } return ""; } function selectInBuffer(response){ var feature; var features = response.features; var inBuffer = []; //filter out features that are not actually in buffer, since we got all points in the buffer's bounding box var mySensitiveField = getCaseSensitiveAttributeName(response.fieldAliases, <<Your Field Name>>); for (var i = 0; i < features.length; i++) { feature = features; if(circle.contains(feature.geometry)){ inBuffer.push(feature.attributes[mySensitiveField]); } } var query = new Query(); query.objectIds = inBuffer; //use a fast objectIds selection query (should not need to go to the server) featureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(results){ var totalPopulation = sumPopulation(results); var r = ""; r = "<b>The total Census Block population within the buffer is <i>" + totalPopulation + "</i>.</b>"; dom.byId("messages").innerHTML = r; }); }
... View more
08-04-2014
07:16 PM
|
0
|
0
|
2406
|
|
POST
|
Still with RGB alone you can't create transparency, you'll need to alpha as well.
... View more
08-04-2014
07:15 AM
|
1
|
0
|
1371
|
|
POST
|
1. Use summary statistics tool, statistics field will be your Elev_Diff and statistics will be MIN, don't use any case field. This will create a table with one row, containing your minimum Elev_Diff. 2. Then Iterate field value of this table to get your name parameter.
... View more
08-04-2014
06:59 AM
|
0
|
0
|
9720
|
|
POST
|
Hi Tim, Javascript API as such is free and you are free to use it anywhere without having to pay any licence cost to ESRI, as long as you are using it with ESRI products. Be mindful that ArcGIS Services that you consuming in your JavaScript API are running from an adequately licensed ArcGIS Server installation. If you are consuming services published from your developer license in your personal website, most likely you are in violation of license agreement. Since developer license if for prototyping and testing purpose only, and not for commercial use. As domenico suggested, check with your ESRI distributor in writing to play it safe.
... View more
08-04-2014
06:42 AM
|
2
|
0
|
1156
|
|
POST
|
Hi Duncan, Thanks for your reply. What i'm actually looking for is to establish join between two layers using more than one field. Users should be able to specify the field combinations.
... View more
08-04-2014
06:31 AM
|
0
|
1
|
1025
|
|
POST
|
Hi Stephen, 1. One option is to get envelope of the buffer geometry, this will always be a 4 point rectangle. 2. If you are looking for a minimum bounding rectangle then you may want to create a geoprocessing service using minimum bounding geometry tool. Refer below links on how to go about it. Minimum bounding geometry task - ArcGIS Desktop Publishing geoprocessing service - ArcGIS Help 10.1
... View more
08-04-2014
06:19 AM
|
0
|
0
|
684
|
|
POST
|
May be this helps. import arcpy import os fc = str(sys.argv[1]) templine = fc + "_line_temp" workspace = os.path.dirname(fc) fields = [] for f in arcpy.ListFields(fc): if f.type != "OID": fields.append(f.name) arcpy.SplitLine_management(fc, templine) arcpy.DeleteFeatures_management(fc) # if feature class is not in feature dataset then use arcpy.da.Editor(workspace) with arcpy.da.Editor(os.path.dirname(workspace)) as edit: edit.startEditing(False, False) edit.startOperation() with arcpy.da.SearchCursor(templine,["Shape@"]) as sc: with arcpy.da.InsertCursor(fc, ["Shape@"]) as ic: for row in sc: ic.insertRow(row) del ic del sc edit.stopOperation() edit.stopEditing(True) arcpy.Delete_management(templine)
... View more
08-04-2014
01:18 AM
|
0
|
1
|
5359
|
|
POST
|
plz check the case for StreetLevelscale, i have made a mistake in case.
... View more
08-04-2014
12:20 AM
|
1
|
1
|
1671
|
|
POST
|
Sorry din't notice that you are trying to add a dynamic map service to your map, in this case you can't use scale level. When using dynamic map service centerAndZoom's second variable will be a zoom factor. Try below code: var StreetLevelScale = 2500; require([ "esri/map", "esri/toolbars/draw", "esri/symbols/SimpleMarkerSymbol", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/symbols/CartographicLineSymbol", "esri/graphic", "esri/Color", "dojo/dom", "dojo/on", "dojo/domReady!" ], function( Map, Draw, SimpleMarkerSymbol, ArcGISDynamicMapServiceLayer, SimpleLineSymbol, SimpleFillSymbol, CartographicLineSymbol, Graphic, Color, dom, on ) { map = new Map("mapDiv", { zoom: 12 }); // Base map var basemap = new ArcGISDynamicMapServiceLayer("http://myserver/Basemap/map/"); basemap.setVisibleLayers([0, 1, 2, 3, 4, 5, 6, 7]); map.addLayer(basemap); map.on("load", initToolbar); // Zoom in to local area map.on("click", function(e){ if (map.getScale() > StreetLevelscale){ map.centerAt(e.mapPoint); map.setScale(StreetLevelscale); } });
... View more
08-04-2014
12:19 AM
|
1
|
2
|
1671
|
|
POST
|
Ssuspect your base map has less than 17 cache level. Change streetLvlZoom variable to say 12 or last level ID.
... View more
08-03-2014
11:31 PM
|
0
|
4
|
1671
|
|
POST
|
I'm trying to create a script tool with field mapping, similar to append tool in in data management. I want user to be able to specify two layers, one source and one destination. Once source layer and destination layer are specified populate common fields to populate source and destination layer as field map. When i specify Field mapping parameter, i have to manually specify output field manually, still it won't let me establish relation between two fields from these two layers.
... View more
08-03-2014
11:18 PM
|
0
|
3
|
5339
|
|
POST
|
<!DOCTYPE html> <html><head> <title>Create a Map</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <link rel="stylesheet" href="http://js.arcgis.com/3.10/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css"> <style> html, body, #mapDiv{ padding: 0; margin: 0; height: 100%; } </style> <script src="http://js.arcgis.com/3.10/"></script> <script> this.map = null; this._scaleBar = null; require(["esri/map", "esri/dijit/Scalebar", "dojo/on", "dojo/domReady!"], function(Map, Scalebar, on) { this.map = new Map("mapDiv", { center: [-56.0, 38.0], zoom: 3, basemap: "streets"}); dojo.connect(this.map, "onLoad", dojo.hitch(this, function () { var options = {"map": this.map, "attachTo": "bottom-left", "scalebarUnit": "dual" } this._scaleBar = new Scalebar (options); })); dojo.connect(this.map, "onClick", dojo.hitch(this, function () { this._scaleBar.hide(); })); }); </script> </head> <body class="claro"><div id="mapDiv"></div> </body> </html>
... View more
08-03-2014
05:43 PM
|
1
|
0
|
1761
|
|
POST
|
Hi Filip, If you want to access the scalebar object outside the context of map event, as you mentioned dojo.hitch is the answer for you. I have modified your code, hope this helps you.
<!DOCTYPE html>
<html><head>
<title>Create a Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">
<style> html, body, #mapDiv{ padding: 0; margin: 0; height: 100%; } </style>
<script src="http://js.arcgis.com/3.10/"></script>
<script>
this.map = null;
this._scaleBar = null;
require(["esri/map", "esri/dijit/Scalebar", "dojo/on", "dojo/domReady!"], function(Map, Scalebar, on) {
this.map = new Map("mapDiv", { center: [-56.0, 38.0], zoom: 3, basemap: "streets"});
dojo.connect(this.map, "onLoad", dojo.hitch(this, function () {
var options = {"map": this.map, "attachTo": "bottom-left", "scalebarUnit": "dual" }
this._scaleBar = new Scalebar (options);
}));
dojo.connect(this.map, "onClick", dojo.hitch(this, function () {
this._scaleBar.hide();
}));
});
</script>
</head>
<body class="claro"><div id="mapDiv"></div> </body>
</html>
... View more
08-03-2014
05:41 PM
|
0
|
1
|
1761
|
|
POST
|
Assuming this code is working, Change this line from mapping.ExportToJPEG(mxd, r"C:\Temp\Map_" + str(x) + ".jpg", df, df_export_width=3004, df_export_height=2125, world_file=True) to mapping.ExportToJPEG(mxd, r"C:\Temp\Map_" + str(row.getValue(<<fieldName>>)) + ".jpg", df, df_export_width=3004, df_export_height=2125, world_file=True) where <<fieldName>>, is the name of the field which has polygon data.
... View more
07-31-2014
11:40 PM
|
0
|
0
|
1718
|
|
POST
|
That number should be equal to your feature class XY tolerance.
... View more
07-31-2014
06:07 PM
|
0
|
2
|
716
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-31-2014 06:04 AM | |
| 1 | 09-25-2014 06:03 PM | |
| 1 | 09-16-2014 06:15 PM | |
| 1 | 10-08-2014 03:50 AM | |
| 1 | 08-25-2014 08:33 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|