|
POST
|
Correct me if I am wrong, but it appears that ArcGIS Explorer cannot view either ArcInfo binary grids or ArcGIS mosaic datasets. One is a GDAL supported raster format created by ESRI and the other is, arguably, the most useful raster format ESRI has devised; and they can't be viewed in Explorer? good grief.
... View more
08-15-2012
10:30 AM
|
0
|
1
|
1046
|
|
POST
|
I don't suppose there is either: - a map service of the USA Topo Maps without shaded relief or - a way to remove the shaded relief through some tricky image function?
... View more
03-06-2012
09:28 AM
|
0
|
3
|
972
|
|
POST
|
Argh, the answer is so simple. Send the geoprocessor a string where the list items are separated by a semicolon, not a comma. Everything works fine now.
... View more
09-27-2011
12:00 PM
|
0
|
0
|
330
|
|
POST
|
I am trying to use the .NET wrapper for the ContourList geoprocessing tool by reading in a text file and then supplying the necessary properties. Everything works when I use the wrapper for the Contour tool so I know my code basically works. But when I switch to the ContourList tool and try to set the .contour_values property (instead of the .contour_interval and .base_contour properties of the Contour tool), it fails. The list of contour values coming in from the text file is a single line of comma delimited numbers. I can't figure out how to interpret that line so that the tool will take it. Public Function ContourRaster(ByVal sSourcePath As String, ByVal sInterval As String, ByVal sBase As String, ByVal sList As String) As String
Try
'calculates contours from the input raster and then applies symbology
Dim gp As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor()
Dim contour As ESRI.ArcGIS.SpatialAnalystTools.Contour = New ESRI.ArcGIS.SpatialAnalystTools.Contour()
Dim conlist As ESRI.ArcGIS.SpatialAnalystTools.ContourList = New ESRI.ArcGIS.SpatialAnalystTools.ContourList()
Dim sSourceDir As String
Dim sOutName As String
Dim sOutPath As String
'tried some different kinds of arrays
Dim lList As New List(Of Double)
Dim darray As IDoubleArray = New DoubleArray
Dim parameters As IVariantArray = New VarArray
fso = CreateObject("Scripting.FileSystemObject")
sSourceDir = fso.GetParentFolderName(sSourcePath) 'gets parent folder of the base file or folder
sOutName = fso.GetBaseName(sSourcePath) 'gets the base file (w/o extension) or folder (esri grid)
sOutPath = sSourceDir & "\" & sOutName & "_cnt.shp"
If sList = "" Then
With contour
.in_raster = sSourcePath
.out_polyline_features = sOutPath
.contour_interval = sInterval
.base_contour = sBase
End With
gp.Execute(contour, Nothing)
Else
parameters.Add(Convert.ToDouble(sList.Split(",")(0)))
parameters.Add(Convert.ToDouble(sList.Split(",")(1)))
With conlist
.in_raster = sSourcePath
.out_polyline_features = sOutPath
'I have tried to set contour_values to the incoming string as well as a variety of arrays
.contour_values = parameters
End With
gp.Execute(conlist, Nothing)
End If
'return the outputs parameter to what it was
gp.AddOutputsToMap = bDefOutputs
'return the path to the contours data source
ContourRaster = sOutPath
Catch e As Exception
Shuterdown(e)
End Try
End Function
... View more
09-26-2011
04:35 PM
|
0
|
1
|
844
|
|
POST
|
Crisjovano, Sorry! I misunderstood your first post. What I would do is first create a single directional borehole line, turn it into a route, and then locate the borehole intervals along its length. This is what I did recently for this very exercise using available tools. 1) Your X, Y, Z, azimuth, dip, and depth values are the same for every borehole, so normalize your intervals table into a table where each row is a different borehole. Then create two new fields, 'horizontal' and 'vertical' for instance. The horizontal value is going to be the length of the line in 2d as if you were looking down on the line in plan view. The vertical value is going to be the distance down from the plan view horizon to the bottom of the borehole. Horizontal = cos(dip) * depth and Vertical = sin(dip) * depth. 2) Create 2d lines using the 'Bearing Distance to Line' tool in Data Management. Use the X, Y, azimuth, and HORIZONTAL (not depth) fields. 3) Put these lines in a Z-aware feature class and enter the borehole collar elevation ('Z') and borehole bottom elevation ('Z' - 'vertical') for each line. 4) Turn these lines into routes using the Create Routes tool. Take care with the coordinate priority so that your boreholes get measured from top to bottom and use the 'ONE FIELD' parameter for the measure source and set From-Measure Field to the depth value. 5) Use the Locate Features Along Routes tool to place the borehole intervals along the measured borehole lines. If you need to automate this, I would recommend python over ArcObjects
... View more
08-10-2011
10:41 AM
|
0
|
0
|
1777
|
|
POST
|
Have you tried using an offset larger than .00001 in the line? pPoint.x = pRow.Value([XField]) + 0.00001 I suspect that that value is within the cluster tolerance and so your second point is actually collapsing on top of your first point. I think your code should work and it looks a lot like what I have done in the past, that is, offset the bottom point a negligible amount so that you can measure it and locate route events on it. Try creating your code-based line in the same feature class container that the ArcHydro line is in.
... View more
08-04-2011
03:53 PM
|
0
|
0
|
1777
|
|
POST
|
And another weird thing is happening I didn't at first think was related. When pObj = gxCat.GetObjectFromFullName(sPath, numFound) is called, an unnamed .prj file appears in the folder alongside the mxd that has the addin with the spatial reference of the tif file at the end of sPath.
... View more
08-01-2011
01:24 PM
|
0
|
0
|
533
|
|
POST
|
Thanks! Yes, I did find an example of testing for a single or an enumeration reference and it turns out the function is returning an enumeration of three references, all to the exact same object, in this case a tif file (also tried a .asc), which I presume is just one object. And this is probably why my code worked on a different build; it was always only returning a single reference. So, why am I getting three now?
... View more
08-01-2011
10:08 AM
|
0
|
0
|
533
|
|
POST
|
In an ArcMap addin I have the code:
Dim gxCat As IGxCatalog
Dim pObj As IGxObject
Dim x As Long
gxCat = New GxCatalogClass
pObj = pObj = gxCat.GetObjectFromFullName(sPath, x)
But the last line trips the error - Cannot convert to 'Interface IGxObject', but that's exactly what the function is documented to do. I know the path is good (tried a few) and I think I am getting a valid catalog object, I mean, I can do things with it like make a folder connection. Furthermore, on my previous computer, this same addin and this same chunk of code never threw an error. BTW, what I am trying to do is, from a full path to an object, determine first if the path leads to a valid ArcCatalog object and then what the datase type of that object is, so if there is another way beside getting to IGxDataset.Dataset.Type I would appreciate it. Thanks
... View more
07-28-2011
03:05 PM
|
0
|
4
|
925
|
|
POST
|
I think you get this error because you cannot run a script from IDLE with any arguments. If you were to call this script from the command line, eg >>>> myscript.py argument1 then argument1 gets parsed as sys.argv[1] and it would probably run, likewise from model builder. For testing you could put in some code like this: if not sys.argv[1]:
event_name = raw_input('Enter an event name') that would catch the possibility of there not being an argument and allowing you to enter it at run time
... View more
03-30-2011
03:52 PM
|
0
|
1
|
591
|
|
POST
|
I have one mxd with two data frames ['Layers', 'New Data Frame'] with layers in them. If Layers is active and I use the lines below in the command line window: mxd = arcpy.mapping.MapDocument('Current')
df = arcpy.mapping.ListDataFrames(mxd, 'New Data Frame')[0]
mxd.activeView = df New Data Frame is made active and I see the layers. If use the same commands in a geoprocessing script, the layers are removed from the data frame before it is made active. Does anyone know what's going on?
... View more
03-25-2011
03:46 PM
|
0
|
5
|
1775
|
|
POST
|
Thank you larsfind! for the dummies (read: me): Download the snippet finder Unzip wherever Go to Tools > External Tools in studio express and navigate to ArcGISSnippetFinder.exe in the 'Command' window Uncheck 'Prompt for arguments' (I don't understand the path options here, maybe someone can provide a good reason for setting either 'Arguments' or 'Initial directory'?) The first time you open the finder you will need to 'Attach to an ArcGIS snippet directory' under File, but thereafter it will remember the directory. You can search, but I (at least) do not get the 'Tools' or 'ArcObjects' menu items that appear in any screenshot I've seen of the AG10 Finder. I like that I can run the finder as a standalone application outside of Studio.
... View more
01-26-2011
02:19 PM
|
0
|
0
|
1640
|
|
POST
|
"If you are using the Visual C# Express Edition or Visual Basic Express Edition, you cannot debug DLLs because these versions do not have the option to start an external application for debugging." That's odd, VB Studio 2008 Express? On the debug tab I selected a working directory where my mxd sits, and then put the name of the mxd in the Command line arguments windows and that's the mxd that started up when debugging started in Studio. Admittedly, the meaning of the two windows escaped me until I had gone through the trouble of manually editing the vbproj file.
... View more
01-26-2011
10:48 AM
|
0
|
0
|
1447
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-29-2025 09:49 AM | |
| 1 | 10-25-2021 01:17 PM | |
| 3 | 05-10-2023 09:21 AM | |
| 1 | 04-06-2023 02:09 PM | |
| 1 | 07-07-2022 03:28 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-26-2025
11:00 AM
|