[GPlates-discuss] Minimum bounding areas for polygons

John Cannon john.cannon at sydney.edu.au
Sat Sep 23 02:57:20 AEST 2017


Hi Bruce,

If you use pyGPlates for the proximity tests there are three proximity examples at:

https://protect-au.mimecast.com/s/lqmYBbSXJEMncm?domain=gplates.org

https://protect-au.mimecast.com/s/z4nRBmULzpeJcZ?domain=gplates.org

https://protect-au.mimecast.com/s/rNKaBYfDXEZOfJ?domain=gplates.org

...the second example finds reconstructed features overlapping a polygon. It will find any reconstructed geometry that either intersects the polygon outline or is completely inside the polygon.

There's also an 'area()' function for polygons - https://protect-au.mimecast.com/s/ZXg4BxU0xMvGsL?domain=gplates.org

Also it may be better to treat both polygons as solid...

            # See if minimum distance between solid/filled polygons is zero (means filled parts overlap).
            # We treat both polygons as solid so if one is inside the other then we get a distance of zero.
            if pygplates.GeometryOnSphere.distance(
                    polygon1,
                    polygon2,
                    1e-4, # Arbitrarily small threshold for efficiency since only interested in zero distance (intersection of solids).
                    geometry1_is_solid = True,
                    geometry2_is_solid = True) == 0:

...in case 'either' polygon is completely 'inside' the other. Note that the '1e-4' is just an optimisation - it's not needed for correct functioning. Also note that either/both geometries can be any geometry type (eg, point, multipoint, polyline or polygon) and they don’t have to be the same type as each other.


Also if you want to avoid all the Shapefile/GPML file loading, etc, and go straight to creating polygons (eg, if you just have the latitude/longitude point data for a polygon)...

<https://protect-au.mimecast.com/s/m4kKB9U1g2OYFq?domain=gplates.org>
https://protect-au.mimecast.com/s/m4kKB9U1g2OYFq?domain=gplates.org

And then reconstruct the polygons using RotationModel and FiniteRotation...

https://protect-au.mimecast.com/s/krZGBXuraExkTl?domain=gplates.org

https://protect-au.mimecast.com/s/pLG0B1fbAEzqt6?domain=gplates.org

Regards,
John

________________________________
From: GPlates-discuss [gplates-discuss-bounces at mailman.sydney.edu.au] on behalf of Eglington, Bruce [bruce.eglington at usask.ca]
Sent: Thursday, 21 September 2017 9:13 AM
To: GPlates general discussion mailing list (gplates-discuss at mail.usyd.edu.au<mailto:gplates-discuss at mail.usyd.edu.au>)
Subject: [GPlates-discuss] Minimum bounding areas for polygons
Hi folks
  A separate and very different topic from my previous postings. Is there something already built in to GPlates codes to be able to calculate the minimum bounding surface area for a polygon situated on top of a specific plate polygon? The reason I am asking is that, when reconstructing geological maps on top of moving and fragmenting polygon blocks, one often has a younger basin cover on top of older stratigraphic units. At the time when an older unit is visible and before deposition of the younger unit, it would be useful to fill in the area of the younger sedimentary cover with the attributes of the older unit as a first approximation for the spatial extent of those sediments. I have been trying to think of a methodology one might follow and the simplest seems to be to calculate minimum bounding area for each adjacent  stratigraphic unit. If the younger sediment unit has a smaller area than the older one and is situated within the extent of the older one, then it is approximately enclosed by the older units polygon so one could colour it. If not, then don’t colour.

BUT, this all depends on having the ability to compute minimum bound areas for unit polygons at different ages within code such as GPlates..

Maybe someone is already doing something similar for other purposes or has alternative suggestions.

Cheers
   Bruce


Bruce Eglington (Ph.D.)
Murray Pyke Chair
Geological Sciences
University of Saskatchewan
114 Science Place
Saskatoon
SK
S7N 5E2
Canada

bruce.eglington at usask.ca<mailto:bruce.eglington at usask.ca>
+1-306-966-5732

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.sydney.edu.au/pipermail/gplates-discuss/attachments/20170922/7a98ea37/attachment-0001.html>


More information about the GPlates-discuss mailing list