Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
25 votes
1 answer
7k views

Is it ok to group by geometry in PostGIS?

Is it OK to group by geometry? We do a lot of counting points by polygon geometries, which involves intersecting the data first in order to count instances of students. by school boundary, block ...
Inactivated Account's user avatar
18 votes
1 answer
8k views

Clustering geographical data based on point location and associated point values

Given data points with longitude, latitude, and a third property value of this point. How can I cluster points into groups (geographical sub-regions) based on the property value? I searched by google ...
Excalibur's user avatar
  • 281
15 votes
4 answers
102k views

GROUP BY timestamp interval 10 minutes PostgreSQL [closed]

I need to group by a period of time spliting up by 10 minutes. I have this query below that returns me a result set: SELECT timestamp FROM table_1, table_2_shape_polygon WHERE ST_Within(...
Marco Amaral's user avatar
14 votes
5 answers
859 views

How to start a local GIS Users Group

My immediate geographic area is lacking an organized local GIS Users Group. I belong to a group that meets a couple times a year, but its about 1.5 hour drive. I'm thinking about starting up a Users ...
Craig's user avatar
  • 4,580
9 votes
1 answer
12k views

Clustering points/polygons based on proximity (within specifed distance) using QGIS?

I have seen similar questions asked about grouping points and Concave Hull being given as an answer, but in my case there are no "features"/attributes that will classify the points. The only parameter ...
user82635's user avatar
  • 153
9 votes
3 answers
14k views

How to group by attributes and give unique categories in QGIS?

I have features and each of them has an attribute about what it is. In my case, I have points representing trees and each tree has its species name as an attribute. I would like to group them by ...
Skye's user avatar
  • 1,053
9 votes
1 answer
3k views

Creating Groups of points based on proximity in QGIS?

I have a dataset with around 900 points and I want to cluster them into groups of 44 based on proximity. Is this possible in QGIS? I have tried to use the convex hull tool with no success.
lc9999's user avatar
  • 91
8 votes
4 answers
2k views

Adding unique ID for groups of items using Field calculator in QGIS

I have a set of string values in a shapefile's attribute column and want to assign a number to them in a way that each unique string gets an integer number, like this: How do I do this using the ...
Elise's user avatar
  • 125
8 votes
1 answer
1k views

Finding density centroids within polygons in PostGIS

I want to find the highest density of OpenStreetMap nodes within a dataset of census geometries. I want to tie the census data to the location of the node which is most central in terms of population. ...
Dennis Bauszus's user avatar
7 votes
1 answer
467 views

GROUP BY on geography in postgres 9.4.0 returns wrong/different results

table definition: CREATE TABLE search ( id bigserial NOT NULL, location geography(Point,4326) NOT NULL, location_aggregated geography(Point,4326) NOT NULL, created timestamp with time zone ...
Michael K.'s user avatar
7 votes
0 answers
323 views

Grouping carpool participant addresses for network [closed]

I have a list of addresses of people participating in carpools to a workplace and a list of cars given by the workplace. Both lists change daily. I need to group people by their addresses and assign ...
jonatr's user avatar
  • 3,185
6 votes
2 answers
326 views

Counting fire occurences per county per year using QGIS

I wish to loop through this shapefile, and for each "COUNTY_NM", count the number of values corresponding to each "layer" value. I want to output a CSV or equivalent which would be ...
Stuey17's user avatar
  • 199
6 votes
2 answers
417 views

Categorising data points along transect using QGIS

I have data on the latitude and longitude of several locations in Europe (blue). So far I have been able to read this data into QGIS but not more. I would like to plot a transect (red) and then ...
qgisquesls's user avatar
6 votes
3 answers
1k views

Calculating Convex Hull based on attributes in QGIS

I have a layer with lots of (spatially grouped) lines - lines belonging to a group share the same value in a field. I would like to create convex hulls around each of these groups using QGIS 3.8. I ...
roland's user avatar
  • 73
6 votes
2 answers
1k views

Summing area of by several attributes in QGIS

I have a shapefile that contains building footprints with multiple addresses with different functions (with each an usable area). I would like to calculate the sum of the usable area, per building &...
maevad01's user avatar
  • 261
6 votes
1 answer
7k views

How to group by a category and sum multiple variables within that category using QGIS?

I'm using QGIS for some analysis. I have data in this format: Name is a text variable and categories are all integers And I want to generate a sum for all categories for each name, ie a table like ...
Mathlete's user avatar
6 votes
1 answer
3k views

r - Can dplyr::group_by work with sf::st_intersects

Trying to combine dplyr::group_by and sf::st_intersects to see which of the objects within groups in a sf dataframe are intersecting with each other but in the end all objects are compared with all ...
adl's user avatar
  • 510
6 votes
3 answers
1k views

Grouping points to clusters containing similar number of features using QGIS

The question Using QGIS, how to cluster unevenly distributed points from the same layer to groups of about the same size / containing the same number of features? The problem I have a large point ...
Babel's user avatar
  • 75k
5 votes
3 answers
452 views

Generating unique code for features via grouping by several attributes

I have features with 3 columns of information ("material", "name", "dimension") in the Attribute table. I need these features to group - to create 4th column where ...
pazelvak's user avatar
  • 415
5 votes
2 answers
572 views

Calculating mean with group by based on another column in QGIS Field Calculator

I have daily temperature data for several cities from January to December. I'd like to calculate the average temperature per month for each city in a new column. I have a column "city", &...
GisUser's user avatar
  • 665
5 votes
1 answer
132 views

Copying all visible layers to new group

I would like to copy all visible layers in a project to a new group. Does anyone know of a quick way of doing this? Background: We have a Project that acts as a library for all the spatial data we ...
J B's user avatar
  • 51
5 votes
1 answer
210 views

Selecting N points within each geometry using SQL

I have grid and point tables in my Postgres db. The points are not equally distributed over the grid. The grid table is 100k+ geometries and the points are in the 100's of millions so efficiency ...
RedM's user avatar
  • 1,653
5 votes
1 answer
1k views

Unsplitting/merging lines that have coincident endpoints using PostGIS

I have a large dataset of lines/linestrings (ie. a road network), which is unregularly segmentised/ split and the lines needs to be merged at coincident endpoints (if only two lines are touching). I'd ...
krenz's user avatar
  • 163
5 votes
1 answer
4k views

postgis: cluster/group points based on distance

We have a set of thousands of points and want to group all of those which are within 100m distance from each other (to get the centroid from each group). A first idea was to build 100m buffers around ...
Berlin_J's user avatar
  • 441
5 votes
2 answers
957 views

Grouping lines together to form one line after a distance threshold is met

I have lines on a map showing the most direct way from point data to the coastline (polygon). I would like to group the lines if they are close to each other by a distance that I can set. Where the ...
Tetra's user avatar
  • 195
5 votes
2 answers
3k views

Using GROUP BY clause in arcpy.da.UpdateCursor

I need to specify a "group by" clause for UpdateCursor arcpy.da. From here I found out that it's possible to do using an optional pair of SQL prefix and postfix. But there are no examples and I'm ...
ievgenii's user avatar
  • 161
5 votes
1 answer
1k views

Grouping GeoDataFrame by column while comparing feature area and adding values to new column with GeoPandas

I have these columns: "index", "area_of_poly", "cad_admin" in my GeoDataFrame, the dataset is available here: http://www.mediafire.com/file/x4q5k7xuztq6o3w/p.zip. Now, I ...
user122244's user avatar
5 votes
0 answers
2k views

Clustering of events within a space-time window (R)

I am relatively new to clustering methods and am trying to determine the best method for clustering (or merely grouping) events that fall within a space-time window using preferably R. My goal is to ...
Phil's user avatar
  • 85
5 votes
1 answer
1k views

Dividing polyline layer in clusters with specific requirements in ArcGIS for Desktop?

For my work in ArcGIS 10.2 for Desktop I need to divide line layers into clusters/groups. Currently I am doing this manually, but I like to automate this. The line layers can consist of 50 up to 2500 ...
epke's user avatar
  • 55
4 votes
2 answers
807 views

Area of each polygon that intersects another layer and total area of intersections in QGIS

I have two layers: 'A' (orange) and 'B' (purple). Using a Virtual Layer and group_concat I am able to list the polygons in layer 'B' that intersect with those in layer 'A'. I found that solution at ...
David's user avatar
  • 119
4 votes
2 answers
497 views

Grouping and measuring total length of road based on specific attribute in QGIS

I have this dataset that describes the cycleways of a city. I want to measure the km of cycleway for each type of highway (residential, track, unclassified, ecc) and then calculate the percentage of ...
anea's user avatar
  • 161
4 votes
1 answer
8k views

How to get sum / total length of lines per polygon in QGIS?

I have a line vector layer which has multiple segments within individual polygons in a separate polygon layer. I have spatially joined the attributes so that each line segment now has the same ID as ...
Ian's user avatar
  • 530
4 votes
1 answer
229 views

Calculating two columns at once in QGIS

Is it possible to calculate two columns at once? So what I mean is that we have different covers and lengths and I want a total length of "Cover A" after that a total length of cover tb and ...
Joep's user avatar
  • 41
4 votes
1 answer
2k views

Load Named Style within a group on QGIS

I am trying to apply the style from .qml to a group of layers in QGIS. I have tried to incorporate LoadNamedStyle within jkall's code here: https://github.com/jkall/qgis-processing-scripts/blob/master/...
B-C B.'s user avatar
  • 765
4 votes
1 answer
868 views

Centroid of multiple polygons based on value in attribute table

I have a (polygon) shapefile with multiple zones. Now, I would like to calculate the centroid of groups of these zones. The zones have to be grouped based on a value in the attribute table: AreaNr ...
Rogier's user avatar
  • 123
4 votes
2 answers
825 views

Mapping building to only one grid which contains more than half of its area using QGIS?

I have a shapefile of a city map and I have created vector grid as polygons. After intersecting the two shapefiles, a building will map to all the grids it overlaps. However, if I just want it to ...
Sven Wang's user avatar
4 votes
1 answer
75 views

Grouping features with identical values in two fields and deleteing the geometry with the lowest value in the third field using QGIS

I've got a shapefile with three fields: "X", "Y" and "Z" they are the geometries as well but I also have them as field values. Every line geometry in the shapefile has a ...
sistema's user avatar
  • 41
4 votes
1 answer
157 views

Grouping lines by name and determining their proportions using Virtual Layer

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces. I would like to use a virtual layer to group ...
MartinMap's user avatar
  • 8,406
4 votes
2 answers
101 views

Replicating ArcMap legend in QGIS 3

I am trying to replicate this ArcMap legend in QGIS but i can't seem to get it right. I am stuck in print layout and using QGIS 3. I have the title 'LEGEND' but i do not know how to categorize the ...
Ruth's user avatar
  • 41
3 votes
2 answers
813 views

Summarizing fields with same ID in QGIS Field Calculator

I am looking for a command, that sums the value of the field "Baulast" if they have the same "ogc_fid" and if there is a Number in the field "WEA". If there is no number ...
lesto's user avatar
  • 327
3 votes
3 answers
3k views

Creating population dot density map at the block group level in QGIS

I'm new to QGIS, always used ArcMap, and I'm struggling to find out how to best display population density at the block group level for a county (the most granular level of detail for census geography)...
Ashley's user avatar
  • 325
3 votes
2 answers
796 views

Adding unique ID for consecutive groups using Field calculator in QGIS

I found a similar question on this site and the answer suggested: array_find( array_distinct( array_agg("PortCluster_ID") ), "PortCluster_ID" ) + 1 ...
Peter Mastnak's user avatar
3 votes
2 answers
252 views

Classifying in QGIS into arbitrary number of percentiles instead of quantiles, based on attribute field value

Extending this question and this one: In QGIS, there are special expression functions for the first and third quartile (q1 and q3) and as well as median (median). So it's easily possible to categorise ...
Babel's user avatar
  • 75k
3 votes
3 answers
971 views

Counting and merging features based on attribute field in QGIS

I have a shapefile with a number of features, each with a field called "region". I want to count the number of features corresponding to each region. Outputting a shapefile with one feature ...
Stuey17's user avatar
  • 199
3 votes
1 answer
160 views

How to group/clean group of scattered points based on their distance and attributes?

I downloaded traffic signs from Mapillary API. I found that many of these points represent the same real life entity, but they are scattered in the map. Since they are distinguished by their category ...
588chm's user avatar
  • 645
3 votes
1 answer
1k views

QGIS - SQL GROUP BY and MAX

I have a layer which contains a unique ID (UID) for each feature and another column of Scores. For example: UID, Score A12,1 A13,1 A14,4 A12,2 A13,3 A14,5 I would like to use an SQL statement to ...
RobN's user avatar
  • 305
3 votes
1 answer
4k views

Grouping or Clustering Points that are within 45 miles of each other using ArcGIS Desktop?

I have a project in ArcGIS (ArcMap 10.2) where I want to identify naturally occurring dense spots of points and then form groups in that dense area, where points are within 45 miles of each other. ...
ZiaW's user avatar
  • 33
3 votes
1 answer
1k views

How to add an ID based on attributes in ArcMap 10.1

Given are: a polygon shapefile/feature class (FC) containing municipal districts a point shapefile/FC containing locations of, lets say, trees. My goal is to append an unique value (1, 2, 3, ...) to ...
zehpunktbarron's user avatar
3 votes
1 answer
110 views

What is the equivalent of native:aggregate() in QGIS Field Calculator?

I have two layers which I want to connect using the aggregate() function with the Field Calculator. I can do this using the processing tool: processing.run("native:aggregate", { 'INPUT' :...
eagleadmiral's user avatar
3 votes
1 answer
92 views

Get the full list of commons

In QGIS I've loaded the shapefile "province" in which attribute table contains 242 fields (the municipalities of this province) and also two other files downloaded from OpenStreetMap about hotels (...
Stefano Citterio's user avatar