In GIS, Fields, also known as attributes, contain information about features.

learn more… | top users | synonyms

12
votes
2answers
506 views

How to sort by multiple fields at the same time?

Is it possible to sort multiple fields at the same time in QGIS? For example, I'd like to sort a table by state name, and then within each state, sort by county name. This would be the same as the ...
9
votes
4answers
23k views

How to Change Field Name in ArcGIS 10.2

Can someone please let me know how I can change the field names (not the alias) in ArcGIS 10.2. I already found this page on ArcGIS support: "Renaming shapefile fields (Defense Mapping)" but there is ...
9
votes
2answers
6k views

Maximimum length of text fields in shapefile and geodatabase formats?

The maximum text string for a field in a geodatabase is 320 characters. The data I am importing has long character strings and it seems to be truncating when I convert into shapefile at the max ...
8
votes
5answers
487 views

Print out the properties of the attribute table in qgis?

I have to merge a lot of shapefiles into one great shapefile. So I want to compare the properties of the attribute tables to see if there are differences between the tableproperties of each shape ...
8
votes
1answer
403 views

Is there a best practice for the length of fields?

At my work have inherited several shapefiles that originate from MapInfo that I am bringing into a new project in QGIS. I have the opportunity to change the column names, add and subtract columns and ...
8
votes
2answers
2k views

How to specify fields to export from QGIS?

I'm using QGIS 2.0.1 and am connected to a MS SQL Server spatially enabled database (not ESRI). I am able to connect to the layer and load it into my TOC just fine. I have hidden a number of fields ...
7
votes
1answer
118 views

Setting a default value in a QGIS field

I would like to add in a layer's field a default value. I mean, every time a new feature is created, that field would be automatically filled with the default value. In my case the default value ...
7
votes
1answer
134 views

Filling fields with conditional clauses

I have four fields in my shapefile. I would like to fill only one of them (cell of attribute table) and automatically after to write one cell the others one will be filled by conditional clause. I ...
7
votes
2answers
186 views

Clean up attributes

I want to clean up the attribute table of a road shapefile for all the entries in the fields. For example: As seen below I have a road feature with a "Name", Name From and Name To in the attribute ...
6
votes
1answer
400 views

How can I exclude a field on a table from being copied?

