[R-sig-Geo] Spatial maximisation problem using polygons
Robert J. Hijmans
r.hijmans at gmail.com
Fri Sep 19 16:01:41 CEST 2014
Rui,
You could create a matrix (=raster) and a function that creates a
valid set of groups of 4 cells that are not adjacent. The function
should return the solution (output matrix values: TRUE or FALSE) and
the sum of the selected values. Then use the optim function to
optimize based on the sum. When you have an optimal solution, create a
raster from the matrix and coerce that to polygons.
On Fri, Sep 19, 2014 at 2:18 AM, Rui Catarino <R.Catarino at marlab.ac.uk> wrote:
> Hi,
>
> This is not a very objective question and I apologise for that in advance. What I'm really looking for is some pointers on where to start or where to look for information. I've been looking in the web for the last couple of days and found very little. That might be because I'm failing in using the right key words or R is not the tool which I doubt, so here I am asking the experts.
>
> So basically I have a grid in which, each cell is a square and it has a certain value. The grid values change every week and every week I need to generate multiple polygons of fixed size (4 cells of the grid). The polygons value (sum of cell values) should be maximised but polygons cannot be adjacent and need to have a spacing of at least one cell between them.
>
> The task will get a lot more complex with a few more constrains but I think if I get some pointers, papers or similar examples I could start from there.
> I can generate the grid but I failed to find similar examples in the internet on regular polygon placement or maximisation.
>
> Any help will be very much appreciated.
> Cheers
>
>
> Rui Catarino
> Data Analyst/Modeller
> Fishery Analysis and Assessment Group
> Marine Scotland - Science
>
> Scottish Government | B15 | Marine Laboratory, 375, Victoria Road | Aberdeen AB11 9DB
>
> Tel: +44 (0)1224 295572
> Mob:+44 (0)7530 240666
> Fax: +44 (0)1224 295511
> r.catarino at marlab.ac.uk<mailto:r.catarino at marlab.ac.uk>
> rui.catarino at scotland.gsi.gov.uk<mailto:rui.catarino at scotland.gsi.gov.uk>
> www.scotland.gov.uk/marinescotland<http://www.scotland.gov.uk/marinescotland>
>
>
> ______________________________________________________________________
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit http://www.symanteccloud.com
> ______________________________________________________________________
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list