0
votes
0answers
32 views

how to create a shapefile containing attributes from a list?

I have a list of features and each feature is a dict in that list. following you can see the structure: [ {"FID": 0, "Shape": polyline, "Nodes": [0,1]}, {"FID": 1, "Shape": polyline, "Nodes": ...
0
votes
0answers
39 views

Problem reducing the width of the attributes fields of a shapefile using python

I have a shapefile with rather long attribute widths (which is resulting in a rather large file). I am trying to trim it in python, here is my code: layer = qgis.utils.iface.activeLayer() ...
0
votes
1answer
69 views

Select by attributes within the fiona Python module

Is it possible to select polygons from a shapefile based upon their attributes using the Fiona Python module? I can't seem to find anything in the docs, but it seems like a strange thing not to be ...
1
vote
1answer
123 views

Adding attribute list to combobox in a python plugin

I am developing a simple plugin at the moment which contains 3 combo boxes: comboBox_1 comboBox_2 comboBox_3 Combobox 1 & 2 lists the vector layers available, however I would like the 3rd ...
0
votes
1answer
62 views

Programmatically modify attributes for vector layer in QGIS

I am trying to programmatically modify attributes for a vector layer, using calculated values currently stocked in a dictionary. Any pointers on where i'm going wrong? my dictionary has the feature ...
0
votes
1answer
85 views

Split an attribute Python 9.3 in modelbuilder expression? [closed]

Updated question Goal: I need to upgrade an existing Model-builder were the expressions uses Python 9.3. Workproces & Goal: My *.mxd Have 1 attribute field containing the following build: ...
5
votes
1answer
92 views

How can I get the field index of the new layer in my script using Python?

I am trying to use layer.changeAttributeValue(fid, fieldIndex, value) to add values to a field in QGIS Basically, I'm creating a plugin which will, if a checkbox is ticked, create a new field, then ...
0
votes
1answer
37 views

How to Add Field Between Two Existing Field in Shapefile

Can you please let me know if it is possible to add a new Field between two existing field using ArcPy? For Example if I have "Name", "Area", fiels already in my shapefile can I add a new field called ...
2
votes
1answer
257 views

Automatic calculation in one attribute table based on values in another attribute table using python

I am trying to fill the fields of one gdb table based on some statistics over the attributes of another shape file. As it was not possible in ARCgis directly, I am trying to use python coe for this ...
1
vote
1answer
113 views

selection by attributes with python

I have a problem concerning the selection by attribute with python on arcmap. I use this code: import arcpy from arcpy import env arcpy.env.workspace= "E:\cities" Mi=(r"E:\cities\rivers.shp") rows = ...
1
vote
1answer
207 views

Connect not working for custom QGIS form

So I have a custom form for editting feature attributes. However, I can't seem to correctly disconnect and reconnect certain bindings. The init code is below and should work for any simple QT widget ...
5
votes
1answer
360 views

How to programmatically associate a layer with a custom UI?

I know it is possible to associate a layer with a custom UI for editing feature attributes using the QGIS interface. But is this possible with Python? This link shows how to achieve the result ...
1
vote
1answer
75 views

Stop custom attribute form from resizing in Qgis

When I open a custom attribute form for a feature in Qgis it always gets resized to the default size of the original Qgis attribute form. I've tried to set the sizePolicy in QT Designer to Fixed ...
0
votes
1answer
91 views

Custom forms and location of python code

I'm working with custom forms for the attribute table of various qgis-object and it works realy well, but I would like to have my forms and their python files separated from the projects. This is not ...
0
votes
1answer
334 views

python script in modelbuilder: get field value and return boolean expressions

I have problems integrating a python script in a modelbuilder tool. I'm a absolute beginner with python. Maybe there's also an easier way to solve this problem in modelbuilder without using a python ...
0
votes
0answers
469 views

Problem reading attribute with Python using osgeo.ogr

I am working thru "Python Geospatial Programming" and I have a problem in a program in Chapter 6 that I cannot seem to solve. The small program: import osgeo.ogr shapefile = ...
3
votes
2answers
207 views

How to create a label formatted like “ 1,000' ” from a numeric field?

This question builds on a previous question I came across at gis.stackexchange: How to easily edit attribute data using Regular Expressions? Perhaps someone can point me in the right direction? I ...
3
votes
1answer
2k views

Reassigning raster cell values from another attribute in raster attribute table?

I have a large (size of lower 48 U.S.) 100m resolution raster dataset that has a raster attribute table (RAT). The data were created by someone else. One of the attributes in the RAT has the data ...
5
votes
2answers
598 views

Importing attributes from Excel file into new Polygons

I have a constantly updated Excel file containing address information which I am currently copying into the attributes of new polygons which I am creating on a daily basis. I am currently doing this ...
2
votes
1answer
351 views

How to write XML attributes from feature with ArcView license?

I need to generate xml of attribute data of a feature, but I have only Arcview license so, I can't use Export XML tool. What are my options? What is wrong with this code (after applying search ...
3
votes
1answer
588 views

Changing attribute data types using PyQGIS

OK, so I've already asked a question how to access attribute data types when developing plugin for QGIS, using PyQGIS. And one helpful member said i should use pendingFields() method on the current ...
2
votes
2answers
2k views

How to access attribute data type in QGIS?

I've been developing a plugin on QGIS platform using PyQGIS. So far plugin does the following: You can select any feature of the already loaded vector layer in QGIS. After selection, plugin displays ...
10
votes
2answers
907 views

How to compute a new attribute based on changes in another attribute?

I am attempting to classify a set of gps time-encoded point data into behaviors based on different attributes. I have created an attribute that is 0 for home and 1 for away based on location, and now ...