POST
|
Hi, I can not find where is the legend item selector in arcgis pro where like in arcgis desktop. Any idea where that is and how to get there?
... View more
02-09-2021
09:22 PM
|
0
|
1
|
472
|
POST
|
Hi all, I am facing with a problem in my group that we are having lots and lots of shape files in the directories that unused shape files which used once and do not need anymore between geo-processes. It would be really helpful if there was a tool/python code where I could select a data/shape file, a directory/folder and the output would be a lits of data/shape files where not used or not connected to any .mxd. I wouldn't expect the tool to search the my desktop and only the folders/subfolders I am interested in. Any help would be much appreciated. Thank you
... View more
08-27-2018
01:33 PM
|
0
|
0
|
169
|
POST
|
Thank you so much. it worked like a charm. 5 star!!!
... View more
01-08-2018
01:22 PM
|
0
|
0
|
602
|
POST
|
Hi, I am able to add xy(lat-long) data using File>Add Data>Add XY Data from excel sheet or right click on the table and select display xy data option from table. I am trying to get the excel table with lat and long values then plot values into the arcmap. I need to use this tool in Model builder to automate the process for future use but its not available to use it in model builder. Can anyone help me to solve this process? Any help would be much appreciated. Thank you. Osi
... View more
01-08-2018
11:59 AM
|
0
|
2
|
732
|
POST
|
Hi Thai, Thank you too for your help. i tried to work around your code suggestion and run the code. it runs with no problem but returns nothing, no error and no clipped data at specified location. any idea? Thanks,
... View more
05-09-2013
11:10 AM
|
0
|
0
|
558
|
POST
|
Hey Mark, Thank you for your reply. I understand what you mean but i dont know how to implement that into my code. I am using Arc 10 right now. Can you please help me to solve this issue? Thank you
... View more
05-09-2013
08:40 AM
|
0
|
0
|
558
|
POST
|
Hi all, I am using below code to clip numbers of feature from Dan Patterson; #BatchClipFCs.py # #Author # Dan Patterson # Dept of Geography and Environmental Studies # Carleton University, Ottawa, Canada # Dan_Patterson@carleton.ca # #Purpose # Batch clips feature classes (eg shapefiles) in a project # and writes them to a folder. # Many batch clip examples exist, this is compiled for demonstration # purpose for a class # #Properties (right-click on the tool and specify the following) #General # Name BatchClipFCs # Label Batch Clip Feature Classes # Desc Batch clip feature classes (eg shapefiles) and saves # them to a folder. # #Source BatchClipFCs.py # #Parameter list # Parameter Properties # Display Name Data type Type Direction MultiValue # argv[1] Feature(s) to clip Feature Layer Required Input Yes # argv[2] Polygon clip layer Feature Layer Required Input No # argv[3] Append to output String Optional Input No # filename # argv[4] Output folder Folder Required Input No #-------------------------------------------------------------------- #Import the standard modules # Get a list of feature classes (shapefiles) # Get the clip feature class # Get the optional text to append to the filename output filename # Get the output folder # Usage: BatchClipFCs <Input_Features> <ClipWith> <optional_text> <Output_Workspace> # --------------------------------------------------------------------------- # # Import system modules, Create the Geoprocessor object and # Load required toolboxes... # import sys, string, os, win32com.client gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1") gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx") #gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") # # Script arguments... FCsToClip = gp.GetParameterAsText(0) #a list of features fcs = string.split(FCsToClip, ";") #split into a list # clipWith = sys.argv[2] #clip layer desc = gp.Describe(clipWith) clipWithType = desc.ShapeType # addToName = sys.argv[3] #optional text to append to output name if(addToName == "#"): addToName = "" # outputFolder = sys.argv[4] #a folder # gp.Addmessage("\n" + "Batch Clip Feature layers" + "\n" ) # if (clipWithType == "Polygon"): for fc in fcs: try: fc=fc.replace("'","") #check if a layers name has been changed desc = gp.Describe(fc) fcDataType = desc.DataType gp.AddMessage("Data type = " + fcDataType) if(fcDataType == "FeatureClass"): # Feature class on disk theName = str(os.path.split(fc)[1]) outFile = outputFolder + "\\" + theName + addToName + ".shp" else: # Feature layer FullName = desc.CatalogPath theName = (os.path.split(FullName)[1]).replace(".shp","") theName = str(fc).replace(" ","_") outFile = outputFolder + "\\" + theName + addToName + ".shp" gp.AddMessage("Output file from layer " + outFile) # gp.AddMessage("Clipping " + str(fcDataType) + ": " + fc + " Saving to: " + outFile + "\n") try: gp.Clip_analysis(fc, clipWith, outFile, "") except: gp.AddMessage("Could not clip " + fc + " with " + clipWith + " to " + outFile) except: gp.AddMessage("cannot describe" + fc) else: gp.AddMessage (clipWith + " is not a polygon layer, clipping terminated" ) # but every single time when I run this code got this message: "<type 'expestations.ImportError'>: No Module named win32com.client Failed to execute (Script) see attached file. Can you please help me to solve this problem? Thank you and much appreciated
... View more
05-09-2013
06:00 AM
|
0
|
5
|
2803
|
POST
|
Hi all again, Please help me about this problem. Help, help, help. Thank you all
... View more
03-08-2012
03:35 AM
|
0
|
0
|
352
|
POST
|
Hi again, I urgently need help. please help me about this. Thank you
... View more
03-05-2012
03:53 AM
|
0
|
0
|
352
|
POST
|
Hi, I am using below code from Python scripts in ArcGIS 10 for exporting rasters from Landsat imagery with L1G extension. Each imagery has 7 bands. I want to export each image in true RGB color. With below code, I created a tool in toolbox with this script but I couldn't get it work and made a search online, people were referring to change the extension from L1G to bsq. I made the change and it worked perfectly in Black and white color. Now, my problem is that i am stuck here that I can't export them as RGB color. Can anyone help me to modify this code little bit to export Landsat imagery with 7 bands in RGB color? or how can i pass the RGB color into exported raster images? Any help would be appreciated. Thank you all. Code: import ConversionUtils, time msgWorkspace=ConversionUtils.gp.GetIDMessage(86127) #"Output location does not exist: " msgSuccess= ConversionUtils.gp.GetIDMessage(86128) #"Successfully converted: " msgFail=ConversionUtils.gp.GetIDMessage(86129) #"Failed to convert: " msgConverting = ConversionUtils.gp.GetIDMessage(86130) #"Converting " # Argument 1 is the list of Rasters to be converted inRasters = ConversionUtils.gp.GetParameterAsText(0) # The list is split by semicolons ";" inRasters = ConversionUtils.SplitMultiInputs(inRasters) # The output workspace where the shapefiles are created outWorkspace = ConversionUtils.gp.GetParameterAsText(1) # Set the destination workspace parameter (which is the same value as the output workspace) # the purpose of this parameter is to allow connectivity in Model Builder. # ConversionUtils.gp.SetParameterAsText(2,outWorkspace) ext = ConversionUtils.gp.GetParameterAsText(2) # Get proper extension based on the format string if (ext == "IMAGINE Image"): ext = ".img" elif (ext == "TIFF"): ext = ".tif" elif (ext == "BMP"): ext = ".bmp" elif (ext == "PNG"): ext = ".png" elif (ext == "JPEG"): ext = ".jpg" elif (ext == "JP2000"): ext = ".jp2" elif (ext == "GIF"): ext = ".gif" elif (ext == "GRID"): ext = "" elif (ext == "BIL"): ext = ".bil" elif (ext == "BIP"): ext = ".bip" elif (ext == "BSQ"): ext = ".bsq" elif (ext == "ENVI DAT"): ext = ".dat" elif (ext == "HDF4"): ext = ".L1G" # Add progressor rastercnt = len(inRasters) ConversionUtils.gp.SetProgressor("step", msgConverting, 0, rastercnt, 1) currentloc = 1 # Loop through the list of input Rasters and convert/copy each to the output geodatabase or folder for raster in inRasters: try: ConversionUtils.gp.SetProgressorLabel(msgConverting + "%s (%d/%d)" % (raster, currentloc, rastercnt)) raster = ConversionUtils.ValidateInputRaster(raster) outRaster = ConversionUtils.GenerateRasterName(raster, outWorkspace, ext) # Copy/Convert the inRaster to the outRaster ConversionUtils.CopyRasters(raster, outRaster, "") # If the Copy/Convert was successfull add a message stating this ConversionUtils.gp.AddMessage(msgSuccess + "%s To %s" % (raster, outRaster)) currentloc += 1 except Exception, ErrorDesc: # Except block for the loop. If the tool fails to convert one of the Rasters, it will come into this block # and add warnings to the messages, then proceed to attempt to convert the next input Raster. msgWarning = msgFail + "%s" % input msgStr = ConversionUtils.gp.GetMessages(2) ConversionUtils.gp.AddWarning(ConversionUtils.ExceptionMessages(msgWarning, msgStr, ErrorDesc)) ConversionUtils.gp.SetProgressorPosition() time.sleep(0.5)
... View more
03-01-2012
06:36 AM
|
0
|
2
|
578
|
POST
|
Hi all, I am using below python code to convert rasters from one format to tiff, but this code converts one by one. Can anyone help me how to use it as batch tool? I need help really urgently. Thanks.. import arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create() try: # Set local variables InRaster = "C:\\\\L71010028_02820020717\L71010028_02820020717_HDF.L1G" OutWorkspace = "C:\\\\Image Test" # Process: RasterToOtherFormat_conversion (convert to TIFF format) gp.RasterToOtherFormat_conversion(InRaster,OutWorkspace,"TIFF") except: # Print error message if an error occurs print gp.GetMessages()
... View more
02-24-2012
12:05 PM
|
0
|
2
|
809
|
POST
|
Thank you Ken, I did mark it. I am really appreciated with your help a lot. Thank you again
... View more
02-15-2012
05:05 AM
|
0
|
0
|
173
|
POST
|
Thank you again Ken, I made some changes you mentioned and add some Public sub to setup the path to save the gif files and it works perfectly. Now, another thing is that how can I do the same thing for spatial image files? Any help? Thank you Private Sub ExportToGIF() Dim pActiveView As IActiveView Dim pRaster As IRaster Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument Dim pMap As IMap Set pMap = pMxDoc.FocusMap Set pActiveView = pMxDoc.activeView Dim pExtent As IEnvelope Set pExtent = pActiveView.extent Dim pEnumLayer As IEnumLayer Set pEnumLayer = pMap.Layers pEnumLayer.Reset Dim pLayer As ILayer Set pLayer = pEnumLayer.Next Do While Not (pLayer Is Nothing) pLayer.Visible = False Set pLayer = pEnumLayer.Next Loop pEnumLayer.Reset Set pLayer = pEnumLayer.Next Do While Not (pLayer Is Nothing) If TypeOf pLayer Is IFeatureLayer Then pLayer.Visible = True pActiveView.extent = pLayer.AreaOfInterest pActiveView.Refresh ExportLayout "GIF", "C:\Users\Desktop\" & pLayer.Name & ".gif", 175 'System.Windows.Forms.MessageBox.Show (pLayer.Name) pLayer.Visible = False End If Set pLayer = pEnumLayer.Next Loop pEnumLayer.Reset Set pLayer = pEnumLayer.Next Do While Not (pLayer Is Nothing) pLayer.Visible = True Set pLayer = pEnumLayer.Next Loop Set pExtent = pActiveView.extent '= pExtent pActiveView.Refresh End Sub Public Sub ExportLayout(Format As String, FileName As String, dpi As Integer) Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument Dim pLayout As IActiveView Set pLayout = pMxDoc.PageLayout Dim rectOut As tagRECT rectOut = pLayout.ExportFrame Dim pEnv As IEnvelope Set pEnv = New Envelope pEnv.PutCoords rectOut.Left, rectOut.Top, rectOut.Right, rectOut.bottom Dim pExporter As IExporter If Format = "GIF" Then Set pExporter = New JpegExporter Else Set pExporter = New PDFExporter End If pExporter.ExportFileName = FileName pExporter.PixelBounds = pEnv pExporter.Resolution = dpi 'Recalc the export frame to handle the increased number of pixels Set pEnv = pExporter.PixelBounds Dim xMin As Double, yMin As Double Dim xMax As Double, yMax As Double pEnv.QueryCoords xMin, yMin, xMax, yMax rectOut.Left = xMin rectOut.Top = yMin rectOut.Right = xMax rectOut.bottom = yMax 'Do the export Dim hDC As Long hDC = pExporter.StartExporting pLayout.Output hDC, dpi, rectOut, Nothing, Nothing pExporter.FinishExporting 'MsgBox "Export complete!", vbInformation End Sub
... View more
02-13-2012
06:45 AM
|
0
|
0
|
173
|
POST
|
Thank you Ken, I dont know how to integrate this into VBA but i will try it out.
... View more
02-10-2012
10:16 AM
|
0
|
0
|
357
|
POST
|
I am sending some images to clear things little bit. In image NTS Sheet, that is what I have as dataset in the data frame window, each of of them is a different shape file adjacent to each other. I want to go through table of content layers then zoom into first one and export it as jpg or gif while the adjacent nts sheets are turned off. The final product should look like 083H120_1, not like as in 083H120. I hope this helps to clear it out. Thank you
... View more
02-07-2012
09:29 AM
|
0
|
0
|
357
|
Online Status |
Offline
|
Date Last Visited |
02-09-2021
10:54 PM
|