|
POST
|
I am using identify onclick. I am able to get the attributes only with their specific names like idResult.feature.attributes['FACIL_ID'] I want to retrieve all the fields and values from the attribute table of the layer. Thanks Qazi Iqbal for a demo. use the following code:
var fields =[];
var fieldName;
for (attribute in idResult.feature.attributes)
{
fields.push(attribute);
}
for(var i=0; i<fields.length; i++)
{
fieldName =fields;
// field name
alert(fieldName);
// field value
alert(idResult.feature.attributes[fieldName]);
}
... View more
12-30-2011
09:31 AM
|
0
|
0
|
388
|
|
POST
|
The problem I am having is definitely an issue of spatial reference (SR). I'm thinking the specific problem is the transformation used to go from our default SR to the ArcGIS Online SR. All our datasets use the NAD_1983_Stateplane_Florida_East_FIPS_0901_Feet XY Coordinate System. I'm able to get my web app to correctly clip and download the data when I set my MXD Data Frame document to use just this coordinate system without a basemap. However, the clip and extract does not work if I set up my Data Frame in any of the web mercator systems. This allows me to see our data overlaid on the basemap but it doesn't clip, presumably because the transformation from State Plane to web mercator is incorrect. Neither does the clip work if I set up the Data Frame to our regular State Plane NAD 1983 Florida East (0901) and call the World_Street_Map ArcGIS online basemap through the web app. If someone could point me in the right direction of how to correct this I would be most appreciative. Here are the details of our XY NAD_1983_StatePlane_Florida_East_FIPS_0901_Feet Coordinate System: Projection: Transverse_Mercator False_Easting: 656166.666667 False_Northing: 0.000000 Central_Meridian: -81.000000 Scale_Factor: 0.999941 Latitude_Of_Origin: 24.333333 Linear Unit: Foot_US (0.304801) Geographic Coordinate System: GCS_North_American_1983 Angular Unit: Degree (0.017453292519943295) Prime Meridian: Greenwich (0.000000000000000000) Datum: D_North_American_1983 Spheroid: GRS_1980 Semimajor Axis: 6378137.000000000000000000 Semiminor Axis: 6356752.314140356100000000 Inverse Flattening: 298.257222101000020000 Have you tried to project AOI to your native SR -wkid 102658 before clipping and extraction. Making mxd/msd data from to wkid 102100 or Projecting your AOI to wkid 102658 should do the trick (i have done exactly the samp project and both work for me). if you don't midn posting your code here, i will look at it...
... View more
12-30-2011
08:17 AM
|
0
|
0
|
2281
|
|
POST
|
Thanks Heming. I appreciate the input. I'm fairly new to creating ArcGIS Server web apps. I created a new mxd and made the spatial reference of the Data Frame to 102100. I then brought in all the feature classes into that data frame. I then tested the Extract Data Task in the MXD and it worked flawlessly. However, it's a different story through the web app. The app is now returning an "Error Submitting Job" message, obviously from the JavaScript in the sample. I checked the spatial reference of the ArcGIS Server Map service and it does confirm as 102100. I guess I have some more troubleshooting ahead of me. One question I have: I'm having a hard time figuring out what you meant by "AOI." AOI -Area of Interests that references the polygon graphic you draw to clip the features.
... View more
12-27-2011
03:40 AM
|
0
|
0
|
2281
|
|
POST
|
Hello all, I'm creating an app based on the Clustermap sample by globoserver. The sample is working great and I've managed to implement a filtering mechanism. The problem I'm struggling with is trapping an error when no results are returned. It seems like the error function is not being called? dojo.connect(queryTask, "onError", function(err) {
alert("CUSTOM ERROR: " + err.details);
}); Any ideas/suggestions would be greatly appreciated. Warren M No results return does not mean query task failed. It just means that query task could not find any results.
... View more
12-26-2011
09:46 AM
|
0
|
0
|
489
|
|
POST
|
I was trying to follow the Datagrid with zoom example to my scenario. map.addLayer(new esri.layers.ArcGISDynamicMapServiceLayer ("http://mid036807/ArcGIS/rest/services/SARS/Sudan/MapServer")); var maxOffset = function maxOffset(map, pixelTolerance) { return Math.floor(map.extent.getWidth() / map.width) * pixelTolerance; }; // outFields:["Incident","actor","OBJECTID"] //add the states demographic data statesLayer = new esri.layers.FeatureLayer("http://mid036807/ArcGIS/rest/services/SARS/SICCQuery/FeatureServer/0",{ mode:esri.layers.FeatureLayer.MODE_SELECTION, maxAllowableOffset:maxOffset(map,1), outFields:["*"] }); statesLayer.setDefinitionExpression("Incident='Bombing'"); //define a selection symbol // var highlightSymbol = new esri.symbol.SimpleFillSymbol().setColor( new dojo.Color([50,205,50,.25])); var symbol = new esri.symbol.SimpleMarkerSymbol(); symbol.setColor(new dojo.Color([0,0,255])); statesLayer.setSelectionSymbol(symbol); dojo.connect(statesLayer,'onLoad',function(layer){ var query = new esri.tasks.Query(); query.where = "1=1"; layer.queryFeatures(query,function(featureSet){ var items = dojo.map(featureSet.features,function(feature){ return feature.attributes; }); var data = { identifier:"OBJECTID", items:items}; store = new dojo.data.ItemFileReadStore({data:data}); grid.setStore(store); grid.setSortIndex(1,"true"); //sort on the state name }); }); map.addLayer(statesLayer); //modify the grid so only the STATE_NAME field is sortable grid.canSort = function(col){ if(Math.abs(col) == 2) { return true; } else { return false; } }; I was able to add and get all the features into the grid but nothing is displayed in the map. Though nothing is displayed on the map i was able to Zoom into the object using my own symbology. My expectation is on adding the featurelayer it should render with the default symbology as mentioned in the Map service /Feature service. I am using Arcgis Server 10. Since you used MODE_SELECTION. For selected features to display, you have to use selectFeatures to specify the selected features. Otherwise on features are selected and therefore not display. Look into the API for info.
... View more
12-26-2011
09:43 AM
|
0
|
0
|
468
|
|
POST
|
I created a geoprocessing (GP) task to extract features from a SDE geodatabase. I created the GP task and added it to my MXD using the instructions from this video: http://www.youtube.com/watch?v=HsMK9ZtYN5k. I then re-created the "clip and ship" javascript api sample using the instructions posted here: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm. I used my mxd and ArcGIS Server services when I created my version of the sample posted here: http://gis.fortlauderdale.gov/DataDownloads/esriSample.html. The GP works as expected when initiated from ArcMap by right clicking on the "Extract Data Task," selecting "Open," then interactively drawing a graphic for clipping the features. However, the GP does not clip the features when initiated from my sample website (http://gis.fortlauderdale.gov/DataDownloads/esriSample.html). It initiates the GP but the resulting files that are downloaded only contain the structure of the files. They do not include any features. It is almost as if the application is ignoring my interactive graphic. This is getting frustrating as I've spent several days trying to figure out the problem. I am hoping someone will please chime in to provide some assistance. Thanks in advance. The issue might has something to do with the SR. The SR of your mxd/msd might be different from your AOI (102100). you could either project the AOI to SR of your layers or set up SR of you mxd/msd to 102100.
... View more
12-26-2011
09:12 AM
|
0
|
0
|
2281
|
|
POST
|
I've set up a simple example to show you what's happening. Here, http://193.136.119.25/tests/test_union.html, you'll find a map with only one layer. When you click on the buttons, a query will be performed, the results will be added to the map and then I try to perform the union based in the graphics of the map. The only difference is that one works and the other doesn't. Use the console to see what's happening. You can also switch between ESRI and local geometry services... the results will be the same. Is it a problem with the geometries? Is it something I can configure in the server? Is it just a limitation of the geometry service? The problem usually has something to do with the length of the polyon JSON string. One solution you could try is to generalize the polygons prior to union to reduce the length of the JSON string. something this this:
var generalizeParams = new esri.tasks.GeneralizeParameters();
generalizeParams.geometries =esri.getGeometries(map.graphics.graphics);
geometryServiceLocal.generalize(generalizeParams, function(geometries){
geometryServiceLocal.union(esri.getGeometries(map.graphics.graphics), function(geometry){
......
});
});
... View more
12-26-2011
09:04 AM
|
0
|
0
|
2221
|
|
POST
|
Hi Bart, The underscores within the projection name is what's causing the problem. Change: spRef = r"C:\Program Files (x86)\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\State Plane\NAD 1983 (US Feet)\NAD_1983_StatePlane_California_IV_FIPS_0404_Feet (US Feet).prj" to: spRef = r"C:\Program Files (x86)\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\State Plane\NAD 1983 (US Feet)\NAD 1983 StatePlane California IV FIPS 0404 (US Feet).prj" and it should work. Another easiest way to create SR is to use WKID. In your case your WKID =2228. You can create SR as follow:
sr = arcpy.SpatialReference()
sr.factoryCode = 2228
sr.create()
... View more
12-22-2011
08:19 AM
|
0
|
0
|
2257
|
|
POST
|
Hello, I'm attempting to perform a spatial query task using the geometry returned by a route task but it always fails and the only error I receive is "Deferred object is missing". The geometry appears to be valid, I can draw it on the map as a graphic. The code below is the route task's solveComplete handler. function showRoute(solveResult) {
var routeGeo = solveResult.routeResults[0].route.geometry;
routeGeo.spatialReference = new esri.SpatialReference({wkid:4326});
var routeGraphic = new esri.Graphic(routeGeo, routeSymbol);
map.graphics.add(routeGraphic);
var routeExtent = routeGraphic.geometry.getExtent();
routeExtent.spatialReference = new esri.SpatialReference({ wkid: 4326 });
map.setExtent(routeExtent);
var queryTask = new esri.tasks.QueryTask("http://avalanche/ArcGIS/rest/services/Toll_Calc_Web/MapServer/4");
var query = new esri.tasks.Query();
query.outFields = ["*"];
query.returnGeometry = true;
query.outSpatialReference = { "wkid": 4326 };
query.geometry = routeGeo;
queryTask.execute(query, queryPlazasComplete, errorHandler);
} If I swap out routeExtent (the extent of the route geometry) for routeGeo (the route geometry) as the geometry parameter of the query task is executes successfully. I'm a javascript API newbie so any suggestions are appreciated! Thank you!! Since route is line feature and the defalut spatialRelationship of query is SPATIAL_REL_INTERSECTS, you will not get the query results unless the features you queried intersect with the route geometry. That's also explained why use route extend worked.
... View more
12-01-2011
03:49 AM
|
0
|
0
|
1339
|
|
POST
|
Ok, I understood that part, but I was wondering what's the best approach, and if the final result will be the same. The result may or may not be the same. For example a point which may be within the extend of a polygon may actually outside that polygon.
... View more
11-29-2011
05:58 AM
|
0
|
0
|
1092
|
|
POST
|
Thanks for your response, but I accomplished the some thing (I think) using: esri.graphicsExtent(map.graphics.graphics) It seems to work fine, but can you tell me the difference between this solutions and yours? your approach used the extent of map.graphics.graphics as query.geometry while mine merged map.graphics.graphics into one geometry and used that geometry as query.geometry.
... View more
11-28-2011
09:20 AM
|
0
|
0
|
1092
|
|
POST
|
Hi there, I'm trying to create a function that performs a query on the map based in the current map.graphics. Is there an easy way to add map.graphics to the geometry parameter, besides going trough the map.graphics.graphics array to find the extents? Thanks
geometries = esri.getGeometries(map.graphics);
geometryService.union(geometries, function(geometry){
query.geometry =geometry;
...
});
... View more
11-28-2011
08:20 AM
|
0
|
0
|
1092
|
|
POST
|
Hi Is it possible to export the graphics added to a map to KML format using java script API. I am adding graphics over a map and now i wish to export this graphics to KML file. Is it possible using java script? Please help. Thanks See: http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/kmlinfo.html
... View more
11-28-2011
03:47 AM
|
0
|
0
|
867
|
|
POST
|
Hi, I'm trying to create a single scalar value as the sum of a row, then use the scalar in a field calculation: I want the sum of "UTC10_FT" call it tot_utc_ft, then use that value in a calculate field: to find the sum value: list2 = []
rows = arcpy.SearchCursor(fc)
for row in rows:
utc_ft = row.getValue("UTC10_Ft")
list2.append(utc_ft)
tot_utc_ft = sum(list2)
arcpy.CalculateField_management(parcels, "Tot_UTC_Pct", """!UTC10_Ft! / tot_utc_ft""", "PYTHON")
Currently getting this error: tot_utc_ft = sum(list) TypeError: unsupported operand type(s) for +: 'float' and 'NoneType' I'm sure this is something simple, but admittedly, not a great python programmer. The next question will be whether python will use my tot_utc_ft variable within field calculator? Or, do I need to perform this operation within an expression? Thanks for your help. rich Looks like some of your row.UTC10_Ft has null value in it. -never mind. Jake says it
... View more
11-23-2011
08:25 AM
|
0
|
0
|
1289
|
|
POST
|
Is there a way to have the layers turned off by default. Also have only a particular layer active from map initiate? Basically, I only want one or maybe 2 layers to be showing instead of all! Thanks in advance!
var landscapingLayer = new esri.layers.FeatureLayer("http://webgis.uwm.edu/ArcGISUWM/rest/services/Sustain1/MapServer/0", {id:'landscaping'});
legendLayers.push({layer:landscapingLayer,title:'Green Landscaping'});
("http://webgis.uwm.edu/ArcGISUWM/rest/services/Sustain1/MapServer/0", {id:'landscaping', visible: false});
... View more
11-23-2011
08:08 AM
|
0
|
0
|
1306
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-11-2011 12:16 PM | |
| 1 | 05-25-2017 08:26 AM | |
| 1 | 06-02-2017 07:37 AM | |
| 1 | 06-28-2011 07:02 AM | |
| 1 | 06-12-2017 10:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2024
09:57 PM
|