POST
|
ArcMap Desktop 10.1 I'm trying to build a simple Calculate Value Tool entry in a model to concatenate some variables together into an output shapefile name. Cannot get it to work even though the expression evaluates correctly. I have simplified and simplified it trying to find source of error. I now have the simplest of entries. I put a simple text string into the expression and it still will not get past the tool. Executing (Calculate Value): CalculateValue "calcname1" # String Start Time: Wed Jul 05 12:35:54 2017 Value = calcname1 ERROR 000354: The name contains invalid characters Failed to execute (Calculate Value). Failed at Wed Jul 05 12:35:54 2017 (Elapsed Time: 0.00 seconds) I have tried arcpy.ValidateTableName() - no difference. What 'name' has invalid characters? I chopped everything out of the model to where there is just the Calculate Value tool trying to evaluate the one input text string. It will not successfully finish. Help?
... View more
07-05-2017
11:42 AM
|
0
|
8
|
4321
|
POST
|
I am using Desktop Basic 10.1 and 10.3 to prepare data. The shapefiles and tifs that result are sent to a client for import to his proprietary spatial database. All of the products I produce are built to a selected projection for each study area. The open source software that consumes these products requires an SRID. I have searched online and through the software. How do I extract this information within ArcMap? Is it even stored somewhere with the file geodatabase feature class, shapefiles, or tifs? In the properties window I can get the details about the projection like below: ata Type: Shapefile Feature Class Shapefile: D:\BC_2016\BC_Bounds\Study_area\BC_Land_bounds_20160515.shp Geometry Type: Polygon Coordinates have Z values: No Coordinates have measures: No Projected Coordinate System: NAD_1983_BC_Environment_Albers Projection: Albers False_Easting: 1000000.00000000 False_Northing: 0.00000000 Central_Meridian: -126.00000000 Standard_Parallel_1: 50.00000000 Standard_Parallel_2: 58.50000000 Latitude_Of_Origin: 45.00000000 Linear Unit: Meter Geographic Coordinate System: GCS_North_American_1983 Datum: D_North_American_1983 Prime Meridian: Greenwich Angular Unit: Degree Is there a way to extract the SRID for this spatial coordinate system?
... View more
10-14-2016
10:42 AM
|
1
|
1
|
1556
|
POST
|
I am using Desktop Basic 10.3 with spatial analyst. I can use polygon to raster to create a FGDB raster from a text field in a shapefile. The raster is created with a attribute table containing the item from the shapefile that I chose. I have two colleagues, each running 10.2.2. They do the exact same steps, on the exact same input shapefile, with the exact same environment settings and they do not get an item in the attribute table. They just get ObjectID, Value, Count.. This is completely useless if I can't carry the chosen attribute item to the raster. I have been doing this simple step for 20 years, dating back to Grid. It worked on my desktop when I was at 10.1. Any suggestions?
... View more
06-19-2015
07:36 AM
|
0
|
2
|
3407
|
POST
|
Duncan, Thanks for taking the time to help. I did not copy down all of the exact error messages on 7 different machines for many many attempts - they were all of a similar theme so I have to start with a general area of fixes. You have provided some possibilities. The errors occur at different points within the program. The console launches and processing begins normally. The crash happens at slightly different progressions on each machine. It is compiled to x86 for all assemblies. Could this be a memory leak? I have 16gb. They have 8 or less. Could it be that they hit problems before I do because I have more ram and make it through the run before a problem occurs? The original programmer has placed many garbage collection calls and in places uses a System.Threading.Thread.Sleep(5000) before calling for garbage collection. I am thinking he has tried a workaround to the same problem I have now encountered???? My first thought was that my msi did not provide something to the new installs that is present on my machine. How do I determine? The machines that failed to work were all laptops connected to a desktop over a network. The data and application were physically located on the desktop. We checked out a Arc license and installed locally on one laptop with the same result. I think this rules out a network problem? If I target .net 3.5, do I have to list all of the 3.5 assemblies in the references on the compiler settings windows? Thanks for help! Tim
... View more
06-12-2013
08:26 AM
|
0
|
0
|
220
|
POST
|
I am working with Desktop Basic 10.1 and vb.net. What version of .NET framework should I target when compiling custom components in visual studio? Are there any good references I should read about compiling arcobject custom components? I have spent days searching and still do not fully understand what I should be doing. (In a previous thread I detailed the problem I am trying to fix: compiled code works on my PC but nobody elses. Debugger code works on all machines tested) Thanks for any advice, Tim
... View more
06-11-2013
10:01 AM
|
0
|
1
|
370
|
POST
|
I have a custom component built in Visual Studio 2010 that is running on Desktop Basic 10.1. It is programmed in VB.net targeting 3.5 framework. The .msi installer works fine. The first part of the program runs OK on all machines (entry screens and data verification). The code then does a long series of intersects, appends, file creation, calculations and writes to the newly created tables in personal geodatabases. These steps work fine on all machines. The problem: The code now calls a console application that tries to use the created data files in an iterative simulation. It runs fine on my PC. On all of the client's machines, it throws a bewildering array of errors I never seen during debugging. They are different on different machines occurring at slightly different points in the code execution. They all seem to have something to do with memory errors. I get subscript out of range, no instance of object, null parameters passed, invalid data type used as parameter, etc etc etc. These would all be blatant coding errors I would have seen in the debugging process. I installed Visual Studio on a client machine and stepped through the debugger - It worked fine! How can this be? What is the use of a debugger that doesn't emulate the end code execution? Why does the release version not crash on my PC? The operating systems are the same, the software is the same, the data is the same, the license is being recognized properly. If I am targeting .NET 3.5 in the compiler options, should I specifically list all of the 3.5 assemblies in the references on the advanced compiler tab? Is it possible that some PCs may have different versions of that underlying code? Can anyone point me in some direction please? What should I be looking for to fix this? Appreciate any help - Tim
... View more
06-11-2013
09:50 AM
|
0
|
2
|
404
|
POST
|
Hi, I have a vbnet component program originally coded around version 9.x. It successfully used strings to pass input feature names and output feature names to Intersect and Append tools using the geoprocessor approach. This no longer works in Desktop v10.1. I get the cryptic HRESULT E_FAIL error. After much anguish, I discovered it was really throwing error 000628 - it didn't like the data type of the passed in parameter. Turns out Intersect wants the the input_features in a Value Table data form. The following code now works for Intersect Dim GP As Geoprocessor = New Geoprocessor GP.AddOutputsToMap = False 'GP.AddOutputsToMap = True GP.OverwriteOutput = True GP.LogHistory = True 'System.Threading.Thread.Sleep(5000) 'Calculate feature names with paths and put in data types required to pass to the geoprocessor Dim polygonFileName As String = GolderGISTools.Utilities.Utility.GetLayerPathAndName(modelSetting.PolygonFeatureClassNames(1), Me._mxDocument) & ".shp" Dim gpUtils As IGPUtilities2 = New GPUtilitiesClass() Dim inFeature1 As IFeatureClass = gpUtils.OpenFeatureClassFromString(modelSetting.OutputDataPath & "\fishnet.shp") Dim inFeature2 As IFeatureClass = gpUtils.OpenFeatureClassFromString(polygonFileName) 'Create and populate a Value Table Object to hold the input features to be intersected Dim vt As IGpValueTableObject = New GpValueTableObjectClass() vt.SetColumns(1) Dim obj1 As Object = inFeature1 vt.AddRow(obj1) Dim obj2 As Object = inFeature2 vt.AddRow(obj2) 'Run the Tool Dim intersect As ESRI.ArcGIS.AnalysisTools.Intersect = New ESRI.ArcGIS.AnalysisTools.Intersect() 'Dim union As ESRI.ArcGIS.AnalysisTools.Union = New ESRI.ArcGIS.AnalysisTools.Union() intersect.in_features = vt intersect.out_feature_class = tempDirectoryInfo.FullName & "\temp.gdb\" & "intersect" intersect.join_attributes = "ALL" intersect.output_type = "INPUT" Try GP.Execute(intersect, Nothing) intersect = Nothing ReturnMessages(GP, modelSetting.OutputDataPath & "\log.txt") If GP.MaxSeverity = 2 Then MessageBox.Show("Error intersect Fishnet with LT/FT, see log file", "error in ALCES Mapper", MessageBoxButtons.OK, MessageBoxIcon.Error) Return False End If Catch ex As Exception MessageBox.Show(ex.Message, "error intersect Fishnet with LT/FT", MessageBoxButtons.OK, MessageBoxIcon.Error) ReturnMessages(GP, modelSetting.OutputDataPath & "\log.txt") Return False End Try intersect = Nothing vt = Nothing obj1 = Nothing obj2 = Nothing 'While Marshal.ReleaseComObject(intersect) > 0 'End While GC.Collect() GC.WaitForPendingFinalizers() THE PROBLEM / QUESTION: The Append tool uses a Table View or Raster Feature as the Input and Target parameters. I have tried many combinations to duplicate the above example with this composite data type. All I want is to assign two shape files to the input and target parameters so I can execute an append. I clearly am missing something basic here about the object oriented nomenclature. Input will be : tempDirectoryInfo.FullName & "\temp.gdb\" & "intersect1.shp" Target will be: tempDirectoryInfo.FullName & "\temp.gdb\" & "intersect.shp" Help?? Tim Barker Innovative Forest Analytics Ltd
... View more
05-17-2013
10:59 AM
|
0
|
2
|
512
|
POST
|
rlWatson, Thanks! That worked and my changes have been tested. Sometimes the simple things are far more time consuming than the 'real' work. Tim
... View more
11-16-2012
07:12 AM
|
0
|
0
|
253
|
POST
|
Hi, At the risk of posting the dumb-a$$ question of the week, here goes: I am very new to VB.Net , Visual Studio, and ArcObjects. I have inherited a very large extension that I need to do some simple changes within. This is a VB.net solution (VS 2010) with about a dozen projects in it. At the end of the day, it places a simple toolbar with some buttons inside my desktop basic v10.1. When pressed, the buttons do some some spatial calculations and processing of output in MS Access files. Here's my question: How do I launch specific portions within the debugger? I am not understanding the object oriented thing. In my past experiences with procedural languages, one would fire up 'the program' in the debugger and start at the top and follow through line by line. Here, 'the program' is ARCGIS with some new classes waiting to be invoked. How does it work with object classes like ONCLICK() events ?? There is no logical line-by-line progression in 'the program' that gets one to the onclick() event. Trying to start the debugger in such places fails miserably as none of the required preceding environments and variables have had their values set. If some patient soul is kind enough to point this beginner on the path to understanding, I greatly appreciate it, Tim
... View more
11-15-2012
04:17 PM
|
0
|
2
|
802
|
Title | Kudos | Posted |
---|---|---|
1 | 10-14-2016 10:42 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|