Questions tagged [select-by-attribute]

To select data records according to logical criteria applied to their field values ("attributes")

Filter by
Sorted by
Tagged with
4
votes
2answers
28k views

QGIS select features from attribute table using the “LIKE” operator

I created an expression with the help of the GUI in the QGIS attribute table of a vector (shapefile) layer of Native American ("Indian") reservations in the USA state of New Mexico. "NAME" LIKE '...
4
votes
3answers
18k views

Make selected polygon different color without covering everything?

Working in ArcGIS Desktop 9.3 I'm selecting polygons by attributes and trying to have the selection show up as a light yellow. I set the selection color to the light yellow and it's the 'lowest/last' ...
4
votes
3answers
611 views

Setting defaults in the 'Select By Attribute' SQL editor

Is there a way to set default values in the 'Select By Attribute' SQL editor (the where clause) ? I want to set a permanent value that will appear every time I enter the 'Select by Attribute' window, ...
4
votes
1answer
2k views

OGR: How to save layer from AttributeFilter to a shapefile?

I select a subset of features from my shapefile like so: node_lyr = nodes.GetLayer() q_str = "%s = %i" % (field, value) node_lyr.SetAttributeFilter(q_str) What is the best way to make a shapefile ...
4
votes
2answers
1k views

How to Select by Attributes on features sharing common value?

I am attempting to 'select by attributes' a point feature with the lowest numeric value which shares a common value with other point features in another field. For example: I may have 3 point features ...
4
votes
1answer
2k views

Using ModelBuilder to select layers by attributes, dissolve and then merge them?

I would like to reclassify polygons, I want to combine smaller polygons into bigger polygons based on their ID (each polygon has a unique ID). I want to regroup ~800 polygons into ~60 polygons. So in ...
4
votes
1answer
143 views

Creating selection in stand-alone ArcPy script?

I am using ArcGIS Desktop 10.5. I have had this work for me before, so I am confused as to what problem I am -running into now. When making a selection to copy to a new dataset in Arcpy, -here is ...
4
votes
3answers
3k views

Selecting top 10 records in attribute table using ArcMap

I am using ModelBuilder in ArcMap 10.2 to try and find a way to select the first 10 records sorted by Category and then by Distance. For example, my table has 100 banks and 100 churches, which is the "...
4
votes
2answers
474 views

How to select rows with highest value per group?

I have a .DBF file that contains the number of establishments for each major industry in every county in Florida. I would like to select each of the industries with the largest number of ...
4
votes
1answer
208 views

Selecting the largest from sets of duplicates in QGIS

I have a poly line layer where each feature has a Geometric Length and numerical ID. Some of these IDs are duplicates. I would like to be able to select the longest line from each set of duplicates to ...
4
votes
1answer
654 views

Selecting and updating attribute values using Python console in QGIS?

I am working with Landusefc and Class columns (ref table). What I want is: Selecting all water from "Class" and giving a value say '8' in the "Landusefc" column for these selected features. Table ...
4
votes
1answer
448 views

Is it possible to save frequently used expressions in QGIS?

Is there any way to save frequently used expressions in the selection or field calculator dialogs? Obviously I can cut and paste them into a file where I might save them, but I mean within the context ...
4
votes
1answer
2k views

Select features by matching attributes of two shapefiles?

I have one line shapefile with lot of road sections and a point shapefile, some of these points are outside my area of interest. The files have one attribute in common and I would like to do ...
4
votes
1answer
513 views

ArcGIS Select By Attribute with join returning extra, incorrect features?

I am attempting to run a simple Select by Attribute on a large File Geodatabase feature class (1,751,339 polygons) in ArcMap 10.6, but the query returns extra, incorrect records along with the ...
4
votes
1answer
1k views

How can I select all streams downstream of a polygon

I have an ordered stream network and I want to select all stream features that contain water that has come from a certain area. To start with I'm running a select by location query to find all stream ...
4
votes
2answers
5k views

Selection subquery using another table in database ArcGIS

I need to 'extract' a list of variables based on the IDs from another table. Using a subquery seems to be the best method. I have a large list of variables and have outside calculated a second list. ...
4
votes
1answer
825 views

