Tag Info

New answers tagged

0

The following code uses the approach of calling a subprocess and piping the text to the clipboard. A couple of things to note: I use the onMouseUpMap event, this returns the XY coordinates in map units. I placed a comma between the numbers so there is no space between them. Wrapped the code up in a try-except to capture any failures. import arcpy import ...


0

Maybe, try again by exporting variable as mentioned at this other question. Yes, your virtualenv will be polluted following recipes in the above link answers but didn't find better...


1

Set the category attribute on your tool. class MyTool(object): def __init__(self): self.label = "This Particular Tool" self.description = "This tool" self.category = "This tool's grouping"


1

prior to running the search cursor, you could do something like flds=[] fldObj=arcpy.ListFields(yourfeatureclass) for fld in fldObj: flds.append(fld.name) #then loop through your list of variables that the search cursor is looking for: missingvar=[] for v in variables: if v not in flds: missingvar.append(v) #and print the missing variables ...


0

I've the same problem. I've two fields to concatenate, exluding empty values. The fields are: AREA_HI AREA_LO But arcgis return an error "000539 : Error message from Python." Some suggestions? Thank's. def concat_fields(!AREA_HI!, !AREA_LO!): if !AREA_HI!.strip() == "" or !AREA_LO!.strip() == "": return "" else: return !AREA_HI! + ...


2

No it is not possible to add "Folder Connections" using Arcpy. Folder Connections are stored in the ArcCatalog.gx file, which is typically located at c:\Users\*username*\AppData\Roaming\ESRI\*Desktopverion*\ArcCatalog\ArcCatalog.gx This is a binary file, so forget about editing it. The only thing you could possibly do is to create the Folder ...


2

I went with simply installing the manager pip-Win. It will install pip and virtualenv for you. Then it can identify your python installations (or you can browse to a specific python.exe to add more) and take care of all of your pip execution and package maintenance. https://sites.google.com/site/pydatalog/python/pip-for-windows Very important warning: ...


0

def changeValue(self,point,button): request = QgsFeatureRequest() self.dlg.lineEdit.setText(str(request)) self.dlg.show() Above function resulted to the string below in lineEdit Prashant


1

if rect is a Qgsrectangle centered in the point clicked on canvas, then the code is synthetically request = QgsFeatureRequest(rect) for feat in layer.getFeatures(request): <yout code> of the QgsFeature "feat"


0

The script will return an array of point objects for each part (returned by the GetPart method) for each record in the feature class. The number of points returned is not defined by any tolerance; the array will contain all the vertices that make up that polygon part. The only way to get more points would be to place them on the existing lines, which (if ...


0

I do not know how this will be done by script, but if you have a vector data and want it in a text file or in excel format then: Add layer in ArcMap Open attribute table Select all the features and from right click you select copy features and paste them in excel or word file.


0

The follow code should replace everything in your if block: if cLayer: for features in cLayer.getFeatures(): if feat.geometry().intersects(pntGeom): selectList.append(feat.id()) cLayer.setSelectedFeatures(selectList) The select method doesn't exist in any of the 2.0 version of QGIS. There is a select on the layer object ...


0

I think the problem is all in one line: lists=arcpy.arcpy.ListFeatureClasses(Wildcard,Feature_Type) should be: lists=arcpy.ListFeatureClasses(Wildcard,Feature_Type) or for quick testing try this first - just in case your variables are not being set properly yet lists=arcpy.ListFeatureClasses()



Top 50 recent answers are included