POST
|
Hi Kyle, Since ArcGIS Server accounts handle all the geoprocessing tasks, I don't think you will be able to get access to who is using the service. However, you may be able to use it to traceback to who is logged into the soc machine. In a multi-user deployment, this would not be very applicable, but I figured it was worth throwing out there.
... View more
02-28-2012
09:31 AM
|
0
|
0
|
867
|
POST
|
I tested this here and using the "/" path separator when adding the tbx should help: gp.AddToolbox("C:/Folder/Test.tbx") I also had to completely close PythonWin between attempts of running the script, to clear the memory. It appears that arcgisscripting at 9.1 was rather picky :eek:
... View more
06-22-2011
11:02 AM
|
0
|
0
|
168
|
POST
|
timothy Saw that referenced recently on one of the blogs...but is it certified to work with ArcGIS? Any more details? Seems that you ESRI types are keen on it but details are slim and I am reluctant to screw up an installation for testing purposes. Hi Dan, I personally haven't used pyscripter yet, but I have seen other people using the Wing IDE successfully for writing and executing geoprocessing scripts. Since the Python installation is separate from ArcGIS, you should have free reign over what IDE you want to use. That being said, I still like PythonWin 😄
... View more
06-22-2011
04:44 AM
|
0
|
0
|
445
|
POST
|
This seems like related problem, I'm updating an arcgisscripting 9.3 python script to arcpy. The In_Memory layer errors out on the Project geoprocess. ERROR 000944: Output feature class cannot be in the in_memory workspace. Here's the test code, minus the bogus projection info string. import sys, string, os, shutil, arcpy # Create the Geoprocessor object and set variables arcpy.env.overwriteOutput = 1 Ticket_Envelope = r"C:\Temp\Matt.shp" Ticket_Layer = r"In_Memory\Ticket_Layer" arcpy.Project_management(Ticket_Envelope, Ticket_Layer, "blah blah blah", "", "") So "In_Memory" feature classes seem to work like normal, with other geoprocesses in ArcPy. However, Projection appears to be an exception And\Or a bug. Any insight? Hi Matthew, This is actually a known limitation in the software. The error message description can be found here: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00vp0000000m000944.htm Also, the help section for the Project tool now mentions that "Although in-memory feature classes are valid input to the tool, output cannot be in the in_memory workspace." http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000007m000000.htm Hope this helps!
... View more
05-25-2011
09:04 AM
|
0
|
0
|
165
|
POST
|
Hi timmerspk, I don't believe there is currently any raster field export functionality in the arcpy site package, but I was able to find some sample ArcObjects code that may help you out (I believe it was written in C#). I personally don't have experience coding in this language, but it looks like it will loop though your raster fields and use the same 'Save As' function that's present when you click the drop-down arrow for the raster field in ArcMap. Hope this helps! IMxDocument pDoc;
IMap pMap;
IFeatureLayer pFeatLayer;
IFeatureClass pFeatClass;
IFeature pfeature;
IFields pFlds;
int iRaster;
IRasterValue pValue;
//int i;
IRasterDataset3 pRasterDataset;
ISaveAs pSaveAs;
IWorkspaceFactory pWorkspaceFactory;
IWorkspace pWorkspace;
IFeatureCursor pFeatcursor;
pDoc = m_application.Document as IMxDocument;
pMap = pDoc.Maps.get_Item(0);
pFeatLayer = pMap.get_Layer(0)as IFeatureLayer;
pFeatClass = pFeatLayer.FeatureClass;
pFeatcursor = pFeatLayer.Search(null, false);
pfeature = pFeatcursor.NextFeature();
while (pfeature!=null)
{
pFlds = pFeatClass.Fields;
iRaster = -1;
//i = 0;
for (int i = 0; i < pFlds.FieldCount; i++)
{
if (pFlds.get_Field(i).Type==esriFieldType.esriFieldTypeRaster)
{
iRaster = i;
}
}
pValue = pfeature.get_Value(iRaster) as IRasterValue;
pRasterDataset = pValue.RasterDataset as IRasterDataset3;
//Define the workspace to save the result to
pWorkspaceFactory = new RasterWorkspaceFactoryClass();
//**********Please change output location according to your system*********************
pWorkspace = pWorkspaceFactory.OpenFromFile(@"C:\temp\ExportOutput", 0);
pSaveAs = pRasterDataset as ISaveAs;
if (pSaveAs.CanSaveAs("JPEG"))
{
pSaveAs.SaveAs("JPG_Raster" + pfeature.OID + ".jpg",pWorkspace,"JPEG");
//pSaveAs.SaveAs("JPG_Raster" + pfeature.OID + ".jpg", pWorkspace, "JPEG");
}
pfeature = pFeatcursor.NextFeature();
}
//System.Diagnostics.Debug.Print("Export Finished");
MessageBox.Show("Export Finished"); - Darrin C
... View more
05-13-2011
06:51 AM
|
0
|
0
|
188
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:22 AM
|