|
POST
|
Bruce, Don't know if I am giving you a red herring here but the IGPUtilities Interface has some methods like ReleaseInternalTable and ReleaseInternals try calling these after you have deleted the in_memory workspace. Below is some code I just knocked together in VBA. Duncan
Public Sub DeleteTable()
' Create Utils object
Dim pGPUtils As IGPUtilities
Set pGPUtils = New GPUtilities
' Create GPValue object and set path
Dim pGPValue As IGPValue
Set pGPValue = New DETable
pGPValue.SetAsText ("in_memory\abc")
' Delete table
pGPUtils.Delete pGPValue
pGPUtils.ReleaseInternals
End Sub
... View more
05-28-2012
06:15 AM
|
0
|
0
|
2044
|
|
POST
|
Sui, You should mark this thread as ANSWERED, this helps others. Duncan
... View more
05-28-2012
05:43 AM
|
0
|
0
|
1527
|
|
POST
|
If you have a field that has the same name as the shapefile then you could alter the query to this: desc = gp.describe(fc)
query = "\"%s\" = 'S'" % desc.baseName So if your Shapefile is called C1234.shp then the query string will end up being query = "C1234" = 'S' Duncan
... View more
05-18-2012
02:07 AM
|
0
|
0
|
3484
|
|
POST
|
Abby, Interesting that link has stopped working, I always double check those sort of things, as there is nothing more annoying than a broken link! It looks like ESRI are removing ideas off the website, may be when they are a bit unpalatable for them? You might need to go into your forum profile settings and tick some box on to get the emails, can't remember or its your spam filter blocking them? I did test the behaviour of SelectByLocation and SelectLayerByLocation on a small dataset (if you consider 38,000 polylines small) and experienced no difference in selection count. It looks like there is something fundamentally different between the two tools as alluded to by curtvprice. You should bring this up with their support and they will probably want some of the data to try and replicate it. One last idea (which won't fix the problem but may indicate which one you have more faith in) is to create a buffer layer from your points and use those instead of doing a within distance selection. You'll have a defined geometry which you can see rather than some black box processing done by the tool... Good luck! Duncan
... View more
05-18-2012
01:18 AM
|
0
|
0
|
1940
|
|
POST
|
This line is: query = "\"%s\" = 'S'" % field.Name is failing as you do not declare what field is. But in your reponse you say the field names are C5738 and C9875. If you know them then your query could be simplified to: query = "\"C5738\" = 'S'" But there is a question about your logic as you give TWO field names, which one do you want to process or do you want to select all records where both of those fields equal S? If so the query statement should be: query = "\"C5738\" = 'S' OR \"C9875\" = 'S'" Duncan
... View more
05-17-2012
08:01 AM
|
0
|
0
|
3484
|
|
POST
|
Jenna, A quick google search threw up this thread... Duncan
... View more
05-17-2012
07:38 AM
|
0
|
0
|
14615
|
|
POST
|
Yiman, Next time you upload your code please place it in the code (#) tags as it makes it easier to read. You've lost all your indentation... This is particularly important if the code is Python.
... View more
05-16-2012
08:34 AM
|
0
|
0
|
797
|
|
POST
|
Sui, If your underlying polyline layer was a PolylineM featureclass then you could have used the IMSegmentation3 interface and the GetMsAtDistance method. So you have 2 options: Do it the way you said, nothing wrong with that. When you identify the polyline that the point intersects take a copy of that polyline and turn it into a polylineM feature using your start and end values by using the CalibrateByMs method of the IMSegmentation3 interface. Duncan
... View more
05-16-2012
08:31 AM
|
0
|
0
|
2093
|
|
POST
|
Usman, I don't program in c# so may be what you have done in standard but this line looks odd to me: pOutputFC = pBGP.Intersect(pFeatureClass1 as ITable, false, pFeatureClass2 as ITable, false, tol, pFeatClassName); I would not have done the query interface in the method call. In VB I would have done this: dim pT1 as ITable dim pT2 as ITable pT1 = pFeatureClass1 pT2 = pFeatureClass2 pOutputFC = pBGP.Intersect(pT1, false, pT2, false, tol, pFeatClassName) Also its worth noting that in the Help it says: "The functionality of the BasicGeoprocessor object had been superseded by the new Geoprocessing framework of ArcGIS starting at version 9.0. Developers should utilize the new tools whenever possible." So they are saying don't use it. Duncan
... View more
05-16-2012
08:23 AM
|
0
|
0
|
756
|
|
POST
|
Santosh, Without seeing your code its hard to know why it should slow down. I know it's good practise to release cursors. Below is some example code on how I release a cursor, but your slowing down may be nothing to do with memory consumption it could be poor logic like creating the same object every time in a loop when it needs only to be created once (e.g. a spatialfilter object)? ' For ArcGIS 10 using VS 2010 you need to import the following
Imports ESRI.ArcGIS.ADF.Connection.Local
Imports ESRI.ArcGIS.ADF
Dim pQueryFilter As IQueryFilter
pQueryFilter= New QueryFilterClass
pQueryFilter.WhereClause = "ID = 1"
Using releaser As New ComReleaser
Dim pFeatureCursor As IFeatureCursor
pFeatureCursor = pFeatureclass.Update(pQueryFilter, True)
releaser.ManageLifetime(pFeatureCursor)
Dim pFeature As IFeature
pFeature = pFeatureCursor.NextFeature
While pFeature IsNot Nothing
' Do something with pFeature
pFeatureCursor.UpdateFeature(pFeature)
pFeature = pFeatureCursor.NextFeature
End While
End Using
Duncan
... View more
05-16-2012
08:11 AM
|
0
|
0
|
1181
|
|
POST
|
Hi, Interesting question this as I did not know of a solution to this. Things have been made more 'challenging' now that container window exists which holds all the tables. I've been thrashing around in ArcObjects and the best I could come up with is the following code that will wire up an event to a table once it has been opened. I'm hoping someone out there knows of a better solution? Duncan Public WithEvents pDataWindowEvents As TableWindow
Public pTableWindow As ITableWindow3
Public Sub TableWindowTest()
' Create a TableWindow Object and add Application object to it
Set pTableWindow = New TableWindow
Set pTableWindow.Application = Application
' Get a handle on the open tables in TableWindow as a set object
Dim s As ISet
pTableWindow.FindOpenTableWindows s
Debug.Print "number of tables open in TableWindow: " & s.Count
s.Reset
If s.Count = 0 Then
Debug.Print "Window not open!"
Else
' Get first table from set object
Dim pTW As ITableWindow
Set pTW = s.Next
' Wire up event listener to this specific table
Set pDataWindowEvents = pTW
' Get the Table object
Dim pTable As ITable
Set pTable = pTW.Table
' Report some info in debug
Dim pDataset As IDataset
Set pDataset = pTable
Debug.Print "Returned Table: " & pDataset.Name
Debug.Print "Number of rows:" & pTable.RowCount(Nothing)
End If
End Sub
Private Sub pDataWindowEvents_HideWindow(ByVal window As esriArcMapUI.IDataWindow)
MsgBox "goodbye!"
End Sub
Private Sub pDataWindowEvents_ShowWindow(ByVal window As esriArcMapUI.IDataWindow)
MsgBox "hello!"
End Sub
... View more
05-15-2012
07:44 AM
|
0
|
0
|
730
|
|
POST
|
Looking at your code extract it appears OK, but you should confirm that the polyline slopeLine is valid, try putting in a message box to return the length of slopeLine. If this was you expected then something else is going wrong.
... View more
05-15-2012
05:45 AM
|
0
|
0
|
499
|
|
POST
|
Abby, I just spoofed up some point data with a single point selected and carried out a selectbylocation with a within distance of 100m on a line layer. For me the selectbylocation tool from the menu selects exactly the same polylines as the selectbylocation geo-processing tool when called from the Python window. So I cannot replicate your problem. Soo... may be the datasets are corrupt in some way? Things to consider are: What are their storage format, do they differ? Are you trying to select data in a shapefile using a geodatabase dataset? If you are using geodatabases, is it an old 9.1 database I know they have lower precision? If in arcsde, export to shapefiles and try those. Spatial index has become corrupted, remove it and add it again Geomtries are corrupted, use the check geometry tool Have you set geoprocessor environments in ArcMap (go to geoprocessing > environments and clear anything that may have been set in a previous session) You could also try uploading a zipped copy of your data for us to see if we can replicate the problem? Looks like you are not the only person having this problem, look here. Duncan
... View more
05-11-2012
01:10 AM
|
0
|
0
|
1940
|