arcgis-10.0,arcpy,arcgis-desktop,arcpy-mapping,geostatistical-analystRelated issues-Collection of common programming errors


  • l.s
    arcgis-10.0 spatial-analyst
    I am working with GWR to identify if there are any relationships between ‘extreme’ events and disease incidence. The use of GWR has been employed because I am working in a region where local differences occur for for selected variables. It is slightly different to trying to find all the variables that explain the incidence rates, rather I am looking at specific variables to see if they do impact or not.I am getting good results for the St. Residuals, local r2 and coefficient rasters, however I a

  • Simon
    arcgis-10.0 arcgis-server msd
    I have a new project in design where I need to publish a web service that will allow access for clients (like ArcGis Server Map Services).The only thing is, I have a big raster database (~300+ Rasters) and I need to allow users to turn each raster On/Off (like in a group layer). I experimented a little in ArcGIS 10 and stumbled upon the Group Layer which gives me a great solution to my problem:I created a Mosaic Dataset for each raster. I created a layer (*.lyr) for each Mosaic DS. I gathered t

  • Ligia
    arcgis-10.0 arcmap data loading
    I am an ArcGis 10. ( ArcEditor licence) user and I have a problem when trying to load data with the Load Objects Tool in ArcMap. I want to load a table, but after I choose the input data (equipment.dbf) – Add- and press next , ArcMap instantly shuts down and the well known window appears “ArcGis Desktop has encountered a serious application error and is unable to continue. One more thing, I am trying to load the table into a file geodatabase with a geometric network and relationship classes (bu

  • torik
    arcgis-10.0 raster arcpy reclassify land-classification
    Consider the NLCD2001 Land Cover dataset for Alaska (download link). I need to reclassify this dataset so that only pixels of value 41, 42, and 43 are preserved; all other pixel values should become NoData (or 0, if necessary).This seems like a simple task, only requiring one call to the Reclassify tool. Unfortunately, every call results in a vague and unhelpful error message:Executing: Reclassify “D:\ak_nlcd_2001_land_cover_3-13-08_se5.img” Value “0 40 0;41 41;42 42;43 43;44 255 0;NODATA 0” “D:

  • Radar
    arcgis-10.0 arcobjects vb.net
    I have a floating point raster and have applied a conditional to it in order to only extract the positive values, so there are ‘no data’ “holes” in the raster. I simply need to sum the values from this raster and output it as a number.I came across this thread, which I’m sure some of you will recognize. Has anyone developed a working solution? I’m working in Arc10 and making use of ArcObjects if necessary.EDIT: I’ve included a VB.NET version of @Kirk’s C# code. It’s provided as is, but it should

  • Julie
    arcgis-10.0 raster-calculator
    I have a raster with values ranging from 0 to 8991130624. This raster is actually the result of a cost distance analysis. I want to scale the raster to range from 0 to 1 and take the inverse? so that a cell with the highest cost/value (e.g. 8991130624) will now have a value of 0 while a cell with the lowest cost/value (e.g. 0) will now have a value of 1.I am using raster calculator with the following expression:1-(x/8991130624)where I add x to the expression by clicking on the raster from the li

  • Hanaa
    arcgis-10.0 gdal google-maps georeferencing
    This question already has an answer here:GeoReference tiff image into the Google map?1 answerI have a tiff image and have the required information to Geo-reference it on the MAP. which called world file like this.using GMAP.NEt API there are many limited functions not like the java script google map API 3. So any hope to bind C# windows application and javascript map API ?on other hand, from the ArcGIS link I can know the (X,Y) for each pixel from the image located at the MAP. BUT how to do that

  • Emi
    arcgis-10.0 raster
    I am new to raster data and my background is software engineering so this might be a trivial question for GIS specialists. Some raster files have attribute table but some do not. On those with attribute tables, I can add a field in that table using Add Field (Data Management) tool but I cannot see the field in the attribute table. In fact, when I identify any pixel by Identify tool, it does not show the field name so I am wondering where the field is gone? EDIT : I have tried to do Build Raster

  • PolyGeo
    arcgis-10.0 arcgis-desktop geoprocessing error
    I’m new with Arc 10, and I’m struggling alot. When using Geoprocessing I’m getting the same error or message again and again. “ERROR 999998: Unexpected Error”I have checked all the settings I can think off. Any help or recommendation will be greatly appreciated.

  • TrueLifeCoder
    arcgis-10.0 geoprocessing arcgis-flex-api features feature-extraction
    I am extending existing query functionality that I have added to the ArcGIS Flex Viewer. I would like to extract the results from a query–which consists of a FeatureSet–into a .gdb. In order to do so, on the Flex side (not on the arcgis server), I package the FeatureSet which contains various fields such as DEPTH, NAME, OBJECTID, Shape_Area, Shape_Length, SQKM, SQMI, and SURF_ELEV into an object and send that object in the gp.submitJob(..) method.However, when I debug in the python script, a

  • Adam Thom
    arcgis-desktop arcpy arcgis-10.2 arcpy-mapping pyscripter
    I appear to be having difficulty with using ‘replaceDataSource’. ESRI has atrocious documentation on updating and fixing data sources, and almost everything I have read on the subject is almost what I am looking for, but not quite. What I am looking for is a way to repair multiple map documents without having to specify the name of each layer that has a broken data source. The code I have written so far should loop through the map documents in a directory, find which layers have a broken data so

  • PolyGeo
    python arcpy
    I am using arcGIS 10.0 SP5I have the following code :import arcpyarcpy.ImportToolbox(r”C:\Documents and Settings\Derek\FRAME\FORTEST.tbx”, “Derek”)arcpy.TEST_Derek()The model is names TEST The toolbox alias is Derek When I try and run this I get an error AttributeError: ‘module’ object has no attribute ‘TEST_Derek”What I want to do is to run the model TEST from the toolbox FORTEST

  • Paul
    raster arcpy arcgis-10.2 mxd workspace
    Situation:I am working on creating a Python script that will replace workspace paths for every layer in a map document in order to fix broken layers after a data migration. The script works except for when run on MXDs that have a raster dataset in them. I have isolated the problem to the code below. Specifically the .findAndReplaceWorkspacePath() method seems to be failing when attempting to perform the operation on the raster layer. Code:fullPathToNewWorkspace = r”C:\GIS\New\Data” # for con

  • PolyGeo
    arcgis-desktop arcpy arcgis-10.1
    I’m trying to calculate a field (Unique_ID) in arcpy that will bring in a six digit number from another field (Point_ID) in the table. I want to add the state plane code to the end of the Point_ID and have it calculate in the Unique_ID code. I tried copying it from a python snipped to get what I want and this is what it gave me.arcpy.CalculateField_management(“SMON”,”Unique_ID”,”!PointID!”,”PYTHON”,””)I also have a string of all the state plane codes. I need to get the end of the state plane c

  • EmdyP
    arcgis python arcpy scripting
    I cobbled this code together from ESRI documentation and stackexchange answers. I tried to use SearchCursor(points, fields=fieldname) but I get this error:TypeError: SearchCursor() got an unexpected keyword argument ‘fields’I’m not sure why this doesn’t work.# Local variables:points = arcpy.MakeFeatureLayer_management(“C:\\alltogether.shp”)homebase_shp = arcpy.MakeFeatureLayer_management(“C:\\homebase.shp”)fieldname = “Device”Device = arcpy.AddFieldDelimiters(points, fieldname)delimitedfield

  • GeorgeC
    python arcpy field-calculator
    What am I doing wrong in this field calculator logic?Pre-logicdef re_score(elev_t,f2, contour):f2=contourif elev_t.endswith(‘.5’):f2 = “Midi”return f2Expression for field “Contourtyp”re_score(!Elev_t!,f2,!Contourtyp!)I just want to rename the contour type where the contours are at half meter intervals. The ‘Elev_T’ is a text column with all the elevations (converted to text as I couldn’t think of a way to do it with numerical elevation data which has .25, .5, 75 and 1m intervals). I want all .5

  • torik
    arcgis-10.0 raster arcpy reclassify land-classification
    Consider the NLCD2001 Land Cover dataset for Alaska (download link). I need to reclassify this dataset so that only pixels of value 41, 42, and 43 are preserved; all other pixel values should become NoData (or 0, if necessary).This seems like a simple task, only requiring one call to the Reclassify tool. Unfortunately, every call results in a vague and unhelpful error message:Executing: Reclassify “D:\ak_nlcd_2001_land_cover_3-13-08_se5.img” Value “0 40 0;41 41;42 42;43 43;44 255 0;NODATA 0” “D:

  • user9518
    arcpy arcgis-10.1 ascii
    I have a very simple script that I’m testing. It has always been working so far, but now I’m running in an unexpected error. When I try to save my files in a folder different than the environment one, it outputs this error:outSnowmask.save (newpath_01+ ‘\\’+ ‘snow_’+ MODIS) UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe0 in position 47: ordinal not in range(128)My code is:import arcpy, os, sys, shutilnewpath_01= r’C:\\Users\\unimi\\Documents\\Umberto\\Università\\PhD\\Karakoram\\MODIS_P

  • blah238
    python arcpy arcgis-10.1 mxd
    The following script is supposed to find and replace all shapefiles in a mxd (that exist in the folder) to the new SDE data source. No errors when running the script however, when I open the MXD in ArcGIS 10.1SP1 nothing changed. Any suggestions what is wrong?import arcpy, os, glob#find all the MXD’s in the directory tree for root, subFolders, files in os.walk(r”C:\Users\lmuhammad\Documents\ArcGIS\SearchandReplace\Testing”): for filename in files:fullpath = os.path.join(root, filename)basename,

  • Mapperz
    arcpy shapefile arcgis-desktop loop
    I am trying to upgrade a simple script to list all shapefiles in a folder and if necessary in any folders within and then loop through the list of shapefiles and rename them. import arcpy# Set work environment arcpy.env.workspace = “C:\\Users\\Rachael\\Documents\\Export”# List shapefiles in folders shp = arcpy.ListDatasets()try:for shp in arcpy.ListDatasets():if arcpy.Exists(“Histori2.shp”):arcpy.Rename_management(“Histori2.shp”, “H_BEV_CANS.shp”)

  • Adam Thom
    arcgis-desktop arcpy arcgis-10.2 arcpy-mapping pyscripter
    I appear to be having difficulty with using ‘replaceDataSource’. ESRI has atrocious documentation on updating and fixing data sources, and almost everything I have read on the subject is almost what I am looking for, but not quite. What I am looking for is a way to repair multiple map documents without having to specify the name of each layer that has a broken data source. The code I have written so far should loop through the map documents in a directory, find which layers have a broken data so

  • PolyGeo
    arcgis-desktop arcpy arcgis-10.1
    I’m trying to calculate a field (Unique_ID) in arcpy that will bring in a six digit number from another field (Point_ID) in the table. I want to add the state plane code to the end of the Point_ID and have it calculate in the Unique_ID code. I tried copying it from a python snipped to get what I want and this is what it gave me.arcpy.CalculateField_management(“SMON”,”Unique_ID”,”!PointID!”,”PYTHON”,””)I also have a string of all the state plane codes. I need to get the end of the state plane c

  • PolyGeo
    arcgis-desktop polygon
    I want to split a worldwide ‘road dataset’ into multiple grids/blocks-extents, depending on the amount of features resides in that block-extent. If the amount of features(inside that block) is still above the count of features I want, then it must split the first block into too pieces and so on…, until it has the right amount of features inside that block-extent before I can use an function like PolygonToRater and after that the mosaic function.I came up with this route/possible solution, beca

  • Mapperz
    arcpy shapefile arcgis-desktop loop
    I am trying to upgrade a simple script to list all shapefiles in a folder and if necessary in any folders within and then loop through the list of shapefiles and rename them. import arcpy# Set work environment arcpy.env.workspace = “C:\\Users\\Rachael\\Documents\\Export”# List shapefiles in folders shp = arcpy.ListDatasets()try:for shp in arcpy.ListDatasets():if arcpy.Exists(“Histori2.shp”):arcpy.Rename_management(“Histori2.shp”, “H_BEV_CANS.shp”)

  • PolyGeo
    arcpy arcgis-10.1 geoprocessing arcgis-desktop
    I have a problem with Split Line At Point and polygons which have been dissolved using arcpy.Dissolve_management.When I try this model to get polygon contour split at some points.arcpy.FeatureToLine_management(“parcel” , “lim_parcel”) arcpy.Dissolve_management(“lim_parcel”, “lim_parcel_solv”, “” , “”, “SINGLE_PART”, “DISSOLVE_LINES”) arcpy.SplitLineAtPoint_management(“lim_parcel_solv”, “point_parcel”, “lim_parcel_solv_split” , “1” )I always get a line split at one location where there is no poin

  • PolyGeo
    arcgis-desktop sql-server
    I’ve coupled ESRI’s ArcGIS with SQL Server 2008 R2 in an attempt to allow users to search for geographical points using a polygon (with ArcGIS’ drawing toolbar). I’ve run up against an issue that’s not making any sense to me. It seems easiest to illustrate it visually:I draw a rectangle along the top of the northern hemisphere and get results I wouldn’t expect (I know there are more points up there): I draw a smaller square within that rectangle and get the results I was expecting: Can anyone

  • PolyGeo
    arcgis-10.0 arcgis-desktop geoprocessing error
    I’m new with Arc 10, and I’m struggling alot. When using Geoprocessing I’m getting the same error or message again and again. “ERROR 999998: Unexpected Error”I have checked all the settings I can think off. Any help or recommendation will be greatly appreciated.

  • ConeGIS
    arcgis-desktop arcpy gdal ogr
    When I run my script outside ArcGIS it works because during execution script uses a GDAL and OGR modules from osgeo. When I use script as a tool in ArcGIS it does not work. In PySripter I can import all modules and it work. In Python Window in ArcGIS I cannot import because I get this error:Parsing error SyntaxError: invalid syntax (line 2) import ogrRuntime error Traceback (most recent call last):File “”, line 1, in File “C:\Python27\ArcGIS10.1\lib\site-packages\osgeo\ogr.py”, line 26, in _ogr

  • PolyGeo
    arcgis-10.0 python arcgis-desktop network-analyst route
    Good Day,I’m having trouble debugging my python code to create a network analyst layer in ArcGIS 10.0. Basically when run from a script tool the code completes successfully without actually doing anything or returning any sort of useful information, and when run from the embedded python window in ArcGIS 10.0 i get the following error.”Runtime error : Failed to execute. Parameters are not valid. ERROR 000192: Invalid value for Time Attribute Failed to execute (MakeVehicleRoutingProblemLayer).”The

  • PolyGeo
    arcpy arcgis-desktop arcinfo-workstation coverages
    I’m using ArcGIS Advanced in order to generate a coverage (I’ve never worked with coverages before –nor ArcGIS really, know the basics, but not this). I am trying to write a python script to generate a coverage, but I keep get the same error.The purpose of generating this coverage is to compare the results of a coverage (ArcInfo) (with its various xy tolerances) with the results of creating a feature class (ArcGIS) and see if they differ.Basically I’m not sure how to access the generate tool (a

  • Adam Thom
    arcgis-desktop arcpy arcgis-10.2 arcpy-mapping pyscripter
    I appear to be having difficulty with using ‘replaceDataSource’. ESRI has atrocious documentation on updating and fixing data sources, and almost everything I have read on the subject is almost what I am looking for, but not quite. What I am looking for is a way to repair multiple map documents without having to specify the name of each layer that has a broken data source. The code I have written so far should loop through the map documents in a directory, find which layers have a broken data so

  • PolyGeo
    arcgis-10.0 arcpy arcgis-desktop arcpy-mapping geostatistical-analyst
    I’m quite new in using python in Arcgis 10. I wanted to use the symbology of a geostatistical layer in the TOC in another geostatistical layer in the TOC. Therefore, one should use arcpy.mapping.updatelayer. I saved the geostatistical layer as Layer file (TensorStyle.lyr). The code to copy the symbology looks likeimport arcpymxd = arcpy.mapping.MapDocument(“CURRENT”)df = arcpy.mapping.ListDataFrames(mxd)[0]updateLayer = arcpy.mapping.ListLayers(mxd, “*”, df)sourceLayer = arcpy.mapping.Layer(“Ten

  • om_henners
    python export jpg arcpy-mapping
    I’m attempting to writing a python script that will automate exporting a set of stock maps to JPEG from their mxd files, and I’m having some strange issues getting there.I’ve alternatively been getting a Visual C++ Runtime error saying python experienced an abnormal program termination, or the program throws an exception saying “AttributeError: PageLayoutObject: Error in executing ExportToJPEG”I’ve tried two main ways of running this process. In one I loop through an array of directories and pul

  • Jürgen Zornig
    arcgis-10.1 arcpy-mapping
    After 11 years our work group filesystem holds a lot of old arcmap project mxds and layer files. Also our geodatasources need some reorganization. So I wanted to create a script which iterates through the whole directory tree (with os.walk()),opening every mxd and lyr file, iterating through the TOC and persisting datasource information in an external table for review. Should be easy with arcpy.mapping ………I thought.The script is very straightforward, but I am facing strange error behaviour

  • PolyGeo
    arcgis-10.0 arcpy arcgis-desktop arcpy-mapping geostatistical-analyst
    I’m quite new in using python in Arcgis 10. I wanted to use the symbology of a geostatistical layer in the TOC in another geostatistical layer in the TOC. Therefore, one should use arcpy.mapping.updatelayer. I saved the geostatistical layer as Layer file (TensorStyle.lyr). The code to copy the symbology looks likeimport arcpymxd = arcpy.mapping.MapDocument(“CURRENT”)df = arcpy.mapping.ListDataFrames(mxd)[0]updateLayer = arcpy.mapping.ListLayers(mxd, “*”, df)sourceLayer = arcpy.mapping.Layer(“Ten

Web site is in building