POST
|
Hi Daniel, Thank you for following up. I actually used a workaround by piping the data to a child process totally independent of the ArcGIS Pro module! Obviously not an ideal solution. That link does look very hopeful and much cleaner, I will try it out and let you know.
... View more
07-31-2020
03:37 AM
|
0
|
0
|
1441
|
POST
|
Thanks for your reply, I've been poking around in these folders a bit myself. The DLLs that I need all seem to be in the App Data/Local/ESRI/ArcGISPro/AssemblyCache folder. I really can't figure out why some packages work just fine but others don't. The only difference I can think of is that the one that doesn't work is dependent on info in the app.config file, but I don't see why that would be the problem. With regards to that stack overflow thread, I have added these references in both projects in the solution.
... View more
07-09-2020
06:49 AM
|
0
|
2
|
1441
|
POST
|
I am trying to use some third party dlls (Entity Framework and EntityFramework.SqlServer) in my arcgis Pro sdk module. However, whenever my code runs inside ArcMap pro, I get errors like this: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0'. Make sure the provider is registered in the 'entityFramework' section of the application config file. I have several stand alone apps with exactly the same app.config file "entityFramework" section which all work fine: <entityFramework> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> <provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" /> </providers> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework"> <parameters> <parameter value="System.Data.SqlServerCe.4.0" /> </parameters> </defaultConnectionFactory> </entityFramework> During debug, I can see that the modules have loaded. In my program output I get messages like this: C:\Users<username>\AppData\Local\ESRI\ArcGISPro\AssemblyCache{05b82a89-759c-4123-b178-75b72b968646}\EntityFramework.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ArcGISPro.exe' (CLR v4.0.30319: ArcGISPro.exe): Loaded 'C:\Users<username>\AppData\Local\ESRI\ArcGISPro\AssemblyCache{05b82a89-759c-4123-b178-75b72b968646}\EntityFramework.SqlServer.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ArcGISPro.exe' (CLR v4.0.30319: ArcGISPro.exe): Loaded 'Anonymously Hosted DynamicMethods Assembly'. Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Data.SqlServerCe\4.0.0.0__89845dcd8080cc91\System.Data.SqlServerCe.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. I wonder if anyone else has had a similar problem, if there is some reference or app.config setting I am missing. Or if ArcGIS pro sdk for .Net doesn't read the app.config?
... View more
07-08-2020
08:54 AM
|
0
|
5
|
1614
|
POST
|
I am reading data from a database that is incompatible with ArcGIS Pro into an ESRI geodatabase using the .Net SDK. The database stores primary keys as GUIDs e.g. {e372ad91-9e24-4054-9454-5bb31657f2db} which is the same format as a GUID field in an ESRI file geodatabase (.gdb). However, if I try to write these GUIDs to a file geodatabase, I get an exception at the line where I add the GUID field to the row buffer: Name Value Type ◢ $exception {"A general error when something is wrong with a Field."} ArcGIS.Core.Data.GeodatabaseFieldException Are GUIDs in file geodatabases handled in a special way? I can't seem to write in new ones generated outside of ArcGIS Pro. Thank you very much in advance. Here is the basic outline of my code and a mock feature table to illustrate my question: FacilityID Name OwnType GUIDField 1 Griffith Park Municipal {e372ad91-9e24-4054-9454-5bb31657f2db} 2 London Municipal {zyxqad91-7g76-9999-9434-5aa31657f2db} 3 India Municipal {abc1ad91-9e24-8888-1234-5aa12345f2db} public async Task CreatingAFeature() {
string message = String.Empty;
bool creationResult = false;
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
using (Geodatabase geodatabase = new Geodatabase(new Geodatabase(new FileGeodatabaseConnectionPath(new Uri("filePath")));))))
using (FeatureClass featureClass = geodatabase.OpenDataset<FeatureClass>("FeatureClassName"))
{
//declare the callback
EditOperation editOperation = new EditOperation();
editOperation.Callback(context =>
{
FeatureClassDefinition facilitySiteDefinition = featureClass.GetDefinition();
int facilityIdIndex = facilitySiteDefinition.FindField("FACILITYID");
using (RowBuffer rowBuffer = featureClass.CreateRowBuffer())
{
// Fill fields of row buffer
rowBuffer["facilityId"] = 4;
rowBuffer["NAME"] = "Griffith Park";
rowBuffer["OWNTYPE"] = "Municipal";
/* The line that throws the exception.
Commenting out this line makes everything run fine
I generate a new GUID here for the sake of the example.
Trying to write a GUID from the dataset, or writing the GUID
as a string also throws an exception.
*/
rowBuffer["GUIDField"] = Guid.NewGuid(); // The line that throws the exception.
... code continues
... View more
07-06-2020
05:46 AM
|
0
|
2
|
978
|
POST
|
I'm trying to query some data using ESRI JS API version 4.0. The data table that looks like a longer version of this: Object_ID Item_ty_co Serv_grade 1 "MH" 5 2 "MH" 3 3 "IN" 3 4 "IN" 2 I am trying to group this data based on the item_ty_co and Serv_grade fields, and count the number of records in each group. In regular SQL, my query looks like: SELECT Item_ty_co, Serv_grade ,count(Object_ID) FROM public."pointAssets"
GROUP BY Item_ty_co ,Serv_grade
HAVING ITEM_TY_CO not in ('PN','GN','RN','CN') which gives me exactly the result I want. However, I want to recreate this in ESRI JS API by querying the layerview like this: const query = layerView.layer.createQuery();
query.outStatistics = [
{
onStatisticField: "Object_ID",
outStatisticFieldName: "numberOfAssets",
statisticType: "count" },];
query.groupByFieldsForStatistics = ["Item_ty_co ","Serv_grade" ];
query.having = "ITEM_TY_CO NOT IN ('PN','GN','RN','CN')" However, I'm having two problems here. It seems like the API just ignores any columns in the groupByFieldsForStatistics array after the first element, and doesn't use them for the groupby. When I switch the items around, it just uses the first (0th) element. query.having does not filter out the groups that I specify. So the output for the above is an array of objects like this, with one record for the unique ITEM_TY_CO's: 0: Object { numberOfAssets: 4176, ITEM_TY_CO: "PN" }
1: Object { numberOfAssets: 4662, ITEM_TY_CO: "MH" }
2: Object { numberOfAssets: 5472, ITEM_TY_CO: "CN" } I don't know where my mistakes are. I can write workarounds, but I'd really like a clean solution. Any help/ advice would be greatly appreciated.
... View more
09-26-2019
02:57 AM
|
0
|
0
|
548
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|