Tag Info

Hot answers tagged

13

If the length of the ID field values is always constant I would recommend using either Field Calculator or Calculate Fields tool with python slices. TOWN calculation: !ID![:8] ERF calculation !ID![8:16] PORTION calculation !ID![-5:]


4

There is a direct way in QGIS: In the main menu you have to click on 'Vector' [My QGis is in spanish, but look for something like that ;)] in that menu you go to 'Analysis Tools' and click on 'Basic Statics', another window will open and there are two combo boxes and a list box; in the first combo you have to choose the shape you want to use for calculation ...


4

You could access the specific feature, without a loop, using the setFilterFid() method. In your case, if you wanted to call the feature in row 222, you would do: aLayer = iface.activeLayer() request = QgsFeatureRequest().setFilterFid(222) feat = aLayer.getFeatures(request).next() print feat.attributes() To just get a specific attribute, you would use ...


3

You need to pass the returned value in a variable, not reference the column itself. Expression: result Codeblock: if [ColumnB] > 0 then result = [ColumnA] / [ColumnB] else result = 0 end if Here's how the two parts fit together in the field calculator - my data doesn't have the same field names, but you get the idea.


3

You have to convert the geometry as wkt and also you have to select Text, unlimited length (text) as Output field type, because the output wkt is not an integer:


3

Building on @artwork21's excellent answer, the following is how you would accomplish the task with Python using an UpdateCursor. import arcpy # The input feature class fc = r'C:\temp\myfgdb.gdb\yourFC' # Add three new fields arcpy.AddField_management(fc, "TOWN", "TEXT") arcpy.AddField_management(fc, "ERF", "TEXT") arcpy.AddField_management(fc, "PORTION", ...


2

You need to be in an edit session and have the Editor Attributes window open (Editor dropdown > More Editing Windows > Attributes). The simplest solution is: In the Attributes window, right-click the feature you want to copy from and click Copy Attributes. Right-click the feature you want to paste into and click Paste Attributes. This replaces all ...


1

You would need to use database triggers for that (which is supported only when storing data in a DBMS). If you are on file/personal geodatabase, you would need to run a Python script that would calculate the columns regularly (scheduled in Windows as a task, for instance). There is no way you could implement database triggers in a file geodatabase; there ...


1

Since you're already looping through data.rows, which contains the data, this looks more like a Bootstrap question. I've just done an example of html table from CartoDB SQL API data with plain JS: <script> var table = document.getElementById('mytable'); var sql = cartodb.SQL({ user: 'documentation' }); sql.execute("select adm0name, name ...


1

I have no problem loading the table as vector data using drag&drop, encoding is System (Windows 1252 latin 1). Headers are included, but no geometry information (i.e. coordinates). You can rightclick on the layer, Properties -> General tab to see what encoding is used, and change the encoding.


1

First, let it be known there are a number of ways someone could go about accomplishing roughly the same goal in this case. For me personally, especially for someone less experienced with arcpy, it would likely be simplest to do roughly the following workflow Convert the CSV file to Table in GDB Join the Table to Point Feature Class Make Feature Layer ...


1

Assuming you want to split any field with an underscore you can use ListFileds (which returns Field Objects) with a wildcard to get the fields to split then string.split("_") to break it up into parts then calculate with quotes to populate the string: import arcpy, os, sys InFolder = sys.argv[1] # folder for shapefiles, or database for feature classes ...


1

I have found a solution to my issue and I would like to share it. I managed to export attributes (up to two) in the "save as" window when saving a vector layer. More precisely, in the "data source options" section, I have: Set as "relativeToGround" the "Altitude Mode" Wrote name of attribute I would like to export in the "DescriptionField" field Wrote ...


1

The kml xml schema does not have a tag for labeling polygon features only placemarks = points. A workaround for doing this is to create a new point layer from polygon layer and in the Save vector layer as dialog define the labeling field in the NameField text box. Once you have both kml creted in GE, select File>Open to add both kml in. Alternatively, you ...



Only top voted, non community-wiki answers of a minimum length are eligible