[postgis-users] Finding optimal piece of land

Paragon Corporation lr at pcorp.us
Fri Dec 5 21:05:12 PST 2008


I'm wondering if anyone has some thoughts on this.  

I'm trying to write a function that given a desired plot of land and a
rectangle that defines allowable land range,
Determine the spot closest to the  desired spot that is not already
occupied.

So my desired plot is some amorphous polygon, but I can't place an object
there if its partly taken up.

So what I have so far is
1) First determine if desired plot is part occupied, if not then return
desired plot
2) If partly occupied
A) take difference of plot range and land already in use and throw out
anything lower than dimension 2.  So what I am left with is space not
occupied.
B) drop all shards of available land whose area is too small to cover my
desired plot (this is an easier check than what I really want to do)
C) drop all shards whose extent can not completely cover my translated
desired location (by translated I mean I overlay the 2 so their centroids
are aligned) and require that my desired plot now translated is covered by
the shard.

D) Okay now what I am left with are larger patches of land that could
conceivably hold my new empire -- and I'm trying to figure out the best
patch and on that patch the best location to place the centroid of my
empire. 

For simplification I could assume my desired plot is rectangular as well
which it usually is.  But that doesn't seem to help me much as far as I can
tell.

Thanks,
Regina





More information about the postgis-users mailing list