ArcMAP SQL Statement Iterate Feature Selection 'IN' 'BY' 'IS' - escape character

We have a problem when selecting Features from a Feature Class in ArcMAP 10.2 using the Iterate Feature Selection tool in ModelBuilder. Our dataset has a Attribute Field with two character codes like ...
4
votes
1answer
560 views

How to select points within polygon constrained by field?

I've created a polygon from a raster dataset: arcpy.RasterToPolygon_conversion(RasterInt, "C:/arc/poly_int.shp", "NO_SIMPLIFY", "Value") The 'value' field has numbers 1-37, which map to the ID field ...
4
votes
1answer
1k views

How to print selected features in QGIS?

I have a detailed map in qgis (vector, .shp) and I would like to split the map in four parts based on attributes to print each part of the map separately. Unfortunately, I didn't figure out how to do ...
4
votes
1answer
1k views

Is there a way to select what to import from planet-latest.osm.bz2 to database?

Is there a way to select what to import from planet-latest.osm.bz2 to database? I want to do something like : osm2pgsql ... --place='city' --admin_level='2' My goal is to use only cities and ...
3
votes
3answers
4k views

Runtime error : ERROR 000358: Invalid expression using SelectLayerByAttribute in ArcPy?

I cannot for the life of me persuade SelectLayerByAttribute to work (I need to automate this for a complex script). Working in ArcMap's python console on already loaded shapefile, the format below: ...
3
votes
2answers
135 views

Searching for single buildings in QGIS

I want to search for different buildings by using the labels I've added to them. Like for instance, I want to search for the building with the label "1630", as in the picture. Is there any specific ...
3
votes
2answers
438 views

Automating Select By Attributes and Calculate Field?

I have zero experience with python and very little experience with ModelBuilder in ArcGIS. I have a shapefile with two fields, let's say their names are "Function" and "Regulation". What I need to do ...
3
votes
4answers
4k views

Get Parameter as Text and select layer by attribute

I have written a python script tool wherein a user specifies a feature class (e.g., Landuse) containing different attributes (e.g., parcel size, landcover etc.), name of the attribute field from which ...
3
votes
1answer
294 views

Show string that contains specific number?

For example, how to show all the strings that contain '841' on this layer? I tried to use "NAME" LIKE '841' but somehow it did not just show 841_1Q and 841_1, instead it still showed every point on ...
3
votes
3answers
802 views

Using arcpy.SelectLayerByAttribute_management?

I have difficulty to understand how to use "arcpy.SelectLayerByAttribute_management". I not understand how to write a query. I want to select the records > 0. I am attaching my code: import os,...
3
votes
4answers
843 views

Select polygons one by one and export them using arcpy

I have a shapefile that contains 200+ metropolitan cities. In each city, there are some tract polygons. The dbf table looks like: tract city xvar 1 0040 20 2 0040 12 3 0040 ...
3
votes
1answer
3k views

Finding points near points using PostgreSQL?

I'm going to have a database with a 'people' table and a 'shops' table. I'd like to find all people within 500m of a shop, and details from both tables. I'm used to working with mySQL, but I'm ...
3
votes
1answer
4k views

Selecting by attribute and calculating field of new selection in ModelBuilder?

I have a polygon shapefile (with 4000 records in it) that I want to group into different regions by doing a "select by attribute". I need to do this about 164 times because of the different selection ...
3
votes
1answer
204 views

Selecting features using attributes of another file in QGIS

I have a table of attributes in which a field contains combinations of IDs from another shapefile (ex. '[6, 4]' where 6 and 4 are each individual IDs in my shapefile). Here's an example for ...
3
votes
1answer
452 views

arcpy.SelectLayerByAttribute_management fails on Feature Class

I'm trying to streamline contour production with a script tool. Typically we make the contours to bring into AutoCAD Map where we need the "Elevation" and "Layer" fields populated so they import ...
3
votes
1answer
257 views

QGIS create selection script

I am trying to create my first script in QGIS. ##Double attribute selection=name ##Vector=group ##Selection_layer=vector ##First_field=field Selection_layer ##expression=string ##Second_field=field ...
3
votes
1answer
6k views

QGIS Advanced String Filter Expression returns too many results

