|
POST
|
Hello everyone, I am running the Python code below first pointing to an SDE layer and then pointing to a FGDB layer and in the first case after the program finish nothing gets inserted in SDE. It works in the FGDB. The layer in SDE is not versioned. I can Append layers from the FGDB to SDE using: arcpy.Append_management( What am I missing? curAppend = arcpy.InsertCursor(WASDAGREEMENT_D)
.....
rowAppend = curAppend.newRow()
rowAppend.SHAPE = rowYesterday.SHAPE
rowAppend.AGMID = rowYesterday.getValue("AGMID")
rowAppend.DIGIBY = rowYesterday.getValue("DIGIBY")
rowAppend.DIGIDATE = rowYesterday.getValue("DIGIDATE")
rowAppend.STATUS = rowYesterday.getValue("STATUS")
rowAppend.REQUESTED = rowYesterday.getValue("REQUESTED")
rowAppend.PNAME = rowYesterday.getValue("PNAME")
rowAppend.PLOCATION = rowYesterday.getValue("PLOCATION")
rowAppend.PDESC = rowYesterday.getValue("PDESC")
curAppend.insertRow(rowAppend)
... View more
03-03-2016
07:45 AM
|
0
|
6
|
3102
|
|
POST
|
Thank you. This syntax seems to work too: whereClause = '"AGMID" = %s AND "DIGIDATE" = date \'%s\' ' % (agreementID, datetimeVal) Thanks
... View more
03-02-2016
09:44 AM
|
0
|
1
|
1262
|
|
POST
|
Hello everyone, What is the syntax to use a date field in a whereClause? This code does not work: datetimeVal = rowYesterday.getValue("DIGIDATE") whereClause = "DateAGMT = " + datetimeVal ============== This syntax does not work srcToday = arcpy.SearchCursor(AGREEMENT, whereClause) Thank you
... View more
03-02-2016
07:26 AM
|
0
|
3
|
2767
|
|
POST
|
I realized that my question is more general. How can I use a date field in a whereClause that I can reuse in a arcpy.SearchCursor? Also what is the difference between arcpy.da.SearchCursor and arcpy.SearchCursor? Thanks
... View more
03-02-2016
05:33 AM
|
0
|
3
|
2872
|
|
POST
|
Hello everyone, how can I add a date field in a whereClause when using an arcpy.SearchCursor? This is the portion of the code I am using: for row in cur: whereClause = "AGMID = " + row.getValue("AGMID") + " AND DIGIDATE = " + row.getValue("DIGIDATE") src = arcpy.SearchCursor(AGREEMENT, whereClause) I can compare the field "AGMID = " + row.getValue("AGMID") but the field DIGIDATE fails. Thanks
... View more
03-01-2016
01:00 PM
|
0
|
7
|
6138
|
|
POST
|
Thank you all!! Removing the \n\n" fixed the problem.
... View more
03-01-2016
09:51 AM
|
0
|
0
|
1611
|
|
POST
|
Hello everyone, I exported a ModelBuilder to Python where there is a FeatureLayer where I compare 2 Date Fields and it works fine in Model Builder but in Python it displays the following error message: ExecuteError: ERROR 000230: Failed selecting with MODDATE <> MODDATE_1 \n\n Failed to execute (MakeFeatureLayer). This is the python code: # Process: Make Feature Layer (5) arcpy.MakeFeatureLayer_management(Agreement, Agreement_Layer1, "MODDATE <> MODDATE_1 \\n\\n", "", "OBJECTID OBJECTID .... ")
... View more
03-01-2016
08:34 AM
|
0
|
3
|
3128
|
|
POST
|
Hello everyone, There is an Esri sample that has a function called Public Function FindVersionDifferences(ByVal workspace As IWorkspace, ByVal childVersionName As String, ByVal parentVersionName As String, ByVal tableName As String, ByVal differenceType As esriDifferenceType) As IFIDSet to list Version Differences between two SDE versions. ArcObjects 10 .NET SDK Help I am interested in reusing this function but I need also to find the features resulting from this differences, so my question is how can I open the feature class associated with the Table - childFWS.OpenTable(tableName) - and then save the feature (IFeature) into an external feature class to track differences. Thanks
... View more
02-26-2016
11:34 AM
|
0
|
0
|
1621
|
|
POST
|
Hi, I am comparing two different days of the same feature class and I am looking for unmatched features to find records inserted and deleted. Thanks
... View more
02-25-2016
04:15 PM
|
0
|
3
|
2751
|
|
POST
|
Hello everyone, I need to check if features from one FC match features from another feature class. For this purpose I need to compare 3 fields from the first FC to 3 fields from the second FC. How can I compare 2 feature classes using more than one field? With one field I can use join a join. Is is possible to join several fields between 2 FCS? Do I need to do this compare in python or vb.net? Thanks
... View more
02-25-2016
03:39 PM
|
0
|
7
|
4638
|
|
POST
|
Hello everyone, I am writing a code in vb.net to delete features in a SDE FC listed in a FGDB FC. I am using a FC from a FGDB where I read all records. Then using the GLOBALID, the code searches for the matching record in SDE and then deletes it in SDE. Please let me know if I need to open an editing session for this purpose and also if this code is the recommended code. '
' Removes records from target feature
'
'
Dim searchCur As IFeatureCursor = sourceFC.Search(Nothing, False)
Dim featObj As IFeature = searchCur.NextFeature()
Dim targetFields As IFields = targetFC.Fields
' Create a ComReleaser for cursor management.
Using comReleaser As ESRI.ArcGIS.ADF.ComReleaser = New ESRI.ArcGIS.ADF.ComReleaser
Dim targetQueryFilter As IQueryFilter = New QueryFilterClass()
targetQueryFilter.SubFields = "GLOBALID"
Dim targetCur As IFeatureCursor
Dim targetFeature As IFeature
Do While Not featObj Is Nothing
targetQueryFilter.WhereClause = "GLOBALID = " & featObj.Value(featObj.Fields.FindField("GLOBALIDTXT")).ToString
targetCur = targetFC.Search(targetQueryFilter, False)
comReleaser.ManageLifetime(targetCur)
targetFeature = targetCur.NextFeature
If Not targetFeature Is Nothing Then
targetFeature.Delete()
End If
featObj = searchCur.NextFeature()
Loop
End Using
... View more
02-23-2016
05:10 AM
|
0
|
0
|
1957
|
|
POST
|
Hello everyone, I am testing the code below and it does not change the type of the field GLOBALID from GlobalId to GUID ArcObjects 10 .NET SDK Help Environment: - ArcGIS 10.2 - SDE based on Oracle 11G - Visual Studio 2010. ' Converts a GlobalID field to a GUID field.
Public Sub ConvertGlobalIdToGuid(ByVal workspace As IWorkspace, ByVal datasetName As String)
' Open the table.
Dim featureWorkspace As IFeatureWorkspace = CType(workspace, IFeatureWorkspace)
Dim table As ITable = featureWorkspace.OpenTable(datasetName)
' Get the GlobalID field.
Dim classEx As IClassEx = CType(table, IClassEx)
If Not classEx.HasGlobalID Then
Throw New Exception(String.Format("No GlobalID column in table: {0}.", datasetName))
End If
Dim globalIDFieldName As String = classEx.GlobalIDFieldName
Try
' Convert the GlobalID column to a GUID column.
Dim classSchemaEditEx As IClassSchemaEditEx = CType(table, IClassSchemaEditEx)
classSchemaEditEx.UnregisterGlobalIDColumn(globalIDFieldName)
Catch ex As Exception
Console.WriteLine("Could Not Open Geodatabase")
Console.WriteLine("{0} ", ex.Message)
End Try
End Sub
... View more
02-18-2016
12:05 PM
|
1
|
1
|
3658
|
|
POST
|
Hello everyone, I just want to re-write this VB.Net code using ArcGIS Server 10.2. It works fine in ArcGIS Server 10.0 but it fails in ArcGIS Server 10.2: Dim gputilities As IGPUtilities = New GPUtilitiesClass() Dim myResult As Boolean = True ' Declare server context variables Dim mapServerContext As IServerContext = Nothing Dim agsServerConnection As ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection = Nothing Dim featuresCount As Integer Try Dim username As String = ConfigurationManager.AppSettings("username") Dim password As String = ConfigurationManager.AppSettings("password") Dim domain As String = ConfigurationManager.AppSettings("domain") Dim hostname As String = ConfigurationManager.AppSettings("hostname") Dim mapservice As String = ConfigurationManager.AppSettings("mapservice") ' Connect to ArcGIS Server Dim adfIdentity As New ESRI.ArcGIS.ADF.Identity(username, password, domain) agsServerConnection = New ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(hostname, adfIdentity) agsServerConnection.Connect() If (Not agsServerConnection.IsConnected) Then agsServerConnection.Dispose() Return False End If ' Get a reference to the server object manager to use in creating server objects Dim serverObjectManager As ESRI.ArcGIS.Server.IServerObjectManager = agsServerConnection.ServerObjectManager ' Create a server context for and get a reference to the BloomfieldTownship map service. We will ' use this to access map information and query features. mapServerContext = serverObjectManager.CreateServerContext(mapservice, "MapServer") Dim mapServer As ESRI.ArcGIS.Carto.IMapServer2 = TryCast(mapServerContext.ServerObject, ESRI.ArcGIS.Carto.IMapServer2) ' Get a reference to the map service's server objects Dim mapServerObjects As ESRI.ArcGIS.Carto.IMapServerObjects = CType(mapServer, ESRI.ArcGIS.Carto.IMapServerObjects) Dim map As ESRI.ArcGIS.Carto.IMap = mapServerObjects.Map(mapServer.DefaultMapName)
... View more
02-17-2016
05:46 AM
|
0
|
0
|
4179
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 05-01-2026 12:34 PM | |
| 1 | 12-02-2022 08:17 AM | |
| 1 | 12-26-2025 05:02 AM | |
| 1 | 08-05-2025 04:28 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|