POST
|
I have a spatial filter performing as I want it to, returning me an IFeatureCursor object that I can loop through. I want to be able to loop through the IFeatureCursor object more than once without re-applying the filter, the spatial filtering can take some time to apply in large data sets. Is there a method available for this, like 'IFeature.FirstFeature()' rather than having to re-apply the filter and start wiith 'IFeature.NextFeature()' again? Code below. Thanks Rob Dictionary<int, Dictionary<int, string>> FIDs = new Dictionary<int, Dictionary<int, string>>();
while ((pFeat = pFeatCursor.NextFeature()) != null)
{
int thisFID = (int)pFeat.Value[fidIdx];
FIDs.Add(thisFID, new Dictionary<int, string>());
ISpatialFilter SPF = new SpatialFilter();
SPF.SpatialRel = esriSpatialRelEnum.esriSpatialRelWithin;
SPF.Geometry = pFeat.ShapeCopy;
IFeatureCursor IFC2 = resultFeatLay.Search(SPF, false);
IFeature IF2;
int theCount = 1;
while ((IF2 = IFC2.NextFeature()) != null)
{
FIDs[thisFID].Add((int)IF2.Value[fidIdx], (string)IF2.Value[splitIdx]);
theCount += 1;
}
//THIS IS MY ATTEMPT AT STARTING THE LOOP AGAIN, TO NO AVAIL
while ((IF2 = IFC2.NextFeature()) != null)
{
string stophere = "";
}
}
... View more
05-07-2013
06:26 PM
|
0
|
2
|
634
|
POST
|
I'm trying to implement LZW compression on TIFFs that are being written as part of a Geoprocessor execution that is implementing a RasterCalculator expression. I have (unsuccessfully) tried to alter the tiff.pdf default settings in C:\ArcGIS\arcexe10x\raster\defaults, and have also tried to use 'SetEnvironmentValue', as per the code below. I can set extents, cell size etc via 'SetEnvironmentValue', but I am seeing no decrease in output raster size (~ 18300 cols, 28000 rows, 4GB size). Has anyone had any success altering the compression of raster outputs from geoprocessor executions in Arc Objects? I'm using ArcGIS 10, service pack 2, build 3200, obviously with Spatial Analyst license 'checked out' for the processing. Thanks Rob Geoprocessor rasGP = new Geoprocessor();
rasGP.SetEnvironmentValue("workspace", existingRasterDIRInput.Text);
string baseRasterExtent = rasInfo.Extent.XMin + " " + rasInfo.Extent.YMin + " " + rasInfo.Extent.XMax + " " + rasInfo.Extent.YMax;
rasGP.SetEnvironmentValue("extent", baseRasterExtent);
rasGP.SetEnvironmentValue("compression", "LZW");
RasterCalculator RasterCalc = new RasterCalculator();
string outRasterPathTif = newRasterDIRInput.Text + "\\" + System.IO.Path.GetFileNameWithoutExtension(valRasterPath) + ".tif";
RasterCalc.output_raster = outRasterPathTif;
rasGP.Execute(RasterCalc, null);
... View more
02-04-2013
02:51 PM
|
0
|
0
|
730
|
POST
|
It would appear that conceptually I can't achieve what I want with the current 'structure' of the binding process. ESRI has designed this process with the assumption that an 'application' will require an ArcGIS application/license while ever the application is active, whereas my 'application' only requires ArcGIS processing for some of the inbuilt functionality. Looks like I'll have to separate out this functionality into an ArcGIS-specific application/s, which is painful, but not impossible. Perhaps this will improve down the track, but I doubt it. Thanks Richard for your comments Rob
... View more
08-22-2011
03:13 PM
|
0
|
0
|
273
|
POST
|
Thanks Richard, 'shutdown' is not actually releasing the license... perhaps this is a bug that needs attention with a service pack?
... View more
08-21-2011
06:03 PM
|
0
|
0
|
273
|
POST
|
I have written an application that gives users access to many functions, some of which employ ArcGIS functionality (like processing rasters etc). I am able to 'bind' to an ArcGIS instance and license just fine with: ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop) Dim pAoInitialize As AoInitialize Dim licenseStatus As esriLicenseStatus Dim productCode As esriLicenseProductCode 'Create an AOInitialize object pAoInitialize = New AoInitialize Select Case UCase(Ltype) Case "ARCINFO" productCode = esriLicenseProductCode.esriLicenseProductCodeArcInfo Case "ARCEDITOR" productCode = esriLicenseProductCode.esriLicenseProductCodeArcEditor Case "ARCVIEW" productCode = esriLicenseProductCode.esriLicenseProductCodeArcView Case Else productCode = esriLicenseProductCode.esriLicenseProductCodeArcView End Select licenseStatus = pAoInitialize.Initialize(productCode) Question is, how do I then 'close' or 'unbind' from the license without closing the application? Our users access licenses from a pool and are charged on a usage rate, so being able to disconnect when not using the license would be great. We can do with extensions using checkin/checkout, however 'shutdown' is not working for me. The license is still allocated, only becoming available in the pool when the application is closed. I'm using ArcGIS 10, VB .NET. Thanks Rob
... View more
08-17-2011
08:25 PM
|
0
|
4
|
447
|
POST
|
Curtis, you say that MultiOutputMapAlgebra is still there in the 'gp' object (ESRI.ArcGIS.Geoprocessor.Geoprocessor??) - any chance of an example of how to use this? I have an old VB .NET implementation that used to be used to produce a bunch of output rasters from multiple 'mosaic' processes, using 'ESRI.ArcGIS.SpatialAnalystTools.MultiOutputMapAlgebra' as the input to a gp.Execute statement. I just can't see how I convert my use of ESRI.ArcGIS.SpatialAnalystTools.MultiOutputMapAlgebra to standard Geoprocessor syntax, and can't find a step-through example. Would appreciate your help. Rob
... View more
08-16-2011
04:02 PM
|
0
|
0
|
212
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|