Tag Info

New answers tagged

0

This might be a network firewall issue. If two machines are on the same network, with separate public IP address, and the proxy on one machine makes an outbound call to the second machine's public IP, the firewall may flag that as inappropriate traffic, and block it. Talk with the system administrator for the network and see if they make an exception to the ...


0

It may not be the cause but its good practise to check out the spatial extension and then check it back in at the end of your code. So after the line from arcpy.sa import * put arcpy.CheckOutExtension("Spatial") then at the end of your code use: arcpy.CheckInExtension("Spatial") If you look closely at the error message its trying to create an output ...


0

Ok I figured out the issue. The second parameter 'cellsize' needed to be called with the "arcpy.GetParameter" tool rather than the "arcpy.GetParameterAsText" tool as it is a numerical value rather than a string. It seems so obvious now! I have amended my question with the answer. Thank you all for helping me get there in the end.


0

Here is a basic explanation on this error - This occurs even though the data clearly does exist on disk. Cause Most often this is due to the input data path being entered incorrectly, as in the following situations: • Misspelled folder names • Using backslashes instead of forward slashes • Having spaces in the path names If the data clearly does exist, ...


1

Short answer - No, ArcGIS will always pass parameters as as positional arguments. Longer answer - Sort of, if you use a slightly hacky technique of accepting both positional arguments or options in your script, using the parse_known_args method. Something like: import argparse def main(arg1,arg2,arg3): print arg1,arg2,arg3 parser = ...


2

This look like there is a null geometry somewhere. To solve this, you should first run the "repair" tool. To avoid you code to crash (as you said that it works for the first polygons), you can add some testing if point: print ("{0}, {1}".format(point.X,point.Y)) else: print "No point"


0

try this: import arcpy from arcpy import env env.workspace = r"F:\Projects\ohad\derech_atankim\gis" for mxdname in arcpy.ListFiles("*.mxd"): print mxdname mxd = arcpy.mapping.MapDocument(r"F:\Projects\ohad\derech_atankim\gis\\" + mxdname) df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] for lyr in arcpy.mapping.ListLayers(mxd, "", ...


1

I can see 2 issues in you script: You're missing the second join_field parameter in arcpy.JoinField_management. Refer to the tool's page for the correct syntax: JoinField_management (in_data, in_field, join_table, join_field, {fields}) If you work with shapefiles and dbf tables, you should add the .shp or .dbf extension to your inputs. For example your ...


1

In order to carry out binary shapefile operations such as the one you intend to use on more than two files you can do the process in a step wise fashion using temporary files. import tempfile temp_path=tempfile.gettempdir() temp_basename="temp_shape" temp_file=str(os.path.join(temp_path,temp_basename+".shp")) It is important that you write and close any ...


0

After typing the following into the Python console: import processing processing.alghelp("qgis:joinbylocation") You get this: ALGORITHM: Join by location INPUT1 <ParameterVector> INPUT2 <ParameterVector> SUMMARY <ParameterSelection> STATS <ParameterString> GEOMETRY <ParameterSelection> KEEP <ParameterSelection> OUTPUT ...


1

Try setting arcpy.env.workspace to your working directory. e.g., import arcpy arcpy.env.workspace = 'c:/temp/testarcgis/frafil'


1

In AddField, provide the full path to JHJ or change your workspace (arcpy.env.workspace) to r"C:\temp\TestArcGis\FraFil" before AddField.


4

It works in the python window because JHJ is likely a layer in the map and therefore can be reference in your script as "JHJ". When run outside of Arcmap, you need to tell arcpy where to look. Here are just a few ways you can do this (untested, but it should give you a few ideas): 1) jhj = ...


0

A similar question on how to access other algorithms such as those from MMQGIS has been asked with an answer given: How to use the MMQGIS plugin through the Python console?


3

The attached (untested) script takes the name of a feature class, splits it by "_" and uses that as a basename for the join operations. The general idea is to use: basename = fc.split("_")[0] which converts, for example, abc_clip_diss to abc Then, you can use that basename to create new variables with os.path.join(): inFeatures = os.path.join(ws, ...


1

The definition query of the layer and zooming to is the easy part: import arcpy # Assuming that Value is set by the form, there is only one data frame # and the layer name is LayerName doc = arcpy.mapping.MapDocument("Current") dataFrame = arcpy.mapping.ListDataFrames(doc)[0] # the first data frame MapLayers = ...



Top 50 recent answers are included