|
POST
|
com.esri.arcgis.carto.FeatureLayer getDisplayField method According to the docs, that should get you that field. Hm, I dont think I can use the Carto-Namespace when developing a Geoprocessing-Service. At least I didn't try this approach. Am I missing something?
... View more
02-09-2014
09:56 PM
|
0
|
0
|
1252
|
|
POST
|
I am developing a GP-Service with C#. The output is a feature set containing some attribute values. I want to determine the primary display field, which is contained in the output parameter (6th line, currently the empty string ""): {
"results": [{
"paramName": "result",
"dataType": "GPRecordSet",
"value": {
"displayFieldName": "",
"geometryType": "esriGeometryPoint",
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
},
"fields": [ ... ],
"features": [],
"exceededTransferLimit": false
}
}],
"messages": [ ... ]
} This is how I built the ParameterInfo:
IGPParameterEdit3 result = new GPParameterClass();
IFeatureClass outputFeatureClass = DoneInAnotherMethod(); // open template from disk
result.DataType = new GPFeatureRecordSetLayerTypeClass();
IRecordSetInit recordset = new RecordSetClass();
recordset.SetSourceTable((ITable)outputFeatureClass, null);
IGPRecordSet recordSet = new GPRecordSetClass();
recordSet.RecordSet = (IRecordSet)recordset;
IGPRecordSet gpRecordSet = new GPFeatureRecordSetLayerClass();
gpRecordSet.RecordSet = new RecordSetClass();
gpRecordSet.RecordSet = (IRecordSet)recordset;
var featureRecordSetLayer = (IGPFeatureRecordSetLayer)gpRecordSet;
result.Value = (IGPValue)featureRecordSetLayer;
result.Name = Constants.OutputParameterName;
result.DisplayName = Constants.OutputParameterName;
result.Direction = esriGPParameterDirection.esriGPParameterDirectionOutput;
result.ParameterType = esriGPParameterType.esriGPParameterTypeDerived;
result.Enabled = true;
IGPFeatureSchema featureSchema = new GPFeatureSchemaClass();
featureSchema.GeometryType = esriGeometryType.esriGeometryPoint;
IGPFeatureClassDomain geomTypeDomain = new GPFeatureClassDomainClass();
geomTypeDomain.AddType(esriGeometryType.esriGeometryPoint);
result.Domain = (IGPDomain)geomTypeDomain;
result.Schema = (IGPSchema)featureSchema;
myParameterInfo.Add(result);
How can I set this value? I cannot find anything useful in ArcObjects. Any Idea? Best regards, Stefan
... View more
02-07-2014
06:44 AM
|
0
|
4
|
1709
|
|
POST
|
I installed ArcGIS 10.2 on a fresh (virtual) machine. I copied some existing File Geodatabases (version 10.1) via network share on the new machine to a local drive. Some File geodatabases can not be opened: Failed to connect to database. Workspace or data source is read only. Workspace or data source is read only. Workspace or data source is read only. All following tries will add more "Workspace or data source is read only." messages to the error dialog. Some FGDBs have this problem, some not.
... View more
08-07-2013
01:00 AM
|
0
|
3
|
1389
|
|
POST
|
ArcGIS Desktop for Professionals (v11) This sounds like Esri is finally kicking out COM and ArcObjects will not be available after version 10.*. Is there any published link to it yet? If this comes true, I should definetly have a look at it 🙂
... View more
04-17-2013
12:53 AM
|
0
|
0
|
1282
|
|
POST
|
Is log4net 32 bit only? It seems so, because removing all references to log4net makes the tool work again under 10.1 server. This is the one I am using: C:\Windows\assembly\GAC_MSIL\log4net\1.2.11.0__669e0ddf0bb1aa2a Note that it is in GAC_MSIL which I believe indicates that it can execute in either 32 bit or 64 bit host processes. I would like to not use global assembly cache for any dependencies, because registering them needs administrator rights (this may be an anti-pattern?). I always try to avoid GAC. Another strange behaviour: The working gp tool works fine when called from a toolbox in ArcCatalog. But a published gp service does not honor the given parameter values. Instead, the result is always the default result from the time when the service was published... is it a bug in 10.1 without service pack? Best regards, Stefan
... View more
08-31-2012
04:34 AM
|
0
|
0
|
1479
|
|
POST
|
Hi, as ArcGIS for Server 10.1 is now completely 64 bit, I think some older custom geoprocessing services developed with C# may not work by simply re-compiling them for 10.1. When a DLL is compiled to 64 bit, I can run the gp tool in ArcCatalog and publish it to the server (this is in a32 bit environment). But when the DLL is dependent on a 32 bit DLL like LOG4NET, the tool run will fail on AGS with "tool not valid" on the first time a statement of the dependent 32 bit DLL is being executed. Is this correct? Best regards, Stefan
... View more
08-30-2012
11:13 PM
|
0
|
4
|
1903
|
|
POST
|
Hello, in ArcGIS 10.1, local DCOM connections to arcgis server are not supported. I have to migrate my code which is using the class `AGSServerConnection` to connect to ArcGIS server. How can I connect to ArcGIS Server in 10.1? I can not find any hint in the developer help from visual studio. The use case is to create and update features via Geodatabase service. May be I have to use feature service instead? Best regards, Stefan
... View more
07-24-2012
11:10 PM
|
0
|
2
|
779
|
|
POST
|
I have solved this issue in my custom dockable window (C#). The reason was an exception in the constructor of the Windows Form implementing IDockableWindow. When you experience the error message "HRESULT: 0x8000FFFF, E_UNEXPECTED", this is likely because of an exception in your constructor. I resolved it by executing all constructor code within a try-catch-block, logging the error and swallowing the exception.
public partial class MyDockWindow : UserControl, IDockableWindowDef, IDockableWindowImageDef, IDockableWindowInitialPlacement
{
public MyDockWindow()
{
try
{
// do smth.
// may be an exception is raised...
}
catch (Exception ex)
{
// logging of error
// do not throw exception!
}
}
... View more
07-19-2012
01:01 AM
|
0
|
0
|
1127
|
|
POST
|
The problem still exists 😞 Everything works fine on the server side: The tool is running, the output raster image is created in the jobs directory and now even the image is written in the output directory: URL: http://server/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j39af1a9452014046b5eff75461283d0a/results/out_result?f=pjson Output: {
"paramName" : "out_result",
"dataType" : "GPRasterDataLayer",
"value" : {
"mapImage" : {
"href" : "http://server/arcgisoutput/_ags_map4a0b366dc2a6406c8e01f5dabbd537b6.png",
"width" : 400,
"height" : 400,
"extent" : {
"xmin" : -7.23306324850746,
"ymin" : 43.5062588282437,
"xmax" : 5.26322179315017,
"ymax" : 56.0025438699013,
"spatialReference" : {
"wkid" : 4326
}
},
"scale" : 13129323.207061
}
}
} When I try to call the gp service from my javascript client, I use this code: this.gpTask.getResultImageLayer(jobInfo.jobId, "out_result", imageParams, dojo.hitch(this,function(gpLayer){ ... This does not work, as I can see in the javascript console of chrome, the following URL is generated to export the image from the gp service: http://server/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j39af1a9452014046b5eff75461283d0a/results/out_result/export?dpi=96&transparent=true&format=png8&bbox=31124.96346345375,6358724.004726038,618161.340693325,6471850.806588045&bboxSR=102100&imageSR=102100&size=1920,370&f=image which results in an error (web site of the rest endpoint): Specified format is not supported Code: 400 Invalid URL If I change the URL from "f=image" to "f=pjson", I an see a similar error message: http://server/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j39af1a9452014046b5eff75461283d0a/results/out_result/export?dpi=96&transparent=true&format=png8&bbox=31124.96346345375,6358724.004726038,618161.340693325,6471850.806588045&bboxSR=102100&imageSR=102100&size=1920,370&f=pjson { "error" : { "code" : 400, "message" : "Unable to complete operation.", "details" : [ "Invalid URL" ] } } Why is it not possible to use the "export" map parameter of the gp service (with a result map service)? Am I missing something? Best regards, Stefan
... View more
05-29-2012
03:57 AM
|
0
|
0
|
842
|
|
POST
|
I think I have solved my problem: The name of the result sub layer of the tool layer must have the same name as the output parameter of the GP tool (in my case: "out_result"). If this is done, then I get the correct output: {
"paramName" : "out_result",
"dataType" : "GPRasterDataLayer",
"value" : {
"mapImage" : {
"href" : "http://server/arcgisoutput/_ags_map4a0e89d03bf04fad94febbf29e553660.png",
"width" : 400,
"height" : 400,
"extent" : {
"xmin" : -198,
"ymin" : -188.48,
"xmax" : 198,
"ymax" : 207.52,
"spatialReference" : {
"wkid" : 4326
}
},
"scale" : 416060611.02672
}
}
}
... View more
05-25-2012
04:47 AM
|
0
|
0
|
842
|
|
POST
|
I have a custom geoprocessing tool implemented in C#. The output is a GPRasterDataLayer. The tool is added as a tool layer to a blank ArcMap document. I have populated all parameters, set the scratch workspace to a folder and I have run the tool once. The output layer is added to the map as a sublayer to the tool layer as expected. The map is saved as mxd document and published to arcgis server, with MapServer and GeoprocessingServer capabilites enabled. Both services are created, the map server is the result service for the GP service. I can execute the task sucessfully via REST interface of arcgis server. The problem is that the result only contains the URL to the gerenated tif file (parameter "out_result" of type GPRasterDataLayer), but the image can not be exported as a map image to be included in a javascript client. http://some.server.com/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/jcb8dd75cc1e341ac94f03c59e298b97b/results/out_result?f=pjson => {
"paramName" : "out_result",
"dataType" : "GPRasterDataLayer",
"value" : {
"url" : "http://server/arcgisjobs/movingwindowfunction_gpserver/jcb8dd75cc1e341ac94f03c59e298b97b/scratch/Moving Window.tif",
"format" : "tif"
}
}
When using a map service as result service, this should not be the case regarding the documentation at: http://services.arcgisonline.com/ArcGIS/SDK/REST/gpresult.html#mapimage Map Images as Results Map images can be a result of a GP job. If a GP service is associated with a result map service, the results of GPFeatureRecordSetLayer and GPRasterDataLayer data types can be drawn by the result map service and hence can be provided to the client as a map image. In such cases where the result is a map image, the value field for the GP parameter is a JSON structure with a mapImage field. So the value should be a "mapImage", but instead it is "url" and "format". I think this is a bug. My next try is to export the image of the result using the export parameter of the GP service with the following URL: http://some.server.com/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j0684e2ad3c65427a9b469f74d0d824f6/results/out_result/export?dpi=96&transparent=true&format=png8&LANGUAGE=ger&bbox=-8192582.035679961,3318059.019542513,10592582.03567996,9481940.980457487&bboxSR=102100&imageSR=102100&size=1920,630&f=image ...which results in an error: Error Specified format is not supported Code: 400 Invalid URL Nothing helpful can be found in ArcGIS Server and REST log 😞 What can I do to get the map image from the associated map service of the GP service? Best regards, Stefan
... View more
05-24-2012
06:59 AM
|
0
|
2
|
3624
|
|
POST
|
I tried re-installing ArcGIS this morning hoping that this might affect something (I am using ArcGIS 9.1,) but i still cannot get this GIS template to show up on my visual studio 2010 express. If I remember correctly, you have to use the correct version of Visual Studio, depending of the ArcGIS Version you are using. ArcGIS 9.1 -> Visual Studio 2003 ArcGIS 9.2 -> Visual Studio 2005 ArcGIS 9.3(.1) -> Visual Studio 2008 ArcGIS 10 -> Visual Studio 2010 Hope this helps. Best regads, Stefan ps: Are you really still using 9.1? Seems kinda outdated...
... View more
04-11-2012
11:15 PM
|
0
|
0
|
1746
|
|
POST
|
Thanks John, IRasterExporter.ExportToBytes is exactly the interface and method I was looking for 🙂 After reading the blob object from the feature to the variable 'photo', this code works for me:
object photo = feature.Value[blobFieldIndex];
IRasterExporter exporter = new RasterExporterClass();
var rasterAsBytes = exporter.ExportToBytes(((IRasterValue) photo).Raster, "TIFF");
IMemoryBlobStream memBlobStream = new MemoryBlobStream();
var varBlobStream = (IMemoryBlobStreamVariant) memBlobStream;
varBlobStream.ImportFromVariant(rasterAsBytes);
var tableAttachments = (ITableAttachments) featureClass;
var attachmentManager = tableAttachments.AttachmentManager;
attachmentManager.AddAttachment(feature.OID, new AttachmentClass
{
Name = "nameOfRaster.jpg",
ContentType = "image/jpg",
Data = varBlobStream
});
... View more
03-28-2012
01:05 AM
|
0
|
0
|
1122
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-08-2017 04:46 AM | |
| 1 | 08-08-2017 07:35 AM | |
| 1 | 08-04-2014 06:11 AM | |
| 1 | 08-04-2014 10:18 PM | |
| 1 | 06-02-2016 05:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|