POST
|
I have a fairly large model that seems to keep crashing every time it hits the Tin to Raster tool near the end. I have tried replacing the tool with a new one, thinking maybe it is corrupt and even then it still crashes everything. I don't know what the error is because it crashes before I get a chance to see anything. Has anyone experienced this problem or no what could be causing it? Hi, I am not sure how you have set everything up, but maybe check the units your map / data is in. If converting from TIN to Raster and you set the cells size of the Raster in m, but the data is Geographic (Degrees) the tool tends to bomb out because the cell size may be larger than that spatial extent of the data. That's all I can think of (it happened to me not long ago)
... View more
02-11-2014
11:22 PM
|
0
|
0
|
242
|
POST
|
Good day, So a follow-up to this post. I got it working, it now exports a Geotiff to the correct spatial location. Some of the fixes: 1) ensuring the map document was in a metre projetion 2) allowing for the export to take into account the DPI My next issue is that the exported document is blank. I am really unsure as to why this is. If there are any insights...I would love to hear them... Thanks K
... View more
01-16-2014
01:22 AM
|
0
|
0
|
347
|
POST
|
Hi, I am not sure if this is the correct location for this query, but here it is. I am trying to export data from the data view in ArcMap to a georeferenced JPG or Tiff. I can do it manually, however I would like to automate the process to export based upon a polygon layer. I have been able to get the code working, however, the coordinates of the exported raster (Tiff) have not been preserved. Could someone please point me in a direction of some documentation of how best to do this? Please find my code below: I know its a little rough, its a work in progress I have found some examples online have have spliced things together as I see it could work. Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim pEFeat As IEnumFeature
Dim papp As IApplication
Dim pmxdoc As IMxDocument
Dim pmap As IMap
Dim pFLayer As IFeatureLayer
Dim pFClass As IFeatureClass
papp = My.ArcMap.Application
pmxdoc = papp.Document
pmap = pmxdoc.FocusMap
pFLayer = pmxdoc.SelectedItem
pFClass = pFLayer.FeatureClass
Dim pFCursor As IFeatureCursor
pFCursor = pFLayer.Search(Nothing, False)
Dim pFeature As IFeature
pFeature = pFCursor.NextFeature
Do While Not pFeature Is Nothing
'******************************
Dim MapSheet As String
Dim BatchField As String
Dim pfd As IFeatureLayerDefinition
Dim pActiveView As IActiveView
Dim pExporter As IExporter
Dim pEnv As IEnvelope
Dim exportFrame As tagRECT
Dim pWorldFile As IWorldFileSettings
Dim hdc As Long
Dim pqfilter As IQueryFilter
pfd = pmxdoc.SelectedLayer
BatchField = "TAG"
MapSheet = pFeature.Value(pFeature.Fields.FindField("TAG")) 'pFLayer.value(pFLayer.fields.findfield("MAPSHEET"))
pfd.DefinitionExpression = BatchField & " = '" & MapSheet & "'"
pFClass = pFLayer.FeatureClass
pqfilter = New QueryFilter
pqfilter.WhereClause = BatchField & " = '" & MapSheet & "'"
' pFCursor = pFClass.Search(pqfilter, False)
pmxdoc.ActiveView.Extent = pFeature.Shape.Envelope
pmxdoc.FocusMap.MapScale = 30000
pmxdoc.ActiveView.Refresh()
'Export the view
pActiveView = pmxdoc.ActiveView
pExporter = New TiffExporter
pEnv = New Envelope
Dim BEnv As IEnvelope
BEnv = pmxdoc.ActiveView.Extent
'Setup the exporter
exportFrame = pActiveView.ExportFrame
'pEnv.PutCoords(exportFrame.left, exportFrame.top, exportFrame.right, exportFrame.bottom) <--- Here the coords read 0 , 0 , 940 , 940 (not correct)
pEnv.PutCoords(BEnv.XMin, BEnv.YMin, BEnv.XMax, BEnv.YMax) ' If I use this, I get a "NOT ENOUGH MEMORY ERROR" but the coordinates are correct
Dim outloc As String = "C:\temp\"
Dim out_prefix As String = "MapNumber"
Dim dpi1 As Integer
dpi1 = 800
With pExporter
.PixelBounds = pEnv
.ExportFileName = outloc & "\" & MapSheet & out_prefix & ".tif"
.Resolution = dpi1
End With
'Recalc the export frame to handle the increased number of pixels
pEnv = pExporter.PixelBounds
pWorldFile = pExporter
pWorldFile.MapExtent = pEnv
pWorldFile.OutputWorldFile = True
hdc = pExporter.StartExporting
pActiveView.Output(hdc, dpi1, exportFrame, Nothing, Nothing)
pExporter.FinishExporting()
pFeature = pFCursor.NextFeature ' pFCursor.NextFeature
Loop
End Sub Regards, K
... View more
01-08-2014
08:57 PM
|
0
|
1
|
1234
|
POST
|
Hi, I am still relatively novice at VB.NET, and am in the process of trying to automate a system here whereby I set a scheduled task to run a process within an MXD. From what I have researched, it seems a console application is the way forward. Using VS Express 2010 I have started trialing a number of small Geoprocessing Tools, however I am falling down on Step 1. I am trying to select all features within a shapefile called "lay" in a MXD called "Test". I keep getting a HResult_EFAIL on the selection. Please see an excerpt of the script below: Sub Main()
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop)
'ESRI License Initializer generated code.
m_AOLicenseInitializer.InitializeApplication(New esriLicenseProductCode() {esriLicenseProductCode.esriLicenseProductCodeBasic}, _
New esriLicenseExtensionCode() {})
'ESRI License Initializer generated code.
Dim docName As String = "C:\Temp\Test.mxd"
Dim mapDoc As IMapDocument = New MapDocument
If mapDoc.IsPresent(docName) Then
mapDoc.Open(docName)
End If
Dim IActive As IActiveView
IActive = mapDoc.ActiveView
Dim map As IMap = mapDoc.ActiveView.FocusMap
Dim pmxdoc As IMxDocument
pmxdoc = m_pApp
Dim pSelect As IFeatureSelection
Dim player As IFeatureLayer
Dim pFC As IFeatureClass
Dim i As Integer
Do Until i = map.LayerCount - 1
If map.Layer(i).Name = "lay" Then
player = map.Layer(i)
Exit Do
Else
End If
i = i + 1
Loop
MsgBox(player.Name)
Dim pPlayer As IFeatureLayer
pSelect = player
' pmxdoc = mapDoc.ActiveView.FocusMap.Layer(0)
pSelect.SelectFeatures(Nothing, esriSelectionResultEnum.esriSelectionResultNew, False) ' <---------- HERE I found this online and have been modifying or trying to modify it to get it to work and have not succeeded once. Is there anything obvious in the code above that is wrong? I am pretty confident this would work in a normal Add-In Button, but the console seems to be different? Thanks K <EDIT>: If I could swear and curse on this forum I would. I have been fighting with this for days...only now has it occurred to me that I am developing this tool on a PC with an Advanced License for a PC with a Basic License.... My fault, I should have used: {esriLicenseProductCode.esriLicenseProductCodeAdvanced} .... Oh well. Thanks for reading.
... View more
11-25-2013
10:12 PM
|
0
|
0
|
523
|
POST
|
Hi thanks for clarifying that. One thing I can think of is that some of those sinks that are not picked up may be smaller than 1m. If you run the Fill Tool with no Z-Limits, are these smaller sinks identified?
... View more
11-12-2013
01:26 AM
|
0
|
0
|
877
|
POST
|
Good day, I was hoping someone might be able to assist in explaining how the tracker works in the collector and how to set up lists (preset data) for collection from the Collector App? Basically I have read how to add the tracking service to a published map online and have done so. I cannot however seem to get the tracker to show / move as a field worker is collecting data within the field. I simply see the points that are being collected. Could someone please post a link / describe how this is meant to work? Secondly I have seen in the videos posted on the ArcGIS Online blogs of people collecting data based upon predefined options and symbols. How is this accomplished? Many thanks and kind regards, K
... View more
11-11-2013
11:46 PM
|
0
|
1
|
717
|
POST
|
Hi, Sorry for late response. Yes that's the article I was talking about, thank you. Keagan Allan: Thank you for your response but I have alredy done that. I want to extract sinkholes directly from contours (without interpolating) to compare the results and consequently update the sinkholes extracted the way you described. Hi, I will look over that article and see if I can decipher what was being done. If you do come right please post the solution, I would love to know how to do this too. Regards, K
... View more
11-11-2013
11:38 PM
|
0
|
0
|
877
|
POST
|
Hi, Unfortunately the link is broken, so I cannot see how this has been done. I can however, based on what you have said and my understanding of it, point out how things could be done. The following is how I identify Ponding / Water Storage Areas - possibly you could modify this to fit your needs. 1) Take a contour dataset and convert this to a TIN and then to raster (This raster dataset is your untouched original) 2) Can be done in two ways (a or b) a) Take the original raster from 1 and perform a "Surface Fill" (located in the Spatial Analyst - Hydrolocial Tools), These may be tweaking required to get a decent result, but basically this tool fills all the holes or depressions in the raster surface to create a hydrological surface that allows for water to pass freely over it. Effectively this should "fill in" the sinkholes in the contour dataset. b) Is similar to a, except you use the topo to raster interpolation in 3D or Spatial Analyst. One of the parameters in this interpolation is the number of iterations the interpolation is allowed to run, the more the process runs, the more smooth the surface will become. Effectively the result is similar to a. 3) After you have run a or b you can use the raster calculator to subtract the original raster (1) by the modified raster (2a or b), the result will be a raster with values from 0 to -xxx. Where 0 are areas where there was not alteration to the raster from filling in depressions and the -xxx are areas where the were depressions filled. 4) Running the contour tool on this raster will give you the contours of the sink holes. From the 0 contour down to the deepest - If you want it the other way around simply subtract Raster 1 from Raster 2a or b. I am not sure if I have helped you or missed the point completely, but hopefully once the correct link is put up I can see what you needed. Good luck, I look forward to reading the article. K
... View more
11-05-2013
10:16 PM
|
0
|
0
|
877
|
POST
|
Hi Kevin, I may not have the answer for you, but from you have stated I may be able to provide a starting point for you? If I have understood correctly, you want to extract a number of attributes from a raster and place them in the attribute table of a vector line? One way to do this would be to: 1) Densify the line, so that you have more vertices (try to the cell size?); 2) Convert the vertices to points; 3) Use the "Extract Multi-Values to points" tool in the toolbox and extract the various raster values to these points; 4) Split the line by these points 5) Spatial Join the Points to the Split Line Now this is just off the top of my head, one needs to consider how the attributes are transferred to the line form the points. If it does not do this correctly, then perhaps changing the order of things may allow for certain OId's to be similar across the processes and thus could potentially be used as the common attribute for a table join, instead of a spatial join. All of these tools should be accessible in VB.Net or C#, should you wish to automate this. I hope this has helped, if not, maybe I can suggest something else. Cheers, K
... View more
11-04-2013
01:26 AM
|
0
|
0
|
1581
|
POST
|
Sorry that didnt work. this should be a simple process. The only other potential solution - try copying the data you using for the dissolve into a new field. That may help?
... View more
11-03-2013
10:16 PM
|
0
|
0
|
340
|
POST
|
THANK YOU!! your response was clear and works! You have saved me a ton of work! Awesome! I will use this for the other issues I have been having. To think it was just a comma issue. Cheers! K
... View more
11-01-2013
03:45 AM
|
0
|
0
|
573
|
POST
|
Hi, I often find there are potentially two issues when it comes to Error 000117. 1) Have you tried changing the output directory and ensure there are no spaces in the name / path (and the start of the output filename isnt a number); and 2) have you tried running the repair geometry tool on the data? Something else, maybe try creating a new field and populating that with the parameter for the dissolve and re-run the dissolve on that field? Hope this helps a little. K
... View more
10-31-2013
11:14 PM
|
0
|
0
|
340
|
POST
|
Hi, I do not know much about Python, however I do find it useful to set the process you want to do in the Model Builder and then export the model to Python Script. File - Export Model - To Python Script Opening that file in Notepad or similar text editor allows you to look into how a process / geoprocessor uses syntax to reference the various inputs and parameters you want to use. I know its not much, but hopefully it will get you on track. Good luck, K
... View more
10-31-2013
02:53 AM
|
0
|
0
|
243
|
POST
|
Final Update: It appears that the code does not like spaces in the Directory Path. some of my project folders contained spaces and Murphy's Law, those were the ones I was testing in. Moral of the story: Avoid having spaces in filenames and paths.
... View more
10-30-2013
09:52 PM
|
0
|
0
|
403
|
POST
|
Cool, Hindsight is always 20/20 ... Good luck with the rest of the process. On a side note, you can export the model to Python, so that may help in terms of identifying the correct coding structures. Cheers, K
... View more
10-30-2013
06:02 AM
|
0
|
0
|
399
|
Title | Kudos | Posted |
---|---|---|
1 | 02-24-2015 02:05 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|