POST
|
I am experiencing a problem with the FeatureTable.QueryAsync method that is proving very difficult to troubleshoot. I am using the SpatialQueryFilter to find all features that intersect a geometry, and *occasionally*, the QueryAsync method throws a super generic exception. There are certain areas that seem to be more problematic but I cannot pin down anything specific about the data there, and some geometries return results without error. Has anyone seen this or have any tips for troubleshooting an issue like this? My code: // find correct feature table:
FeatureTable targetTable = null;
IEnumerable<FeatureTable> matchTables = _defaultGDB.FeatureTables.Where(table => table.Name.Equals(_parcelTableName, StringComparison.OrdinalIgnoreCase));
if (matchTables.Count() > 0)
{
targetTable = matchTables.First();
}
else {
throw new Exception("The default query table could not be found.");
}
}
// Define a spatial query
var filter = new Esri.ArcGISRuntime.Data.SpatialQueryFilter();
filter.Geometry = GeometryEngine.Project(geom, targetTable.SpatialReference);
filter.SpatialRelationship = SpatialRelationship.Intersects;
// Execute the query and await results
var results = await targetTable.QueryAsync(filter); And my exception: System.Exception was caught HResult=-2146233088 Message=Internal error exception Source=Esri.ArcGISRuntime StackTrace: at RuntimeCoreNet.Interop.HandleException(Boolean retVal) at RuntimeCoreNet.CoreFeatureSource.Query(CoreQueryFilter queryFilter) at Esri.ArcGISRuntime.Data.ArcGISFeatureTable.<>c__DisplayClass24.<QueryAsync>b__23() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown ---
... View more
04-08-2015
12:16 PM
|
0
|
2
|
3155
|
POST
|
Is there any way to gracefully cancel the RequestShapeAsync task? I do not have much experience with using the C# async capabilities, but it seems the awaitable method needs to accept a cancellation token and this method does not appear to accept one. Is there any other way to cancel this method gracefully? For example, if a user is in the middle of drawing a polygon does not want to finish it, I need a way to cancel this task by clicking a cancel button.
... View more
04-03-2015
02:06 PM
|
0
|
2
|
4202
|
POST
|
Thanks Ken! For anyone else trying to do the same thing, I added ""stringFieldOption": AttributeInspector.STRING_FIELD_OPTION_TEXTAREA" to the fieldInfo object for each field I wanted to display as a textbox. var layerInfos = [{
"featureLayer": editlayer,
"fieldInfos": [
{
"fieldName": "Name",
"label": "Title",
"isEditable": true,
"stringFieldOption": AttributeInspector.STRING_FIELD_OPTION_TEXTAREA
},
{
"fieldName": "PopupInfo",
"label": "Description",
"isEditable": true,
"stringFieldOption": AttributeInspector.STRING_FIELD_OPTION_TEXTAREA
}
]
}]
var settings = {
map: map,
layerInfos: layerInfos,
geometryService: new GeometryService(config.geometryserviceurl)
};
var params = {
settings: settings
};
editorWidget = new Editor(params, editorWidgetDiv);
editorWidget.startup();
... View more
02-17-2015
09:32 AM
|
1
|
0
|
358
|
POST
|
My users would like to use the Editor widget to edit text fields with long values. Is it possible to make the editing popup text boxes larger (and/or replace them with textareas so they are multiline)?
... View more
02-12-2015
01:51 PM
|
0
|
3
|
2954
|
POST
|
Thanks Curtis! I hadn't noticed that the schema.ini file was getting created after my first run, and creating my own solved my problem.
... View more
11-07-2014
06:44 AM
|
1
|
0
|
476
|
POST
|
The first time I do a TableToTable conversion from a CSV into memory, it creates my PIN field as a LONG, but the second time, it creates it as TEXT. This happens consistently whenever I move my input CSV into a new folder and causes my second TableToTable (which uses a where clause) to fail. Any ideas why this is happening?
csv = r'C:\temp\PostalAddress.csv'
out_workspace = r'C:\temp\temp.gdb'
# add OID field
print 'creating a copy of table with OID field'
arcpy.TableToTable_conversion(csv, 'in_memory', 'unfiltered')
addr_csv = os.path.join('in_memory', 'unfiltered')
# select only status=active and PIN <> 99*
print 'filtering table for active rows'
where = "UPPER(status) = 'ACTIVE' and PIN NOT LIKE '99%'"
arcpy.TableToTable_conversion(addr_csv, out_workspace, 'addr', where)
Thanks, Ashley
... View more
11-05-2014
09:35 AM
|
0
|
2
|
2090
|
POST
|
I am trying to push a CSV file and publish it as a feature service to an ArcGIS Online for Organization account and am finding the documentation here ArcGIS REST API incomplete and/or inconsistent. I have been attempting to analyze a CSV (for several days now), but all my requests are returning 200/OK with a mostly-blank html page. I'd guess that means that I'm sending the wrong parameters, hitting the wrong url, or not setting some required header, but I've tried everything I can think of without success. Here's what I'm POSTing: URL: http://www.arcgis.com/sharing/rest/content/features/analyze Data: token=[valid token]&itemid=fd8faaef968648949802b014bb034db6&filetype=csv A few other things: I've also tried setting the text parameter to my csv text (which is the goal in the long run) but produces the same result. The documentation is unclear on whether the parameter should be called "id" or "itemid", with one sample and the parameter name as "itemid", but another example as "id". I've tried both and get the same results Anyone see this problem before or know a good way to troubleshoot this?
... View more
09-24-2014
07:04 AM
|
0
|
1
|
3464
|
POST
|
After doing more research, I discovered that rasters are always returned as TIFs from geoprocessing services. Instead, I enabled the capability to view results as a map service on the geoprocessing service, which gives me the functionality I was looking for.
... View more
06-11-2014
11:38 AM
|
0
|
0
|
345
|
POST
|
I have created a geoprocessing service that adds two TIF rasters in a specified area of interest, then copies this result to a PNG raster and returns it. It works as expected when I execute the tool from ArcMap, but when I execute the tool on ArcGIS Server (v10.1.0), it returns the TIF version of the raster. I can see the PNG is sitting in the scratch directory, but for some reason it's not being returned. Can anyone spot a mistake in my code below? import os import arcpy from arcpy import env from arcpy.sa import * # note: we're using os.path.join as a workaround for broken data source errors debug_features = os.path.join('C:\Raster\scripts\Temp.gdb\simple') # Set this to the folder containing all rasters workspace = "C:\Raster\Data" try: # Check out Spatial Analyst License arcpy.CheckOutExtension("Spatial") env.workspace = workspace # Get parameters aoi_layer = arcpy.MakeFeatureLayer_management(debug_features,'in_memory\features') raster_1 = "tmax_1.tif" raster_2 = "tmax_2.tif" # Extract only the area under the feature layer aoi_raster_1 = ExtractByMask(raster_1,aoi_layer) aoi_raster_2 = ExtractByMask(raster_2,aoi_layer) # Add two rasters out_raster = aoi_raster_1 + aoi_raster_2 # Copy to png name = arcpy.CreateUniqueName("rastermath_output.png", arcpy.env.scratchFolder) arcpy.CopyRaster_management(out_raster, name,"DEFAULTS", "","","","","16_BIT_UNSIGNED", "ScalePixelValue") # Set output param arcpy.SetParameterAsText(0, name) except Exception as e: arcpy.AddError(str(e)) finally: arcpy.Delete_management('in_memory') I cannot use the original TIF in a javascript MapImageLayer, so any advice or workarounds would be much appreciated.
... View more
06-09-2014
10:26 AM
|
0
|
1
|
2369
|
Title | Kudos | Posted |
---|---|---|
1 | 02-17-2015 09:32 AM | |
1 | 11-07-2014 06:44 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|