"GNR" is a string column and I expect the filter expression "GNR"='.11' to only return the feature with the value '0.11'. Why are the other features with values of '.110'and '.1100' included? Is ...
3
votes
1answer
145 views

Selecting polygon features that are not fully contained against neighbors in QGIS?

In QGIS what would be the best method to select features that are not fully contained against it's neighbours? For example I want to select local authorities that have a coastline so in the example ...
3
votes
1answer
462 views

Slider for non time attributes in QGIS

How to filter data on attributes with a slider? By example, i would like to filter weights (CHARGE in my layer) attribute for polygons without to change the filter formula. The feature is available ...
3
votes
2answers
309 views

Select rows where column values don't match the domain

In ArcGIS Desktop, I can use the Validate Features option in the Editor Toolbar menu to validate feature class columns against their respective domains. More info here in the Validating Features ...
3
votes
1answer
957 views

How to loop a process in ModelBuilder?

I'm trying to count how many star points there are in 500 meters radius around each property in the month of its transaction. I created buffers around each property transaction firstly. Since each ...
3
votes
1answer
498 views

QGIS modeler: select by attribute wrong results

I am new to QGIS modeler and trying to write a script in which certain attributes are selected and written to a shapefile. See the attached image for the script and the select by attributes box. In ...
3
votes
2answers
3k views

Dissolving line segments in QGIS if they touch and fall within same class?

I have line segments that have the following 3 attributes (Class, start_point, end_point). I would like to merge/dissolve line segments that fall within the same class if they intersect (touch). i.e. ...
3
votes
1answer
881 views

How to Select polygon feature in ArcMap and pass Selection into Python Addin?

I have a script that uses a arcpy's 'SelectByAttribute' syntax to choose a record in a polygon feature class. Following that, I do a 'SelectbyLocation' to select points from a feature class that lie ...
3
votes
1answer
59 views

Correct use of SelectLayerByAttribute_management in ArcPy?

What are displayed in the tableName are polygon features in a geodatabase. I would like for each row in a loop to take each row TableName and apply the sql query from the sqlstring field and make the ...
3
votes
1answer
151 views

Select features in a polygon that covered the most by features of another polygon layer QGIS

I am working in QGIS. I have 2 polygon layers, One layer is the parcel polygons layer for a county called "Parcel" The other layer is the building footprints polygon layer for the same county called "...
3
votes
1answer
174 views

Selecting new records using values inside previous selected rows in QGIS?

I am trying to create a selection. First, I select records which have Null value in "Status" column ("Status" is NULL"). Then it starts to be a bit tricky. I want to select all the records which have ...
3
votes
1answer
2k views

Selecting features in attribute table using maximum aggregate function

I have a table containing distances from one ID (an address) to another ID (bus stops). There table contains distances from all addresses to all different bus stops. Now I want to select the feature ...
3
votes
1answer
839 views

Using arcpy dictionaries to select attributes from a different layer

I'd like to incorporate the use of dictionaries to access data between tables. So far I have been able to create the dictionaries that I need from my feature class fields. I have one dictionary that ...
3
votes
1answer
3k views

QGIS Filter layer by expression [closed]

Can I make the filter by the value that is obtained by the function? for feature in iter: name_dot = feature['name'] print name_dot expr = QgsExpression("\"name\"=name_dot") selection= layer....
3
votes
1answer
202 views

Selecting many maximum points within polygons

I've got a point layer with three values such as high, age etc. and polygon layer with many forest area. What I want to do is to select the 100 maximum (highest) points in every polygon. I can't do ...
3
votes
3answers
2k views

How to use the SQL in select by attribute to select the entries for each values in certain field?

I am trying to use select by attribute for the table in ArcGIS, which is similar to the following picture (lets say): I want to select those entries for each A and B, which have maximum count. I ...
3
votes
1answer
2k views

Meaning of empty quotes in select by attribute query?

Can someone please help explain if the empty '' means something? I am wondering if it might be inserted by typo or if you use these empty quotes to locate empty fields within the attributes.
3
votes
1answer
167 views

Select overlapped feature

I have points that are not equal but the distance between them is so small that it can't be seen even at scale 200k:1. I calculated the distance between these points and add it as attribute. Now I ...

1
2
3 4 5
10