POST
|
I don't know if 9.3 supports mosaic to new raster, but the help for 10.2 uses two rasters as input. Anyway, since these rasters are coming from and going to a folder rather than a .gdb, they need the file extensions. Thanks for the reply. 9.3 does have a mosaic to new raster tool but I wonder if the 10.2 version is all new. So is it not possible then to save to a folder if you want to end up with ESRI grids? The help says no extension for ESRI grids but also no extension if it's going into a .gdb.... I'll try out your suggestions and report back.
... View more
06-12-2014
10:13 AM
|
0
|
0
|
303
|
POST
|
Hi all, Can anyone help with figuring out how to list multiple rasters that are each saved in different folders for using within the mosaic to new raster tool? Can't figure this out after much searching and testing. I've tried putting the input rasters in brackets, in quotes,without quotes... I just keep getting an invalid syntax warning Failed to execute (MosaicToNewRaster).. The example in the help file only lists one raster as the input raster and so I nominate it for worst help file - why would you want to mosaic a single raster?!? Thanks! -DJ ---------- import arcgisscripting gp = arcgisscripting.create(9.3) workspace = r"Z:\Climate" gp.workspace = workspace outRaster = "mosaic12" rastOne=r"V:\Project\rast1" rastTwo=r"C:\Project\subfolder\rast2" outRaster = "class7030" gp.MosaicToNewRaster_management([rastOne;rastTwo], workspace, outRaster, "", "8_BIT_UNSIGNED", "2", "1", "FIRST", "FIRST") ----------- If I use: gp.MosaicToNewRaster_management("rastOne;rastTwo", workspace, outRaster, "", "8_BIT_UNSIGNED", "2", "1", "FIRST", "FIRST") I get: ERROR 000732: Input Rasters: Dataset rastOne;rastTwo does not exist or is not supported
... View more
06-11-2014
04:18 PM
|
0
|
3
|
569
|
POST
|
Hi, I tried defining the projection as unprojected WGS84. This results in an "inconsistent extent" warning. I've also tried Plate Carree under Projected Coordinate Systems > World (as well as under > Sphere-based). Can I manually go in and change the extents somehow if I use GCS WGS84? The OceanColor site that serves up this data provides a tool called SeaDAS that allows you to reproject the files - you simply select which projection you want. I tried this and selected Geographic Lat/Lon WGS84. The output lined up with a shapefile I had of the globe. But I need to batch process this for dozens of files and SeaDAS would require learning an entirely different programming language to batch process. So somehow this SeaDAS tool is able to read in and reproject it correctly, but I can't find any information on their forums on what the data is initially in - they just say to check the file metadata for this info which I listed above. It's like a catch-22! Thanks for any ideas..., DJ
... View more
05-21-2013
12:07 PM
|
0
|
0
|
488
|
POST
|
Hi, Was wondering if a solution came up for this. I think I have a similar problem... I've downloaded MODIS aqua chlorophyll and sea surface temperature from the ocean color website http://oceancolor.gsfc.nasa.gov/. These exist as hdf files and I used a program called FWTools to convert them to geotiffs. The metadata in the hdf file lists the projection as "Equidistant Cylindrical". However, it lists the bounds and units as degree units which is very perplexing. Melita, have you worked with this data set before? I can't seem to find a projection in Arc that works - all "Equidistant Cylindrical" projections are in units of meters. From the hdf metadata: :Map Projection = "Equidistant Cylindrical" ; :Latitude Units = "degrees North" ; :Longitude Units = "degrees East" ; :Northernmost Latitude = 90.f ; :Southernmost Latitude = -90.f ; :Westernmost Longitude = -180.f ; :Easternmost Longitude = 180.f ; :Latitude Step = 0.041666668f ; :Longitude Step = 0.041666668f ; :SW Point Latitude = -89.979164f ; :SW Point Longitude = -179.97917f ; Thanks, DJ
... View more
05-20-2013
03:09 PM
|
0
|
0
|
488
|
POST
|
I found this script that might help in your situation. http://forums.arcgis.com/threads/12581-get-rgb-values-with-vba-script This extracts to csv for layers in ArcMap, not layer files, but could point you in the right direction. I never figured out how to do this for raster layers. -Dennis
... View more
10-26-2011
06:14 PM
|
0
|
0
|
299
|
POST
|
Hi, A couple things to check. The Sample Tool produces an ArcInfo table which Windows usually does not list. Are you looking for the table using ArcCatalog? If you find the table you can convert it to a dbf using Table to dBase. Also make sure your extents are set correctly in your environment settings. Another way to do this is to use the Raster To Point conversion tool. This will create a point shapefile with a point at each grid cell center that has data associated with it. This shapefile will have a dbf table associated with it. You can then add new fields to the table and have Arc calculate the X and Y values for you.
... View more
04-25-2011
10:46 AM
|
0
|
0
|
428
|
POST
|
RegionGroup! There's a command I had not heard of before but looks like it does exactly what I need. Perfect, thank you. -Dennis
... View more
04-25-2011
10:23 AM
|
0
|
0
|
192
|
POST
|
Hi Bill, Maybe I'm misunderstanding. I did set the analysis environment to use the grid as a mask and then reclassified nodata to 1, but that converts both the holes and the area around the grid. Is there another environment setting I need to use? I'm doing this in the spatial analyst toolbar and tried setting the mask in both the environment settings and in the spatial analyst option settings. Or fine to tell me if I'm chasing an impossible dream! Thanks, Dennis
... View more
04-21-2011
09:24 AM
|
0
|
0
|
192
|
POST
|
Hi everyone, I have a complex raster which has nodata values within it. I want to be able to extract the areas of nodata within it but not the nodata values that surrounds the grid (all around the extent). The simplest example would be a donut. I want to pull out the donut hole (perhaps by converting it to ones) but leave the area outside the donut as nodata. If I do a simple reclassify of nodata, all the holes and the entire area around the grid gets converted. I don't have a raster mask I could use to pull out these nodata values. Anyway to do this in spatial analyst??? Thanks, Dennis
... View more
04-20-2011
03:25 PM
|
0
|
2
|
850
|
POST
|
Hmm. Thanks for the tip. However... I changed it to Public and that allowed me to access the macro and add it to my toolbar. But, it's acting funny now. I wonder if it has to do with the change from 9.2 to 9.3.1 (given that it worked before without a hitch)? When I have one or no grids loaded the macro seemingly works correctly (get a success message) but no image is created. It checks for layers so it's odd that it doesn't balk when there are no grids loaded. When I have two or more grids loaded it brings up an error "Invalid procedure call or argument". I've included the code from the .bas module I created within my normal.mxt modules folder. Got a chance to look it over for obvious errors? Thanks again for any help.
Public Sub ChangeTitle(txtTitle As String)
'Create variables for map
Dim pMxDoc As IMxDocument
Dim pActiveView As IActiveView
'Create variables for the graphics
Dim pGraphicsContainer As IGraphicsContainer
Dim pElement As IElement
Dim pTextElement As ITextElement
'Set the current map, layout, and graphics container
Set pMxDoc = ThisDocument
Set pActiveView = pMxDoc.ActiveView
Set pPageLayout = pMxDoc.PageLayout
Set pGraphicsContainer = pPageLayout
Dim pMSF As IMapSurroundFrame
Dim pMS As IMapSurround
'Reset the graphics container list to return the first graphic
'The text title is the first graphic on the page layout because it is at the top of the order
'If you change the order of the text title the following code will not work
pGraphicsContainer.Reset
Set pElement = pGraphicsContainer.Next
Set pTextElement = pElement
pTextElement.Text = txtTitle 'This actualy changes the title.
'Refresh all the map elements
pGraphicsContainer.Reset
Set pElement = pGraphicsContainer.Next
Do Until pElement Is Nothing
If TypeOf pElement Is IMapSurroundFrame Then
Set pMSF = pElement
Set pMS = pMSF.MapSurround
pMS.Refresh
pMxDoc.ActiveView.Refresh
End If
Set pElement = pGraphicsContainer.Next
Loop
End Sub
Public Sub ExportMap(strFileName As String)
'Create variables for map and extent
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pActiveView As IActiveView
Dim pEnv As IEnvelope
'Set the current map
Set pMxDoc = ThisDocument
Set pMap = pMxDoc.FocusMap
Set pActiveView = pMap
'Create export object and set the resolution
Dim pExport As IExport
Set pExport = New ExportPNG
pExport.Resolution = 450
'Set the export frame
Dim exportRECT As tagRECT
exportRECT = pMxDoc.ActiveView.ExportFrame
'Set the size and extent of the export
Dim pPixelBoundsEnv As IEnvelope
Set pPixelBoundsEnv = New Envelope
pPixelBoundsEnv.PutCoords exportRECT.Left, exportRECT.bottom, exportRECT.Right, exportRECT.Top
'pPixelBoundsEnv.PutCoords 0, 2477, 4050, 0
pExport.PixelBounds = pPixelBoundsEnv
'Create a cancel object
Dim pCancel As ITrackCancel
Set pCancel = New CancelTracker
'Set file name and export map
pExport.ExportFileName = strFileName
pMxDoc.ActivatedView.Output pExport.StartExporting, pExport.Resolution, exportRECT, Nothing, pCancel
pExport.FinishExporting
pExport.Cleanup
End Sub
Public Function FormatTitle(strTitle As String) As String
Dim strFirstLine As String
Dim strSecondLine As String
Dim lngLength As Long
Dim lngPosition As Long
lngLength = Len(strTitle)
lngPosition = InStr(strTitle, "Return Flow Plot")
strFirstLine = Left(strTitle, lngPosition - 1)
strSecondLine = Right(strTitle, lngLength - lngPosition + 1)
FormatTitle = strFirstLine & vbCrLf & strSecondLine
End Function
... View more
05-27-2010
04:44 PM
|
0
|
0
|
430
|
POST
|
Hi, I have some vba code (below) and a .bas file that I'm trying to add to add as an available macro tool. I've loaded the code into the normal.mxt ThisDocument page. I then loaded the .bas file into the modules folder as a new module. But when I go to Tools -> Customize -> Commands tab -> Macros the macro does not appear as a command option. Can anyone guide me here or point me to a helpful site. I had done this before successfully.... but have since gotten a new computer. The macros runs through rasters in a project and exports pngs for each one. Any help is appreciated. What am I doing wrong?! Thanks, DJ
Private Sub ExportRFPMaps_Click()
'MapTasks.ZoomToLayer
'Create variables for map and extent
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pActiveView As IActiveView
Dim pEnv As IEnvelope
Dim strTitle As String
'Set the current map
Set pMxDoc = ThisDocument
Set pMap = pMxDoc.FocusMap
Set pActiveView = pMap
'Loop through the RFP layers turning them on, setting the map title and exporting a .png
'Make sure all RFP layers are off when running the tool or one layer may show up in another's view
For i = 1 To pMap.LayerCount - 1
If pMap.Layer(i) Is Nothing Then Exit Sub 'Test that there is a layer
pActiveView.Extent = pMap.Layer(i).AreaOfInterest 'Set the extent to the layers extent
Set pEnv = pActiveView.Extent 'Set the envelope object equal to the current extent
pEnv.Expand 1.1, 1.1, True 'Expand the envelope by 10%
pActiveView.Extent = pEnv 'Set the extent equal to the expanded envelope
pMap.Layer(i).Visible = True 'Make current layer visible
strTitle = MapTasks.FormatTitle(pMap.Layer(i).Name) 'Format the title into two lines
Call MapTasks.ChangeTitle(strTitle) 'Assign the map title with the change title subc
Call MapTasks.ExportMap("Z:\Informatics\S031\analyses\RossSeaMPA\Modeling\images\eucl_dist\" & pMap.Layer(i).Name & ".png") 'Export map with export map sub
'Turn the layer off unless its the last layer
If i = pMap.LayerCount - 1 Then pMap.Layer(i).Visible = True Else pMap.Layer(i).Visible = False
Next
'Let user know when its done
MsgBox "Export Complete! Files exported to:" & vbCrLf & "Z:\Informatics\S031\analyses\RossSeaMPA\Modeling\images\eucl_dist", vbOKOnly
End Sub
... View more
05-26-2010
03:35 PM
|
0
|
2
|
2653
|
Online Status |
Offline
|
Date Last Visited |
06-30-2023
07:08 PM
|