POST
|
We finally solved that problem by enabling an option in Visual Studio: Tools-->Options-->Debuuging--> enable "Use Managed Compatibility Mode"
... View more
10-02-2018
02:03 AM
|
4
|
0
|
957
|
POST
|
We recently migrated our code for ArcObjects from ArcGIS 10.2.2 and .NET 3.5 to ArcGIS 10.6.1 and .NET 4.5.1. To debug our program we heavily use the debugging-fgeatures from Visual Studio. E.g. we have code like this: IGeometry geometry = // get a geometry
// do something with the geometry With .NET 3.5. it was possible to examine this object, see here However since .NET 4 this is not anymore possible, see thie following image: I also posted this question on StackOverflow and gis.stackexchange to no avail. All I got to know is that is has to do with the way .NET wraps the unmanaged COM-objects. All my references to ESRI-assemblies have the "Embed Interop Types"-property set to false, as suggested in the answer on StackOverflow. So why is this and how can we see the COM-objects properties on .NET 4.x?
... View more
10-01-2018
06:19 AM
|
1
|
3
|
1428
|
POST
|
Seems like some very strange things gone on when debugging in Visual Studio 2015. Actually we don´t get an InvalidCastException - this is only what VS shows when debugging the code - but a COMException. Having determined that strange error it was easy to get the actual problem which was caused by a different spatial reference than that within my geodatabase. So when we don´t debug the program, we get the COMException which clearly shows the actual error, instead of the InvalidCastException indicated from the debugger in VS2015. This is not really the answer to the question - which has obviously solved itself. That´s why I didn´t mark it as the answer also.
... View more
05-24-2018
05:29 AM
|
0
|
0
|
444
|
POST
|
I was trying this in C#. However when I cast that to IPolygon (which should be the .NET-equivalent to the Polygon-interface in your Java-solution), I get an InvalidCastException, as seen here https://community.esri.com/thread/215252-jsonconvertergeometryclass-creates-invalid-geometries
... View more
05-23-2018
01:43 AM
|
0
|
0
|
1148
|
POST
|
I´m creating a SeverObjectExtension using ArcObjects for Server 10.6. Here I have a method that reads a geometry from HTTP-request as follows: public IGeometry Json2Geometry(JsonObject json)
{
IGeometry geometry = null;
IJSONReader jsonReader = new JSONReaderClass();
jsonReader.ReadFromString(json.ToJson());
IJSONDeserializer jsonDeserializer = null;
jsonDeserializer = new JSONConverterGeometry() as IJSONDeserializer;
jsonDeserializer.InitDeserializer(jsonReader, null);
geometry = ((IJSONConverterGeometry)jsonDeserializer).ReadGeometry(jsonReader, esriGeometryType.esriGeometryAny, false, false);
return geometry;
} Now I´m doing something with that geometry. In my case I cast it to IPolyline: if(geometry.GeometryType == esriGeometryPolyline)
{
var polyline = (IPolyline) geometry;
...
} I get an InvalidCastException on the coe above. So what does ReadGeometry return if not an instance of IPolyline (in case of geometrytype polyline as shown above). The JSON looks like this: {
"paths":
[
[
[486893.89699999994,5755807.910000002],
[486904.18500000244,5755744.383000003]
]
],
"spatialReference":{"wkid":25832,"latestWkid":25832}
} I also tried to create a completely new polyline based on two points. Then I converted that geometry to json using the following: ILine line = new LineClass();
(line as IGeometry).SpatialReference = point1.SpatialReference;
line.PutCoords(poin1, point2);
object optional = Missing.Value;
IPolyline pline = new PolylineClass();
((ISegmentCollection)pline).AddSegment((ISegment)line, ref optional, ref optional);
((ITopologicalOperator)pline).Simplify();
((IJSONConverterGeometry)jsonSerializer).WriteGeometry(jsonWriter, null, pline, false); When I convert that back to an IGeometry using ReadGeometry as mentioned above I also get that exception. Update: I also tried to use the less generic method ReadPolyline, which should return an IPolyline. Instead I get the mentioned exception. So whatever the method returns, it´s not an IPolyline.
... View more
05-22-2018
03:45 AM
|
0
|
1
|
773
|
POST
|
Hi James, thanks for your reply. We already considered those opportunities mentioned by you, however it feels they all have their own drawbacks. In particular - as our logic includes some millions of existing code - I doubt a geo-processing-service is the right thing as it´s hard to debug. Thinking about the SOI I doubt we can manage the amount of different operations that exist in our application by a SOI, as it does only modify the operations given by the map-service itself. However I assume we have to extend the mapserver by some functionality, which was why we thought about using the SOE in the first point.
... View more
05-07-2018
12:37 AM
|
0
|
0
|
483
|
POST
|
I am using a SOE on top of a MapService in order to enable complex editing of the features in my File-Geodatabase. We use a SOE as we have much ArcObjects-code in our code-base that wraps rows from within a table to actual features. So in fact a feature consists of several rows in different tables, thus updates to a single row should be notified by the others. We´re also using topological edits which I suppose a feature-service can´t handle. When I try to edit a feature I get the following error: Workspace or data source is read only. If I understand things right, a map-service is just for presenting a map, not for modifying the data. This is where a feature-service would come into play, which however does not have support for a Server-object-extension and thus won´t handle our business-logic very well. I´ve already tried to read the connection-properties of the underlying map-service and re-open it: public void Init(IServerObjectHelper pSOH)
{
serverObjectHelper = pSOH;
if (serverObjectHelper.ServerObject.TypeName == "MapServer")
{
m_mapServer = serverObjectHelper.ServerObject as IMapServer;
m_mapServerDataAccess = (IMapServerDataAccess)serverObjectHelper.ServerObject;
}
IMapServerInfo mapServerInfo = m_mapServer.GetServerInfo(m_mapServer.MapName[0]);
IMapLayerInfos mapLayerInfos = mapServerInfo.MapLayerInfos;
for (int layerId = 0; layerId < mapLayerInfos.Count; layerId++)
{
IFeatureClass fc = (IFeatureClass)m_mapServerDataAccess.GetDataSource(m_mapServer.MapName[0], layerId);
if (fc != null)
{
IDataset fsDataset = (IDataset)fc;
m_workspace = fsDataset.Workspace;
}
if (m_workspace != null)
break;
}
if(this.m_workspace == null)
throw new ArcGISAccessException("Workspace could not be opened");
var props = this.m_workspace.ConnectionProperties;
var factory = new FileGDBWorkspaceFactory();
var editWorkspace = factory.Open(props, 0);
} However this yields to the examt same error. I can´t see what I´m doing different than the code from the samples. I also noticed that I am able to edit the data in the geodatabase in ArcMap without any problems, even when it is used by the map-service. EDIT: To limit the cause of error I set up a completely new service that references a newly created File-Geodatabase containing only a single feature within a featureclass ("FC"). Now I update that feature within my request-handler: private byte[] ModifyFeature(NameValueCollection boundVariables, JsonObject operationInput, string outputFormat,
string requestProperties, out string responseProperties)
{
responseProperties = null;
var featureWorkspace = (IFeatureWorkspace) this.m_workspace;
var editWorksopace = (IWorkspaceEdit) this.m_workspace;
var featureClass = featureWorkspace.OpenFeatureClass("FC");
var feature = featureClass.Search(null, false).NextFeature();
var index = featureClass.FindField("MyAttribute");
if (featureClass.Fields.Field[index].Editable)
{
editWorksopace.StartEditing(false);
editWorksopace.StartEditOperation();
feature.set_Value(index, "Hallo");
feature.Store();
editWorksopace.StopEditOperation();
editWorksopace.StopEditing(true);
}
var result = new JsonObject();
result.AddString("Status", "OK");
return Encoding.UTF8.GetBytes(result.ToJson());
} I still get the same error, although I even check if the field of that feature is editable.
... View more
05-02-2018
08:23 AM
|
0
|
2
|
612
|
POST
|
This seems to push some light into the aactual problem, as I now get a HttpRequestException "The remote certificate is invalid according to the validation process."
... View more
03-15-2018
04:22 AM
|
0
|
1
|
1265
|
POST
|
I followed the samples from ESRI (e.g. this one from GitHub) to enable feature-access to my service and everything worked fine. Next I changed the URL into my own feature-service and provided my crendetials to access that service. So I ended up with the following code: //var serviceUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0";
var serviceUrl = "https://myhost/arcgis/rest/services/MyService/FeatureServer/0";
ServerInfo serverInfo = new ServerInfo
{
ServerUri = new Uri(serviceUrl),
TokenAuthenticationType = TokenAuthenticationType.ArcGISToken,
TokenServiceUri = new Uri("https://myhost/arcgis/admin/generateToken")
};
AuthenticationManager.Current.RegisterServer(serverInfo);
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(
async info =>
await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, user, password,
info.GenerateTokenOptions));
var featureTableUri = new System.Uri(serviceUrl);
var table = new ServiceFeatureTable(featureTableUri);
var queryParameters = new QueryParameters { WhereClause = "1 = 1" };
FeatureQueryResult features = await table.QueryFeaturesAsync(queryParameters); When I execute this code I get the following exception on the last line, which doesn´t seem very meaningful to me: Exception thrown: 'System.InvalidOperationException' in mscorlib.dll
Additional information: Cannot call this method in this context: Object failed to load, unable to execute task.
When I set a breakpoint on the GenerateCredentialAsync-line (line 12) I also notice it´s never hit. So I wonder if the challengehandler is even registered correctly and fires the challenge-event appropriately.
... View more
03-14-2018
12:58 AM
|
0
|
3
|
1699
|
POST
|
How did you solve point 1? What did you change in youc csproj-file?
... View more
02-26-2018
06:57 AM
|
1
|
0
|
966
|
POST
|
I agree that Runtime enables rich functionality and probably most of our needs. However we still have the problem on accessing the runtime-app as a service from our web-client.
... View more
02-21-2018
11:50 PM
|
0
|
0
|
639
|
POST
|
Thanks for your reply. We already checked the Server-Extensions. However we´re unsure on how far those will be supported in the future as they are based on ArcObjects. Of course we could re-use some of our legacy-code, but it doesn´t seem a good alternative though. On the other side we could use some GeoProcessing-modells. Unfortunately debugging those models can be hard and annoying. Furthermore it still needs the client (in our case the Runtime-app) to call that model-functionality in some way and expose it to the web-client. Or can we access those models directly within the ArcGIS-server from our web-client?
... View more
02-21-2018
11:42 PM
|
0
|
0
|
639
|
POST
|
We´re are re-designing our desktop-app which consists of some millions of lines of ArcObjects-code. To do this, we plan to create a prototype based on ArcGIS Server and the Runtime SDK. But in contrast to the samples we plan to use the runtime-client as a service to access it within a WebGIS, where the actual presentation happens. So we end up a three-tier-architecture with an ArcGIS-Server as data-layer, the runtime-app as business-layer and the web-client as presentation-layer. So my question is if this is possible with the runtime-SDK or if there are better oppourtunities to extend the ArcGIS-server with some business-logic. Some words to that logic: currently it contains dozens of event-handlers registered to the events propagated by ArcMap as well as the geodatabase. So in order to store a feature, we need to be able to implicitely update other features that may be related. This in fact triggers recursive store-operations to those features. Another feature we´re currently using and extending is the ability to undo and redo operations or even rollback the entire session. I know this question is fairly complex and not easy to answer. But so far we couldn´t get any idea on which framework to use.
... View more
02-21-2018
06:37 AM
|
0
|
4
|
741
|
POST
|
Hi Karl, on your last paragraph did you intended to set the assemblies locxation within the ArcMap.exe.config? Checked esriregasm´s version also, it´s 32bit one located at "C:\Program Files (x86)\Common Files\ArcGIS\bin" The registry-key you´ve mentioned contains entry codebase showing to the exact same path as my target-path I´m compiling into. What makes me wonder is that I have five different InProcServer32-folders under that key. They obviously serve different versions of my assembly - Version 24, 25, 30, 32, 35 and 36. I recently checked out our latest build for version 35 and compiled it. Anyway all the values for codebase show to the exact same path as my target-path in Visual Studio.
... View more
12-05-2017
01:32 AM
|
0
|
0
|
601
|
Title | Kudos | Posted |
---|---|---|
1 | 08-29-2019 02:09 AM | |
4 | 10-02-2018 02:03 AM | |
1 | 10-01-2018 06:19 AM | |
1 | 02-26-2018 06:57 AM | |
1 | 11-18-2016 01:43 AM |
Online Status |
Offline
|
Date Last Visited |
02-21-2024
06:38 AM
|