POST
|
Sorry, I mean when you are resizing the application window. As a standalone application, you can pull the top edge of the window towards the bottom of the screen and it stops moving when the form reaches the minumum size. With ArcMap, you can just keep pulling it down until it's just the window border. Keep going...
... View more
12-01-2015
03:25 AM
|
0
|
3
|
795
|
POST
|
I don't know about WPF, but we have a windows forms dockable window and a lot of the minimum size properties are blocked when you add the form to Arcmap. When I open my form as a standalone project, the minimum height and width settings are obeyed, but when it is added to Arcmap, you can compress the form right down until it is almost invisible.
... View more
11-24-2015
01:08 AM
|
0
|
5
|
795
|
POST
|
This is a known issue with server 10.2.1 - NIM098733. It's fixed at 10.3 and I don't think there are any plans to backport to 10.2, so I'll have to upgrade, or keep editing the script after publishing.
... View more
11-20-2015
07:39 AM
|
0
|
0
|
344
|
POST
|
Oh, and if you are returning an actual feature class, you'll need to use SetParameter for the outputs, not SetParameterAsText. I think it should work with just the feature class name as in your example.
... View more
11-19-2015
01:43 AM
|
1
|
0
|
352
|
POST
|
I have a GP service that does a similar thing with rasters, but I think the principle is the same. When saving, I include the full path, e.g. arcpy.CopyFeatures_management("t1", arcpy.env.scratchGDB + r"\outFCPersistent") Or, even better, if you have imported the os module, arcpy.CopyFeatures_management("t1", os.path.join(arcpy.env.scratchGDB, "outFCPersistent")) Be careful with the scratch workspace, as the behaviour is different between desktop and server. On desktop, you must set the scratch workspace, but on server it is automatically created for each job. Trying to set it actually clears the value and causes a lot of problems.
... View more
11-19-2015
01:37 AM
|
1
|
2
|
352
|
POST
|
Yes, it looks like packaging takes place after the post-build event, which isn't much use. Here is some of the output from building one of my addins: ... Copying file from "C:\Users\virtual\Documents\Visual Studio 2010\Projects\WorkflowBuilder\seed.json" to "bin\Debug\seed.json". CopyFilesToOutputDirectory: Copying file from "obj\Debug\GlobeTools.dll" to "bin\Debug\GlobeTools.dll". GlobeTools -> C:\Users\virtual\Documents\Visual Studio 2010\Projects\WorkflowBuilder\bin\Debug\GlobeTools.dll Copying file from "obj\Debug\GlobeTools.pdb" to "bin\Debug\GlobeTools.pdb". PostBuildEvent: echo POSTBUILD POSTBUILD PackageArcGISAddInContents: Removing directory "obj\Debug\esriAddIn\". Creating directory "obj\Debug\esriAddIn\Install". Copying file from "bin\Debug\Globe Tools Help.chm" to "obj\Debug\esriAddIn\Install\Globe Tools Help.chm". Copying file from "bin\Debug\GlobeTools.dll" to "obj\Debug\esriAddIn\Install\GlobeTools.dll". Copying file from "bin\Debug\GlobeTools.pdb" to "obj\Debug\esriAddIn\Install\GlobeTools.pdb". Copying file from "bin\Debug\ESRI.ArcGIS.Desktop.AddIns.dll" to "obj\Debug\esriAddIn\Install\ESRI.ArcGIS.Desktop.AddIns.dll". Copying file from "Config.esriaddinx" to "obj\Debug\esriAddIn\Config.esriaddinx". Successfully created Add-in "GlobeTools" -> 'C:\Users\virtual\Documents\Visual Studio 2010\Projects\WorkflowBuilder\bin\Debug\GlobeTools.esriAddIn'. esriRegAddin.exe "C:\Users\virtual\Documents\Visual Studio 2010\Projects\WorkflowBuilder\bin\Debug\GlobeTools.esriAddIn" /s Removing directory "obj\Debug\esriAddIn\". Creating directory "obj\Debug\esriAddIn\". Build succeeded. This looks like it might be useful, but it's not clear where in the project to add the Target tag. Alternatively, it might be possible to build the whole solution on the commandline, as in this post, then copy the addin when it has finished.
... View more
11-11-2015
01:17 AM
|
0
|
0
|
550
|
POST
|
It's odd that the post-build event fires before the build has finished. You can get round it by calling a batch file that waits for the addin to be present before copying. For example: @echo off
for /l %%a in (1,1,10) do (
echo attempt %%a
if exist c:\temp\my.esriAddIn goto :doCopy
ping 127.0.0.1 -n 2 > nul
)
goto :end
:doCopy
echo copying...
REM add copy command here
:end
echo done
... View more
11-10-2015
06:54 AM
|
0
|
2
|
550
|
POST
|
Apologies, this script editor seems to have killed my indentation. Never mind, hopefully you get the idea.
... View more
11-10-2015
02:37 AM
|
0
|
0
|
2401
|
POST
|
You can use something like the getLayerIndex function here. I think I got it from one of the Javascript samples, but can't remember which one, sorry. In this case, I'm adding a GP result map that has many layers and I only want to display one, but I think you could use the same principle to get the index of a layer when you only have its name.
function DrawResultLayer (resultMap, resultUrl, resultName) {
require(["esri/layers/ArcGISDynamicMapServiceLayer"],
function (ArcGISDynamicMapServiceLayer) {
var mapServiceLayer, resultUrl;
function getLayerIndex(layer, name) {
var infos = layer.layerInfos,
layerNames = [];
for (var i = 0, il = infos.length; i < il; i++) {
layerNames.push(infos.name);
}
return layerNames.indexOf(name);
}
mapServiceLayer = new ArcGISDynamicMapServiceLayer(resultUrl);
mapServiceLayer.on('load', function (evt) {
var layerIndex;
// first turn off all layers
evt.layer.setVisibleLayers([-1]);
layerIndex = getLayerIndex(evt.layer, resultName);
if (layerIndex === -1) {
console.log("Could not find layer for " + resultName);
} else {
// then turn on result layer if found
evt.layer.setVisibleLayers([layerIndex]);
}
});
resultMap.addLayer(mapServiceLayer);
}
}
... View more
11-10-2015
02:35 AM
|
0
|
1
|
2401
|
POST
|
According to the Javascript API, layers are appended to the map in the same order you add them, so your script should give you the order you want. Is that not the case? As a side note, if you are adding multiple layers, it is better to use addLayers to add them all at once.
... View more
11-10-2015
02:07 AM
|
1
|
6
|
2401
|
POST
|
BUMP So, does anyone know why Ken Buja's legend and my legend display differently? Is there a way to alter the settings of a GP service result map so the medium value shows? cc ArcGIS API for JavaScript Web GIS
... View more
11-10-2015
01:54 AM
|
0
|
0
|
1198
|
POST
|
I've been having a lot of trouble saving rasters in a GP service. Sometimes it works, sometimes I get "" does not exist and sometimes I get ERROR 010240: Could not save raster dataset to d:\arcgisserver\directories\arcgisjobs\lfp\lfp01setup_gpserver\jd73a1783fecb41ce8db2b93fe93a2ac5\scratch\scratch.gdb\Plei_ZforCDF with output format FGDBR. The errors are not consistent though. I've been adding lots of arcpy.AddMessage and arcpy.ListRasters statements between the lines of my script and slowing it down seems to help, so maybe it's some kind of race condition. The destination gdb definitely exists and does not already contain a raster with that name, so what could be the problem? cc Developers Geoprocessing UPDATE: I'm also getting Could not service request. but only when I run through the script without any extra messages. If I add desc = arcpy.Describe(ds)
arcpy.AddMessage('%s path = %s' % (desc.name, desc.catalogPath)) between some of the saves, the script completes without error (there are 14 rasters in all, it's always the 10th one that fails). Could it be the case that server can only cope with saving so many datasets at once?
... View more
11-06-2015
06:21 AM
|
0
|
0
|
2169
|
POST
|
I've just run into this problem, so it's good to know (not really, but you know what I mean) that someone else has come across it. Using sys.path.append did work for me, but it meant that all dependencies (including lots of python builtins) and files in the script folder were copied to the package folder on the server. This was even the case when putting the imported module in a subfolder on its own and appending the path with sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'utils')) Looks like this needs to be raised as a bug, because the 10.3 help still says that the script should be copied if it is in the same folder.
... View more
11-04-2015
05:36 AM
|
0
|
0
|
659
|
POST
|
So, I'm thinking this error is because I'm trying to input a feature class and some kind of validation is going on under the hood. It's not entirely clear if this behaviour is supported though. At 10.0, feature classes are clearly not supported (see Input data types section here), but at 10.3, it is less clear. It looks like a feature class is a transportable dataset and it should work (and the tool published without error, which would also suggest that it is possible). The thing is, I have set parameter type as Feature Class in ArcGIS Desktop, yet the REST services directory says the parameter is a GPFeatureRecordSetLayer. So, can I pass feature classes as parameters or not?
... View more
11-03-2015
03:33 AM
|
0
|
0
|
246
|
POST
|
I'm working on a multi-step geoprocessing service where the outputs of some steps are inputs to others. Most of the outputs are rasters, with one or two feature classes. Some are optional, depending on the input parameters. Everything runs ok in ArcGIS Desktop and I've published the services to my local ArcGIS Server. When I call the services with javascript API, the job runs ok, I get the Succeeded message, then there's an error that the data value is invalid. I think it's still trying to return a dataset, even though my script has skipped the arcpy.SetParameter line (as I am not expecting an output for these particular input settings). Do I have to make my outputs Optional instead of Derived to avoid this error? Here's an example of log output: Submitted. Executing... Executing (LFP MODELLING 05 LSAR): lfp05LSAR Plei NO "10. Getech LSARzpd (unpublished Eq.)" NO 0 NO 0 NO 0 Replacive MAX 90 48 2.67 72 NO "Absolute Value" 0 0 d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Input_Z.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Input_Distance.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\NPP.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Bathymetry.tif Start Time: Tue Nov 03 16:00:08 2015 Executing: lfp05LSAR Plei NO "10. Getech LSARzpd (unpublished Eq.)" NO 0 NO 0 NO 0 Replacive MAX 90 48 2.67 72 NO "Absolute Value" 0 0 d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Input_Z.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Input_Distance.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\NPP.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Bathymetry.tif Start Time: Tue Nov 03 16:00:08 2015 Running script lfp05LSAR... Calculating Linear Sedimentation Rate Completed script lfp05LSAR... Succeeded at Tue Nov 03 16:00:11 2015 (Elapsed Time: 2.26 seconds) Succeeded at Tue Nov 03 16:00:11 2015 (Elapsed Time: 2.29 seconds) Invalid return value: d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\scratch.gdb\Maas_LSARapex Failed. You can see the input rasters are being read from the scratch workspace ok, but after the job has supposedly succeeded, the server attempts to return an optional dataset, which is not present in the gdb. I've actually edited my script to save any old rubbish to the database then call arcpy.SetParameter for each of the optional outputs. Then the service completes its run without error. It would be nice if I didn't have to do such a hack though.
... View more
11-03-2015
03:28 AM
|
0
|
0
|
2136
|
Title | Kudos | Posted |
---|---|---|
1 | 03-08-2016 04:05 AM | |
1 | 03-08-2016 02:37 AM | |
1 | 03-08-2016 01:51 AM | |
1 | 01-25-2016 02:08 AM | |
1 | 11-19-2015 01:43 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|