|
POST
|
Don't you need to pass true to pWorkspaceEdit.StartEditing() then? Your code is passing false, or am I seeing that wrong? The true/false parameter of IWorkspaceEdit.StartEditing() only controls whether you want to allow or deny the ability to undo/redo actions, it does not control editing. You were using a join before and it was slowing down some other code? What code? Or do you mean simply making the join from ArcMap to the Oracle table was slow? The table joins were not slowing down code, they were slowing down the performance of the layer. For example, layer redraws or opening the attribute table. At times, it was taking 2 or 3 minutes to open the attribute table when the layer was joined to a table and only seconds when not joined.
... View more
08-08-2012
07:10 AM
|
0
|
0
|
2156
|
|
POST
|
James, Thanks for the reply. Unfortunately, none of your suggestions worked. If you have other ideas, no matter how crazy, I'm willing to try them. Carlos, Have a look/read at: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000002rs000000.htm While your approach is similar, there are some minor differences in the actual code implementation that may help (I notice they wrap the ComReleaser in a Using statement). Also, scroll down towards the bottom of that page to see if the UpdateSearchedRows method using the IRowBuffer offers any benefit or resolution to your issues. Take Care, James
... View more
08-08-2012
07:05 AM
|
0
|
0
|
2156
|
|
POST
|
Leo, Thanks for the reply. I am familiar with the example on the link you sent me, I used the C# version of this example to do my script. I am starting a edit session on the exact line you mentioned. First I start an edit session on the workspace, then start an edit operation. I am using IWorkspaceEdit instead of IEditor because my code runs outside of ArcMap and using IWorkspace edit for these occasions is the ESRI suggested method. The reason for having to update attributes is because originally, we only had one field in the feature clasa and all other information was gotten on the fly via a table join like you suggest. Unfortunately, we have seen time and again that table joins slow down the code significantly in our SDE environment. The IT people tried all sorts of stuff trying to speed things up but it never helped so we relunctantly had to add all these fields to the feature class and update the attributes via the code I am working on. Carlos If you are editing versioned data, don't you need to start an edit session? How to use cursors in the geodatabase: http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualhelp/engine/0001/0001000003s5000000.htm "Editing with cursors". You should relase pFeatureCursor outside of the outer while loop if you don't need it anymore. And change your passwords. One more thing, I guess I don't understand why you want to update feature attributes with data from an Oracle database. Can't you join or relate this featureclass to the Oracle table to get that information? In other words, why does this data from Oracle need to reside in two places? Do you have an application built around the data in this featureclass?
... View more
08-08-2012
03:27 AM
|
0
|
0
|
2156
|
|
POST
|
Hi everyone, Been fighting with this issue for several weeks now and not getting anywhere with it. The goal is to programmatically read attribute values from an Oracle table and update fields in an SDE feature class that is versioned. I am only working on one version currently but eventually, this version will be used to update default once the attributes are updated. The code below works.... sometimes but not always. I can run it consecutive times and it is hit or miss. In the code below I have tried updating fields by using both IFeatureClass.Update with IFeatureCursor.UpdateFeature and IFeatureClass.Search with IFeature.Store. On a layer with 24,000 records, using IFeatureClass.Update is slow taking 48 minutes compared to 3 minutes for IFeatureClass.Search. I have tried using recycling and non-recycling cursors. I have even tried reducing the number of fields I update but no matter what I do, sometimes the code updates and sometimes it does not. When it does not, I do not get any errors but the fields are not updated. I am out of ideas on what to try next. Does anyone see a problem or a better way to do this? I reduced toe number of fields to get the code to fit here. In reality, I have to update over 50 fields on 20 SDE layers with over 300,000 records total! private static void ProcessLayer(string permitType)
{
IPropertySet pPropertySet = new PropertySetClass();
IWorkspaceFactory pWorkspaceFactory = new SdeWorkspaceFactoryClass();
IFeatureWorkspace pFeatureWorkspace = null;
IFeatureClass pFeatureClass = null;
IDataset pDataset = null;
IWorkspace pWorkspace = null;
IWorkspaceEdit pWorkspaceEdit = null;
ITrackCancel pTrackCancel = new CancelTrackerClass();
IProgressDialogFactory pProgressDialogFactory = new ProgressDialogFactoryClass();
IProgressDialog2 pProgressDialog2 = null;
IStepProgressor pStepProgressor = null;
OracleConnection dataConnection = new OracleConnection();
OracleCommand dataCommand = new OracleCommand();
OracleDataReader dataReader = null;
IFeatureCursor pFeatureCursor = null;
IFeature pFeature = null;
try
{
pPropertySet.SetProperty("SERVER", "gresssde");
pPropertySet.SetProperty("INSTANCE", "5195:rim");
pPropertySet.SetProperty("USER", "GORT");
pPropertySet.SetProperty("PASSWORD", "Klaatu");
pPropertySet.SetProperty("VERSION", "RIM.GORT");
pFeatureWorkspace = pWorkspaceFactory.Open(pPropertySet, 0) as IFeatureWorkspace;
pFeatureClass = pFeatureWorkspace.OpenFeatureClass(permitType);
pDataset = pFeatureClass as IDataset;
pWorkspace = pDataset.Workspace;
pWorkspaceEdit = pWorkspace as IWorkspaceEdit;
//If permit type field not found, stop code.
if (pFeatureClass.FindField("FEE_PERMIT_TYPE") != -1)
{
//Start an edit session and operation
pWorkspaceEdit.StartEditing(false);
pWorkspaceEdit.StartEditOperation();
pFeatureCursor = pFeatureClass.Search(null, false);
//pFeatureCursor = pFeatureClass.Search(null, false);
//pFeatureCursor = pFeatureClass.Update(null, true);
//Get the index numbers for every field being updated.
int permitNoIdx = pFeatureClass.FindField("PERMIT_NO");
int appNoIdx = pFeatureClass.FindField("APP_NO");
int projectNameIdx = pFeatureClass.FindField("PROJECT_NAME");
int appStatusIdx = pFeatureClass.FindField("APP_STATUS");
int activeModIdx = pFeatureClass.FindField("ACTIVE_MOD");
string appNo = string.Empty;
string permitNo = string.Empty;
string projectName = string.Empty;
string appStatus = string.Empty;
string activeMod = string.Empty;
//Set up and open the progress dialog.
int featureCount = 1;
int numberOfFeatures = pFeatureClass.FeatureCount(null);
pProgressDialog2 = pProgressDialogFactory.Create(pTrackCancel, 0) as IProgressDialog2;
pProgressDialog2.CancelEnabled = true;
pProgressDialog2.Description = "Processing Record " + featureCount + " of " + numberOfFeatures;
pProgressDialog2.Title = "Processing...";
pProgressDialog2.Animation = esriProgressAnimationTypes.esriProgressGlobe;
pStepProgressor = pProgressDialog2 as IStepProgressor;
pStepProgressor.MinRange = 0;
pStepProgressor.MaxRange = numberOfFeatures;
pStepProgressor.StepValue = 1;
pStepProgressor.Message = permitType;
pProgressDialog2.ShowDialog();
bool canContinue = true;
//Read values from Oracle and update each feature with the info.
dataConnection.ConnectionString = "Data Source=genp;" +
"Persist Security Info=True;" +
"User ID=pub;" +
"Password=pub;" +
"Unicode=True";
dataConnection.Open();
dataCommand.Connection = dataConnection;
pFeature = pFeatureCursor.NextFeature();
while (pFeature != null)
{
appNo = pFeature.get_Value(appNoIdx).ToString();
dataCommand.CommandText = "SELECT PERMIT_NO, PROJECT_NAME, APP_STATUS, ACTIVE_MOD, " +
"FROM REG.REG_GIS WHERE app_no = '" + appNo + "'";
dataReader = dataCommand.ExecuteReader();
while (dataReader.Read())
{
if (!dataReader.IsDBNull(0))
{
permitNo = dataReader.GetString(0);
permitNo = permitNo.Replace("'", "");
}
if (!dataReader.IsDBNull(1))
{
projectName = dataReader.GetString(1);
projectName = projectName.Replace("'", "");
}
if (!dataReader.IsDBNull(2))
{
appStatus = dataReader.GetString(2);
appStatus = appStatus.Replace("'", "");
}
if (!dataReader.IsDBNull(3))
{
activeMod = dataReader.GetString(3);
activeMod = activeMod.Replace("'", "");
}
//Only update fields whose value have changed.
if (permitNoIdx != -1)
{
if (pFeature.get_Value(permitNoIdx) != DBNull.Value)
{
string permitNoIn = Convert.ToString(pFeature.get_Value(permitNoIdx));
if (permitNoIn != permitNo) { pFeature.set_Value(permitNoIdx, permitNo); }
}
}
if (projectNameIdx != -1)
{
if (pFeature.get_Value(projectNameIdx) != DBNull.Value)
{
string projectNameIn = Convert.ToString(pFeature.get_Value(projectNameIdx));
if (projectNameIn != projectName) { pFeature.set_Value(projectNameIdx, projectName); }
}
}
if (appStatusIdx != -1)
{
if (pFeature.get_Value(appStatusIdx) != DBNull.Value)
{
string appStatusIn = Convert.ToString(pFeature.get_Value(appStatusIdx));
if (appStatusIn != appStatus) { pFeature.set_Value(appStatusIdx, appStatus); }
}
}
if (activeModIdx != -1)
{
if (pFeature.get_Value(activeModIdx) != DBNull.Value)
{
string activeModIn = Convert.ToString(pFeature.get_Value(activeModIdx));
if (activeModIn != activeMod) { pFeature.set_Value(activeModIdx, activeMod); }
}
}
pFeature.Store();
//pFeatureCursor.UpdateFeature(pFeature);
} //while (dataReader.Read())
dataReader.Close();
dataReader.Dispose();
pFeature = pFeatureCursor.NextFeature();
//Increment the progress dialog.
canContinue = pTrackCancel.Continue();
if (canContinue == true)
{
pStepProgressor.Step();
featureCount++;
pProgressDialog2.Description = "Processing Record " + featureCount + " of " + numberOfFeatures;
}
else
{
pProgressDialog2.HideDialog();
pWorkspaceEdit.StopEditOperation();
pWorkspaceEdit.StopEditing(true);
return;
}
//Clear values.
appNo = string.Empty;
permitNo = string.Empty;
projectName = string.Empty;
appStatus = string.Empty;
activeMod = string.Empty;
}
//Stop editing
pWorkspaceEdit.StopEditOperation();
pWorkspaceEdit.StopEditing(true);
//Close progress dialog.
pProgressDialog2.HideDialog();
} //if (pFeatureClass.FindField("FEE_PERMIT_TYPE") != -1)
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace + "\r\n" + ex.Message);
}
} Thanks, Carlos
... View more
08-07-2012
01:20 PM
|
0
|
10
|
4797
|
|
POST
|
I am painfully aware what a resource hog ArcMap is and have seen just how slow things get when multiple ArcMap sessions are going. We have tried to explain this to upper management until blue in the face and they don't listen, they think Citrix is the greatest thing since sliced bread. Until 2010, our application was written in VBA and saved to a template for users to use. In the background, a script was copying the template to their local directory and opening up our custom toolbar and code. When we heard VBA was no longer going to be supported at 10.1, we started converting code to C# in early 2011, which none of us knew. It was a "learn as you go" thing and it took us until December to complete it. It was quite a steep learning curve to say the least! The code is now a toolbar and extension and no longer requires a template so users can turn on our toolbar/extension just like any other ESRI extesion/toolbar. Now, we are once again forced into changing our code for 10.1 and we were hoping to be able to do it a little at a time which is why I wanted to continue using the 9.3 editing environment. I'm hoping either someone else will have an answer or I will find a way to load the old editor toolbar, snapping etc. in code. Wish me luck, I'm going to need it! As for your question, we do not disable the application on the Citrix server. The Citrix admin can limit who has access to the extension/toolbar so that it how it is controlled but I don't know the inner workings. How do you disable your application for other users on the citrix server? In my experience, ArcMap is such a resource hog that putting it on a citrix environment leads to performance problems, basically as soon as you have more users than cores on the system you get slow downs and resource contention.
... View more
08-01-2012
07:15 AM
|
0
|
0
|
1316
|
|
POST
|
Alexander, Thanks for the reply. Our Citrix admin will never go for the custom exe or changing registry entries. I guess I will be forced to use the 10.1 editing environment. We have a LOT of code and we were hoping to transition to 10.1 editing environment slowly over time as we got used to using 10.1. Now we're going to have to rush and change our entire editing process because we're sceduled to get 10.1 in a month or two. Ugh Carlos To my knowledge the only way to do this (I have seen it done for pre-10 language settings and a citrix implementation) is to make a custom exe, that changes the registry first then launches ArcMap second and resets the registry value. This is more or less what I am doing now, users want to launch arcmap from another application so I have the opportunity to change the registry key before I do.
... View more
08-01-2012
06:00 AM
|
0
|
0
|
1316
|
|
POST
|
I am aware that templates can be disabled by using advanced arcmap settings but can this be changed in code for only the current ArcMap session? Our Citrix admin does not want to change it in the settings because this would affect all users instead of just users of our custom extension/toolbar. Thanks, Carlos You can disable this completely in the advanced arcmap settings. You can access them in the arcgis installation folder in the utilities sub folder. This reverts arcmap to a 9.3 style of editing: tool+ task + target and removes the feature template window.
... View more
07-31-2012
01:05 PM
|
0
|
0
|
1316
|
|
POST
|
James, We found the root cause of the sporadic update problem. Turns out two different versions of our data were conflicting. The update code was accessing default and unbeknownst to me, another newly created program written by the Python programmer was at times, trying to access the same version. The solution ended up being to create a new version for these updates and then when it is done, do a post in code. So far the approach is working so my boss doesn't want me to spend more time trying to re-write the code with your suggestions but I will certainly keep the code you gave me and if things start going badly again, I'll give it a try. Just wanted to let you know and say thanks again for your help with this and other posts. Carlos
... View more
07-31-2012
12:35 PM
|
0
|
0
|
844
|
|
POST
|
James, Thanks for the suggestion and sample code. I will give it a try and post back what the results were. Yeah, intermmitent problems are never fun to debug especially when you are trying to show the problem to another programmer and the problem doesn't occur while they are watching.
... View more
07-26-2012
09:58 AM
|
0
|
0
|
844
|
|
POST
|
James, Thanks for the reply. You are correct, I don't populate the fields if the query does not return a value from Oracle. However, 10 of the 49 fields cannot be null and always have values yet even these are not being updated. I do the same thing you suggested when trying to write to a record, that is what the second check called CanUpdateAttributes in my code does. It picks one arbitrary record in the layer, populates one field with a bogus value and then immediately checks to see if the value is there. If it is, the function returns true, i.e. okay to process layer. That's the biggest mystery. It works if I only update one field but chokes on 49. I might have to break it up into multiple scripts with each one updating fewer fields. The main reason I don't want to do this if I can avoid it is that the script takes four hours to run and it would be a huge time waster, especially considering that I have other scripts that need running at night also. My PC currently is busy running different automated scripts from Windows Task Scheduler from 6:30 p.m. to 10 a.m. the following morning so it's hard to find a slot to run this script when no one is accessing the data. Do you know of a better (maybe faster) way to update attributes on a layer? If you have VB or even VBA code I can easily convert it to C#. Thanks again for you help on this and in previous posts, I REALLY appreciate it! Carlos Carlos, I may be mistaken here out of my unfamiliarity with C#, so please ignore if this is obvious.
if (!dataReader.IsDBNull(0))
{
permitNo = dataReader.GetString(0);
permitNo = permitNo.Replace("'", "");
} So, am I incorrect to say that you are not dealing with the case when something actually IS null? Again, I am a VB guy so I am looking for an else somewhere! lol... But I would think that if there are no errors but no data is actually updated, then maybe there was no data in the dataReader itself? When doing a similar implementation (ADO.NET DataTable-->FeatureClass/ITable write), I would test by writting something in the row/field IF something was null. This would simply allow me to see that it was actually writting to it. Again -- sorry if I am misreading your C# there!
... View more
07-26-2012
08:57 AM
|
0
|
0
|
844
|
|
POST
|
Hi everyone, I have a C# program that runs nightly on 17 layers, going through all records and updating 49 fields with data read from an Oracle table. The problem I am having is that sometimes the program runs successfully and sometimes it does not. On the times that it fails, the code runs to completion without any errors but none of the fields have updated values. Below is the program and I have removed most of the fields so that it could fit in this post without being huge. The very first thing the script does is to check if the layer has locks on it and if it does, the layer is skipped. The next check it populates one field with dummy data and if succeeds, then it goes on to the rest of the code to update all fields. Any idea what the problem might be? I am using ArcMap 9.3.1. Thanks, Carlos private static void ProcessLayer(string permitType)
{
IPropertySet pPropertySet = new PropertySetClass();
IWorkspaceFactory pWorkspaceFactory = new SdeWorkspaceFactoryClass();
IFeatureWorkspace pFeatureWorkspace = null;
IFeatureClass pFeatureClass = null;
IDataset pDataset = null;
IWorkspace pWorkspace = null;
IWorkspaceEdit pWorkspaceEdit = null;
ITable pTable = null;
ICursor pCursor = null;
ITrackCancel pTrackCancel = new CancelTrackerClass();
IProgressDialogFactory pProgressDialogFactory = new ProgressDialogFactoryClass();
IProgressDialog2 pProgressDialog2 = null;
IStepProgressor pStepProgressor = null;
OracleConnection dataConnection = new OracleConnection();
OracleCommand dataCommand = new OracleCommand();
OracleDataReader dataReader = null;
try
{
//Get the layer to update.
pPropertySet.SetProperty("SERVER", "gresssde");
pPropertySet.SetProperty("INSTANCE", "5195:rim");
pPropertySet.SetProperty("USER", "rim");
pPropertySet.SetProperty("PASSWORD", "S01stice");
pPropertySet.SetProperty("VERSION", "RIM.DEFAULT");
pFeatureWorkspace = pWorkspaceFactory.Open(pPropertySet, 0) as IFeatureWorkspace;
pFeatureClass = pFeatureWorkspace.OpenFeatureClass(permitType);
pDataset = pFeatureClass as IDataset;
//If layer has locks on it, skip it.
if (HasSchemaLocks(pDataset) == true)
{
string message = "layer " + pDataset.BrowseName + " had locks on it, layer skipped.";
LogMessageToFile(LogsPath + "updatePermitDataAttrDaily_Log_", message);
return;
}
//If layer cannot be attributed, skip it.
if (CanUpdateAttributes(pFeatureClass) == false)
{
string message = "Could not update attributes on layer " + pDataset.BrowseName + ".";
LogMessageToFile(LogsPath + "updatePermitDataAttrDaily_Log_", message);
return;
}
pWorkspace = pDataset.Workspace;
pWorkspaceEdit = pWorkspace as IWorkspaceEdit;
//If permit type field not found, stop code.
if (pFeatureClass.FindField("FEE_PERMIT_TYPE") != -1)
{
//Start an edit session and operation
pWorkspaceEdit.StartEditing(false);
pWorkspaceEdit.StartEditOperation();
pTable = pFeatureClass as ITable;
pCursor = pTable.Update(null, false);
//Get the index numbers for every field being updated.
int permitNoIdx = pCursor.FindField("PERMIT_NO");
int appNoIdx = pCursor.FindField("APP_NO");
int projectNameIdx = pCursor.FindField("PROJECT_NAME");
int appStatusIdx = pCursor.FindField("APP_STATUS");
int activeModIdx = pCursor.FindField("ACTIVE_MOD");
string appNo = string.Empty;
string permitNo = string.Empty;
string projectName = string.Empty;
string appStatus = string.Empty;
string activeMod = string.Empty;
//Set up and open the progress dialog.
int featureCount = 1;
int numberOfFeatures = pFeatureClass.FeatureCount(null);
pProgressDialog2 = pProgressDialogFactory.Create(pTrackCancel, 0) as IProgressDialog2;
pProgressDialog2.CancelEnabled = true;
pProgressDialog2.Description = "Processing Record " + featureCount + " of " + numberOfFeatures;
pProgressDialog2.Title = "Processing...";
pProgressDialog2.Animation = esriProgressAnimationTypes.esriProgressGlobe;
pStepProgressor = pProgressDialog2 as IStepProgressor;
pStepProgressor.MinRange = 0;
pStepProgressor.MaxRange = numberOfFeatures;
pStepProgressor.StepValue = 1;
pStepProgressor.Message = permitType;
pProgressDialog2.ShowDialog();
bool canContinue = true;
//Read values from Oracle and update each feature with the info.
dataConnection.ConnectionString = "Data Source=genp;" +
"Persist Security Info=True;" +
"User ID=pub;" +
"Password=pub;" +
"Unicode=True";
dataConnection.Open();
dataCommand.Connection = dataConnection;
IRow pRow = pCursor.NextRow();
while (pRow != null)
{
appNo = pRow.get_Value(appNoIdx).ToString();
dataCommand.CommandText = "SELECT PERMIT_NO, PROJECT_NAME, APP_STATUS, ACTIVE_MOD, " +
"FROM REG.REG_GIS WHERE app_no = '" + appNo + "'";
dataReader = dataCommand.ExecuteReader();
while (dataReader.Read())
{
if (!dataReader.IsDBNull(0))
{
permitNo = dataReader.GetString(0);
permitNo = permitNo.Replace("'", "");
}
if (!dataReader.IsDBNull(1))
{
projectName = dataReader.GetString(1);
projectName = projectName.Replace("'", "");
}
if (!dataReader.IsDBNull(2))
{
appStatus = dataReader.GetString(2);
appStatus = appStatus.Replace("'", "");
}
if (!dataReader.IsDBNull(3))
{
activeMod = dataReader.GetString(3);
activeMod = activeMod.Replace("'", "");
}
if (permitNoIdx != -1) pRow.set_Value(permitNoIdx, permitNo);
if (projectNameIdx != -1) pRow.set_Value(projectNameIdx, projectName);
if (appStatusIdx != -1) pRow.set_Value(appStatusIdx, appStatus);
if (activeModIdx != -1) pRow.set_Value(activeModIdx, activeMod);
pCursor.UpdateRow(pRow);
}
dataReader.Close();
dataReader.Dispose();
pRow = pCursor.NextRow();
//Increment the progress dialog.
canContinue = pTrackCancel.Continue();
if (canContinue == true)
{
pStepProgressor.Step();
featureCount++;
pProgressDialog2.Description = "Processing Record " + featureCount + " of " + numberOfFeatures;
}
else
{
pProgressDialog2.HideDialog();
return;
}
//Clear values.
appNo = string.Empty;
permitNo = string.Empty;
projectName = string.Empty;
appStatus = string.Empty;
activeMod = string.Empty;
}
//Stop editing
pWorkspaceEdit.StopEditOperation();
pWorkspaceEdit.StopEditing(true);
//Close progress dialog.
pProgressDialog2.HideDialog();
} //if (pFeatureClass.FindField("FEE_PERMIT_TYPE") != -1)
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace + "\r\n" + ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
... View more
07-26-2012
05:36 AM
|
0
|
7
|
1471
|
|
POST
|
James, I got pulled away from this project and have not gotten back to it because now my boss wants to do this in Python instead of C# and I'm not the Python programmer in our group. Sorry I couldn't be of more help. Carlos
... View more
07-25-2012
06:41 AM
|
0
|
0
|
439
|
|
POST
|
Hi everyone, I am trying to write some code that will check a layer file for broken links when the layer gets loaded in code. The code below works fine but the very first line (red line of code below) where it checks to see if the layer file has a group layer is very slow. It's taking 25 to 30 seconds consistently and I don't know why. The code below is part of a much larger program and since this script will be used every time a layer is loaded, I cannot have it taking 30 seconds for every layer because in certain cituations, 30 to 40 layers can get loaded one after another. Thanks for your time to read this. Carlos internal static bool IsLayerFileValid(IGxLayer pGxLayer)
{
ICompositeLayer pCompositeLayer = null;
IGroupLayer pGroupLayer = new GroupLayerClass();
ILayer pLayer = null;
IEnumLayer pEnumLayer = null;
try
{
if (!(pGxLayer.Layer is IGroupLayer))
{
if (pGxLayer.Layer.Valid == false)
{
return false;
}
}
else
{
//pGroupLayer = pGxLayer.Layer as IGroupLayer;
pCompositeLayer = pGxLayer.Layer as ICompositeLayer;
for (int counter = 0; counter < pCompositeLayer.Count; counter++)
{
pLayer = pCompositeLayer.get_Layer(counter);
if (pLayer.Valid == false)
{
return false;
}
}
}
return true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return false;
//throw;
}
}
... View more
06-26-2012
06:39 AM
|
0
|
3
|
679
|
|
POST
|
Hi everyone, The code below has been functioning fine for years in VBA and now C# but suddenly stopped working this week. I can load raster imagery manually but the code below fails on the last line and I get a "failed to open raster dataset" error. Anyone have an idea what I can do to fix this? Thanks, Carlos IWorkspaceFactory pWorkspaceFactory = new RasterWorkspaceFactory();
IRasterWorkspace pRasterWorkspace = pWorkspaceFactory.OpenFromFile(rasterPath, 0) as IRasterWorkspace;
IRasterDataset pRasterDataset = pRasterWorkspace.OpenRasterDataset(rasterName);
... View more
05-17-2012
08:30 AM
|
0
|
3
|
3707
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-11-2016 06:06 AM | |
| 1 | 08-07-2015 10:13 AM | |
| 2 | 06-29-2015 12:45 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|