All Questions
152 questions
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 ...
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 ...
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(...
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 ...
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 ...
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 ...
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.
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 ...
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. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 &...
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 ...
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 ...
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 ...
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 ...
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", &...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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)...
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
...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
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' :...
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 (...