Tag Info

New answers tagged

1

1.Which line returns the error? Maybe you should check if the layer can be converted to a feature layer and clipped using if layer.isFeatureLayer: 2.Besides this, your script will overwrite clipped_fc at every iteration. Change the name to something like clipped_fc = env.scratchFolder + os.sep + layer.name + "_clipped.shp". Check that the layers' name is ...


2

From Geoalchemy docs: Requires SQLAlchemy > 0.6. Supported on Python 2.5 and Python 2.6. Should also work with Python 2.4 but has not been tested. No mention of Python 2.7, maybe this is your problem (I suppose you're using Python 2.7 because of the tag python27). Or it could be sqlalchemy version (too high, too low, don't know which you're using). ...


0

THis post got me started to create a needed XML-file with Python: http://stackoverflow.com/questions/3605680/creating-a-simple-xml-file-using-python in my case, this code: ############################## #Create the necessary XML file ############################## root = ET.Element("OGRVRTDataSource") OGRVRTLayer = ET.SubElement(root, "OGRVRTLayer") ...


0

The other way to get FME to use a different interpreter is under Tools > Options > Runtime in the Workbench menu:


0

These settings configuration fixed the issue: fme.exe APPLY_SETTINGS SYSTEM "Python/Use Custom Python" true fme.exe APPLY_SETTINGS SYSTEM "Python/Python Interpreter" c:/windows/SysWOW64/python27.dll I just had to restart the server after i applied the changes. This will just force FME to use ArcGIS' Phyton Interpreter which carries the arcgisscripting.


3

As @PolyGeo states un- and re-installing ArcGIS (and Python) is the solution, but you should do a COMPLETE uninstall of the software before reinstalling it. To do so follow these steps: Uninstall any third-party extension for ArcGIS (like ET Geowizard or Xtools) via Add/Remove Program Uninstall all ArcGIS/Esri programs via Add/Remove Program Uninstall all ...


1

I find problems with symptoms similar to these are usually (almost invariably) resolved by an uninstall of ArcGIS for Desktop (and all Python versions) and then re-installing ArcGIS for Desktop (with its supported Python install). However, it sounds like you have already done this. Consequently, I recommend that you report this issue to your local Esri ...


3

Building on what you've got already: import arcpy # Define the feature class fc = r'C:\path\to\your\fc' # find the unique 'SEGMENT_LENGTH' values Slist = list() for row in arcpy.da.SearchCursor(fc, 'SEGMENT_LENGTH'): # if the value isn't in the list then add it to the list if not row[0] in Slist: Slist.append(row[0]) for Value in Slist: ...


1

The problem must come from the Python PATH. To find out: Create a python and copy it into the directory pyshp-master (the one that contains shapefile.py) file. Try again to import your shapefile with python. NB : I test the import it works perfectly. I download pyshp from https://github.com/GeospatialPython/pyshp


0

I think you can compile the library against python27 by yourself. Here is a description about compilation and installation. If you are also comfortable with python25 or python26, there are downloadable installer available for python25/26 here. I've tested the python26 installer and it works fine for me.


1

dct.keys() will return a list of all the keys in the dictionary. When you do dct.keys()==2100, you are asking it if some list is equal to some integer - which will never evaluate to true. You won't get an error because it just evaluates to False each time and keeps checking further down the line. Try something like: for key in dct.keys(): if ...



Top 50 recent answers are included