I want to re-assign the attributes of a table of regular polygons based on their spatial relantionship so that the polygons are clustered like this:
This essentially means to swap the attributes from one polygon to another based on some condition(s). This is the table behind the picture:
CREATE TABLE public.grid_attributes
(
uid numeric NOT NULL,
owner character varying(50),
priority boolean,
geom geometry(MultiPolygon,32630)
)
The order/direction by which this clustering happens should (preferably) start from the polygons which are designated as priority
of which there is one for each category I wish to use to cluster. That would be the owner
attribute.
My question (assuming I formulated this in an understandable way) is if SQL/PostGIS is right tool for this problem, and if it is how should I approach it/any hints?
UPDATE <table> SET <column> = <some_value>
, where<some_value>
can be that of any other row in your table based on arbitrary complex rules...but I don´t really get yours. could you explain some more how to get from the left to the right picture? doowner
andpriority
change and if, how? – geozelot Apr 19 '18 at 11:06