5

If you prefer to address this issue in "the raster logic", then there are a few filters that you could consider. The best choice will depend on the spatial distribution of your pixels of each class inside your "background" values, but here are two potential solutions : if your patches that you want to remove are relatively large, then you should use "sieve" ...


5

ST_ClusterWithin is an aggregator function, meaning it will not generate a new geometry, but simply output the geometries that were input to it, albeit in a particular grouping (the clusters, in this case). If you want a visual representation of your clusters, you can do so by feeding your resulting Geometry Collections into ST_ConvexHull. This will give ...


5

Interesting, haven't seen the Fréchet distance before (it seems to be the equivalent of Hausdorff distance, but for lines rather than polygons) It looks as if there may be an implementation in the MDAnalysis library. However, this library appears to be for analysing movements of molecules ... it's python built on numpy, but is not designed for geospatial. ...


4

Unfortunately, this is not possible through the current version it is planned though as future updates occur for this version. ArcGIS API for JavaScript 3.20 Does have this capability.


4

You can do this. First, create the column in your table. ALTER TABLE point ADD COLUMN cid integer; Then update your table based on your query. When you do your DBScan query. Make sure you select an id field that can be matched back to the points. SET cid = subquery.cid FROM (SELECT id, st_clusterdbscan(geom, eps := 0.01, minPoints := 5) over() as cid ...


3

I have been able to work around the limitation by "pre-computing" the values for eps and inferring reasonable values of the other subqueries which where previously referring to the recursive CTE. Note that the new solution may create clusters larger than wanted (5000 in the query below) if you run-out of "pre-computed" values. This helps ensure that the ...


3

Given you already have your RED 6km span points which I am referring to red_points, you can do something like this to obtain your 3X3 200m grey_points. (please, adjust the sign (+/-) as you wish to achieve your result. Also, here 200 is in meters as long as the units of your reference system is meter.) import arcpy red_points = "your_red_points_fc_here" ...


3

You get an entry for each voter because you are grouping on the voter column as well, which results in groups that are all single rows. And you cannot include voter_name in the query unless you either aggregate on the column or build groups that include the column, which means that you have to add one more query level to achieve your objective. Here are a ...


3

20000 is most probably in degrees - which is why all of your geometries are in cluster 0 (if it was failing to cluster they would be in NULL). You need to convert your data to be in metres by reprojecting into a local projection (SRID). For example EPSG:5243 would work, so something like: ALTER TABLE table ADD COLUMN geom_m GEOMETRY; UPDATE table SET geom_m ...


2

The GitHub page linked below contains a clustering example for v4.x (this if from the above comments) https://github.com/nickcam/FlareClusterLayer


2

Just a technicality (should be a comment but I lack reputation): In any case this needs a coordinate reference system that gives you euclidean distances in your attribute space, for example UTM: library("rgdal") # specify original CRS: proj4string(house) <- CRS("+proj=longlat +datum=WGS84") # transform to new CRS (need to specify correct UTM zone): ...


2

I've done something similar to this hundreds of times. You didn't provide enough information to provide more than a stick-figure solution, but one way to do it would look like this: UPDATE mytable t SET colval = vt.colval FROM ( SELECT t.keycol,j.colval FROM mytable t JOIN othertab j ON j.geomcol && t.geomcol AND ...


2

My interpretation of your question is that you are not simply trying to set a zoom level on an interactive map, and your point groups near each other do not share a common attribute. If my understanding of your question is incorrect, please modify your question to provide more details, as you will get a different answer. Based on my two assumptions, and ...


2

Just a thought. Snip any picture you like, e.g. night lights. Georeference it to area of interest: Reclassify:


2

No time for more improving or testing, but: for a single, more generic recursive term, and possibly better performance, try WITH RECURSIVE params AS ( -- convenience variables for testing parameters SELECT 10 AS max_size, -- max. cluster size 1 AS max_points, -- 'max_points' parameter ...


2

ST_GeometricMedian should compensate for outliers in MultiPoint geometries, e.g. sth. like: SELECT ST_GeometricMedian(ST_Collect(geom)) AS geom FROM <your_table> GROUP BY item_id ; General info on the concept, and difference to weighting (i.e. ST_Centroid). As an alternative, using ST_ClusterDBSCAN(geom, <eps>, 1) OVER(PARTITION BY ...


2

Let's work through a Haussdorf clustering of lines. We'll use the sf package for spatial data and distance calculations: library(sf) starting with your final x, lets group everything by cyclone number, make line features, and keep the number of points in the group: cyclones = x %>% group_by(CycloneNo) %>% mutate(n=n()) %>% summarize(n=mean(n),...


1

Actually, the cluster renderer does support categorized styles. Next to the word Renderer there's a dropdown menu, where you can choose Categorized. Under the Renderer type selection menu, click the button Rendering Settings... to access the normal layer style panel settings for a Categorized style. Categorize by the field that has values. Un-check the ...


1

The eps distance is the maximum distance between points in the cluster, not the maximum width of the entire cluster. So if you have points A, B, and C, as long as each point is within the eps distance of one other point, then it gets included in the cluster. If the eps distance was 1 km, A could be within 1 km of B, and C can be within 1 km of B, but A can ...


1

Maybe you can try an iterative approach: You first use ST_ClusterDBSCAN with a big eps and a small minpoints, and then you isolate the points that are in a cluster too big for you, for exemple using the radius of the bounding circle (general idea, not tested): sqrt(ST_Area(ST_MinimumBoundingCircle(ST_Collect(points)))/pi) > your_threshold group by ...


1

Seems like the correct name of the function is arcpy.stats.SpatiallyConstrainedMultivariateClustering In general, when you get an error: " 'module' object has no attribute X", it means that there is no function named X in the library/module/class, which means you probably have written something wrong in the name of the function, which should be quick to ...


1

Not a full-fledged answer, but: Build an adjacency matrix of your polygons, to know which is adjacent to which. This may be done either through the R provide scripts, or Python, as far as I know there is no current implementation built in QGIS; Search via breadth-first search for the neighbours, and keep on checking whether you got to the population ...


1

You are convolving what your experimental unit actually is. For information contained in "buffers" you are going to have within unit and between unit variation. You cannot collapse the within unit variability and quantify autocorrelation nor can you evaluate independence between units without addressing the underlying distribution(s). For evaluating the ...


1

Make an adjacency list: touching_list = st_touches(milan_primary_highways) this isn't NxN so won't grow - its a list of length N where each element is only the adjacent elements. This might help it scale up to larger problems. Now use igraph to create a graph objects and get the connectivity: library(igraph) g = graph.adjlist(touching_list) c = ...


1

I finally found a way, I scripted my own clustering function in R which works relatively great. The idea is to start from the neighbor list and iteratively make groups. The algorithm looks a little bit like that: Make one group select first polygon find it's neighbors group them find the neigbors neighbors group them repeat until target size reach ...


1

You can use ClusterPoint plugin. After installing the plugin, a tool named doCluster is added to Processing Toolbox. Cluster Points adds a new field Cluster_IDto the attribute table as output. (In the image, points are styled categorically by Cluster_ID)


1

It seems as though the table must be formatted with the unique ID field in order (or at least grouped). In the Weights.py script which is throwing the error there is a function that reads the table and checks the value against a list. Every time the tool processes a new unique ID it removes it from the list. If the IDs are not grouped it will fail when ...


1

R might be the most straightforward tool for this job. I would suggest looking into the K-, L- and G-Function tools in the "spatstat" package. They will help you see if any patterns in your data suggest spatial clustering. I think that by subsetting your data into two groups (single male vs. multiple male) you can get the answer you're looking for. This ...


1

I use the query construct at the end of the answer to assign census data to parts of the small transect pieces and adopted it to your context. IMO the st_distance and st_shortestline will do the right job also in a LINESTING <-> POINT context. The expression: SELECT st_distance(st_point(0,0), st_makeline(st_point(-1,-1), st_point(1,1))); gives ...


1

It's unclear to me what you are trying to do here, but if you need to do an unnest, you are better off using ST_ClusterDBScan if you have PostGIS 2.3+. I'm also not clear why you have two calls to ST_ClusterWithin each with different distance. http://postgis.net/docs/ST_ClusterDBSCAN.html WITH c AS (SELECT ST_ClusterDBScan(centroid,100,10) AS cluster_num, ...


Only top voted, non community-wiki answers of a minimum length are eligible