I have a query "layer": >>> r = arcpy.MakeQueryLayer_management(r'C:\path\to\connection\file\connection.sde', 'TEST', 'SELECT T.ID AS OBJECTID, T.* FROM MY_TABLE T WHERE T.SOME_COLUMN = 1', ...
5
votes
2answers
563 views

Split one field into 3 fields?

I need to split the values in a field according to what they represent to be able to do a join on the data. As seen above I have a ID field that needs to be split into the following: The ID consist ...
5
votes
1answer
2k views

How to check if feature class or table contains field with specific name before adding it?

Im trying to write a script that finds out if the shapefile has a specific field and if not to add the field. I get it to show me the field, but the loop goes through each field, so it would create a ...
5
votes
3answers
281 views

How to find and replace attribute values based on a list

I have a Shapefile and a list in .csv which contains two columns with names: "Old_name" which contains the old names that already exist in the attribute table of the previously mentioned Shapefile; ...
5
votes
1answer
1k views

How to change the field value of a Shapefile using GDAL/OGR?

I am trying to change the field value of a shapefile. However it doesn't change the value. What's wrong with my code? import ogr driver = ogr.GetDriverByName('ESRI Shapefile') fn = 'dist.shp' ...
5
votes
1answer
201 views

How do I extract partial data from one field to another?

Answer Below I am attempting to extract a date stamp that is contained in one field and insert it into another field. The issue is that the date (in bold below) is not in the same location in each ...
5
votes
1answer
67 views

Troubles Updating Values of Selected Features with PyQGIS

I'm trying to modify the values of some selected features. I have written this small script, but nothing happens when I run it. Is there something that I've missed? Here is my code. lyr = ...
5
votes
1answer
72 views

How to delete fields from a Geopackage attribute table?

Using QGIS 2.14.0 on a Microsoft Surface Book with Windows 10, I created a geopackage from a layer using Save As... I can successfully add a field to the geopackage's attribute table, calculate ...
4
votes
5answers
9k views

Renaming field using ArcPy?

What I need to do: rename a field name of a table/feature class copy all values to the new field So far I have done following code as @artwork21 suggests: import sys import traceback import arcpy ...
4
votes
2answers
1k views

Choosing Shapefile attribute data type to use?

I am trying to figure out when to use (in the Data Type of SHAPEFILE PROPERTIES) - TEXT - SHORT-INTEG - LONG-INTEG - FLOAT AND DOUBLE. I am using ArcView 9.3 and I know when it is all text or use ...
4
votes
2answers
3k views

How to retain Field Name / Alias on Export of Table?

Is there a way I can modify the Field Name or to make him keep the Alias when a table is exported? Or is there a way to keep the Alias instead of the Field Name, when exporting for example to .dbf ? ...
4
votes
2answers
122 views

How can I delete multiple field attribute values from an attribute table?

I have a Centerlines feature class to which I transferred attributes from an AddressPoints feature class, and now each centerline has the correct street name but also a street number which I don't ...
4
votes
1answer
3k views

How to List field name aliases in one shapefile/layer using ArcPy?

I want to use arcpy/python to print out a list of all the field name aliases for a specified shapefile. So far I have been able to hack a script I found to list all the field name aliases associated ...
4
votes
1answer
338 views

Replacing multiples words using field calculator in attribute table python

I need to replace multiple words with one word in a field at one time in one script. Example in my LettersField I need to replace all the "Aa" and all the "Bb" and all the "Cc" with "Rr". I am ...
4
votes
1answer
74 views

Rename field QgsField is not valid

In pyQGIS i tried this code (contains also debug prints): def joinLayers(inputlayer, layer, index_field, name = "JOINED", dataProvider = "ESRI Shapefile"): a = [] b = [] outpath = ...
4
votes
1answer
67 views

New field names after joining 2 tables in QGIS

When joining two files (A.csv and B.shp with a common unique ID) in QGIS the new fields in B.shp (from A.txt) include the name of the field + the name of the file where it comes from (A). For example ...
4
votes
1answer
159 views

Adding GUID field with ArcObjects

I'm trying to add a GUID field programmatically to an existing FeatureClass using ArcObjects. Here is my code: ISchemaLock schemaLock = (ISchemaLock)ipFC; try { // A try block is necessary, as ...
3
votes
2answers
181 views

Remove duplicates from a field

I need to remove duplicates from a field named "Intersecti" Here is my code. I used list..set. It's not removing any duplicates. import arcpy duplicates = "G:\\xStreetNew\\Duplicates.shp" ...
3
votes
2answers
173 views

How to create in QGIS shapefile a field that automatically returns the current date

I'm digitizing a shapefile in QGIS and I need to create a field that returns automatically the current date.
3
votes
4answers
3k views

Why does Field Calculator return 0 values when decimals are expected?

I realize I posed this question, and got answers, several days ago (see (Field calculator error)) , but none seem to really be working, and so am posing again. Below are two screenshots that show the ...
3
votes
2answers
5k views

How to delete multiple fields in an attribute table?

Is there a way to select multiple fields in an attribute table and delete them together in Arcmap without writing the script?
3
votes
2answers
137 views

Looping field name change

I need to alter all of the field names through multiple feature classes. I have a pretty good idea of which tools to use but I'm not sure how to loop them through each feature class and each field. ...
3
votes
2answers
141 views

ArcGIS python “add field” and “calculate field” workflow

I am new in Python and I am creating a Script. I've crafted a functional code, but I'd like to know if there is an easier way to do it, just for curiosity (And learning new ways!). The purpose of ...
3
votes
2answers
91 views

How to get all (or selected) values from a single field in a table?

I'm looking for a way to get all of the values from a single field in an ArcGIS table. Reasons for doing this might include pasting the values into a text document or SQL where clause. Since ArcGIS ...
3
votes
1answer
61 views

ArcMap Using Python to Rename a Feature Class based on Print Results

I would like to rename a feature class based on the EDITOR and DATE fields. I wrote this code: import arcpy fc = "C:\Users\PythonTesting.gdb\MyFile" f1, f2, f3 = "EDITOR", "DATE", "OBJECTID" ...
3
votes
1answer
1k views

How to Calculate Cumulative Field Values in Arcmap

My problem is conceptually quite simple; In Arcmap 10.2, I wish to create a field which contains the cumulative values of another field in the same attribute table. For example, if the first three ...
3
votes
1answer
437 views

*Value relation* widget in QGIS

I cannot understand what the Value Relation widget of the Fields menu in QGIS actually does. For example: I have a point layer with some columns (ID, value1...) and a table (so just a dbf file) with ...
3
votes
1answer
2k views

How to copy values from field to another using arcpy?

Can some one please let me know how I can do simple field calculation like Copying From "A" to "B" in ArcPy? I have found lots os example on web which they all used extra expression and they were ...
3
votes
1answer
102 views

Calculate new field from existing fields using expression in gdal/ogr and append to shapefile

I'm trying to calculate a new field from existing fields based on a simple expression for a set of polygons in GDAL/OGR. The expression is basically: new field = (field 1 / field 2) * field 3 ...
3
votes
1answer
149 views

How to use QGIS Graphical Modeller to join specific fields?

I wish to join one field from a shapefile to another shapefile within the QGIS graphical modeler. I am aware that there is a 'Join attributes table' algorithm but this joins all of the fields from the ...
3
votes
3answers
1k views

Adding Field To feature class using ArcObjects and C#?

I want to add a new field to my featureclass.My code for that is: public IMxDocument mxDoc; public IMap map; IFieldEdit2 field = new FieldClass() as IFieldEdit2; ...
3
votes
1answer
251 views

How to hide all fields at once in QGIS 1.7

Is there a way to hide all the fields at once in QGIS 1.7? I see where I can hide one field at a time but I would like a button which does it all at once.
3
votes
1answer
131 views

Field cannot be deleted because it is being used as relationship key?

I want to delete some fields of featureclasses, but when I run the code FeatureClass.DeleteField(Field) it works well for some featureclasses but after some time it gives an error such as: The ...
3
votes
1answer
98 views

Crosstable two fields of a pointfile (ArcMap)

I'd like to produce a simple crosstabulation from two fields of a point feature class. These fields contain land use class information which I'd like to compare. One option is to export a dbf and do ...
3
votes
1answer
70 views

Trying to use Symbols to represent numerous fields

I am using QGIS 2.12 in an Archaeological setting. I have populated a layer with features that represent burials and I have the intent for symbols to appear in the burial polygons to represent the ...
3
votes
1answer
185 views

Changing Field Name/Apply Symbology from layer using ArcPy?

Using ArcMap 10.1, I want to use the Apply Symbology From Layer tool, however my field names are not the same. I'm having trouble understanding how to change the Field Names in a layer. I tried the ...
3
votes
1answer
186 views

How to remove a specific unique value with arcpy

using arcpy, i would like to remove,from 50 mxd files, a specific unique value called "residence a" (exist in 3 layers) from the table of content. so i will get this result: The value of ...
3
votes
2answers
342 views

How to change field defined as REQUIRED to NON_REQUIRED in ArcGIS Geodatabase

I have created some feature classes in a geodatabase and also some fields using this sample code: arcpy.AddField_management("schools", "ref_ID", "LONG", 9, "", "", "refcode", "NULLABLE", "REQUIRED") ...
3
votes
1answer
359 views

Changing Visible Field Properties on Multiple Layers at once

I am pretty new to all of this and I apologize that I don't know all the correct verbiage. I am using ArcGIS 10.0 I have a map with a layer dealing with electrical primary circuits, that I split ...
3
votes
2answers
794 views

finding the index of a field with its name using arcpy

I wan to extract the index of a field with its name using arcpy. it seems what I have written is so dumb. is there any simpler method with out using for-loop. import arcpy fieldList = ...
3
votes
3answers
2k views

Field format lost when exporting events layer to shapefile - long field type converted to double

I have a MS Access 2010 database with about 80 000 records in it. It is point data for animal locations. I would like to bring this into GIS and project the data into lambert conformal conic. I am ...