I am using Oracle Spatial to match geo-specific images to the appropriate country they represent.
I have a table with a row for each country. Each row consists of a SDO_GEOMETRY column for 3 items: SHAPE (overall boundaries), CENTROID (centerpoint of the country) and MBR (Minimum Bounding Rectangle). The Centroid and MBR fields are auto-computed using SDO_GEOM.CENTROID and SDO_GOEM.SDO_MBR respectively.
Mostly there are no issues, however... For some countries that span the 180deg Longitude line, the MBR created is wrong. I believe this is caused by Oracle handling the (co)Ordinates as X,Y values.
For instance, using Russia as an example. The LowerLeft value of the MBR is returned as (41.19268056, -180) while the UpperRight value is returned as (81.858710028, 180). When mapping this bounding box, it covers a swatch that spans 360deg (and encompasses many countries along the way).
Another example is Kiribati. The LL returned is (-11.46111418, -174.543405728) and the UR is (4.7230899, 176.850922). Mapping this shows the bounding box as NOT crossing the 180Lat line, but rather spanning -174 to +176, when it should be progressing from 176...178...180...-178...-176...-174.
Any thoughts or ideas as to an solution?
SQL used to populate the MBR row:
UPDATE schema.table SET mbr=sdo_geom.sdo_mbr(geometry);