Hibernate Spatial

SDO_POINT_TYPE not created for 2D points

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0-M2
  • Fix Version/s: None
  • Component/s: Oracle10g
  • Description:
    Hide
    When storing a 2D point, it is useful to have an SDO_POINT_TYPE representing it as described here (http://download.oracle.com/docs/html/B14255_01/sdo_objrelschema.htm#BGHIFACF), since that provides convenient access to the X, Y and Z fields:

      SELECT coordinate.sdo_point.x, place.sdo_point.y FROM places;

    The attached patch populates the SDO_POINT_TYPE when the number of dimensions is 2.

    Having the SDO_POINT_TYPE allows to easily perform queries based on the X and Y of the given point::

    Show
    When storing a 2D point, it is useful to have an SDO_POINT_TYPE representing it as described here (http://download.oracle.com/docs/html/B14255_01/sdo_objrelschema.htm#BGHIFACF), since that provides convenient access to the X, Y and Z fields:   SELECT coordinate.sdo_point.x, place.sdo_point.y FROM places; The attached patch populates the SDO_POINT_TYPE when the number of dimensions is 2. Having the SDO_POINT_TYPE allows to easily perform queries based on the X and Y of the given point::
  1. hibernate-spatial-oracle-1.0.-M2-SDO_POINT_TYPE.patch
    (2 kB)
    Abel Muiño
    21/Aug/08 12:53 PM
  2. OracleJDBCTypeFactory.createStruct.patch
    (4 kB)
    Pedro Mendes
    05/Oct/11 11:17 AM
  3. SDOGeometryType.patch
    (3 kB)
    Pedro Mendes
    05/Oct/11 11:17 AM
  4. SDOPoint.patch
    (0.8 kB)
    Pedro Mendes
    05/Oct/11 11:17 AM

Activity

Hide
Abel Muiño added a comment - 21/Aug/08 12:53 PM
Patch adding the SDO_POINT_TYPE value.
Show
Abel Muiño added a comment - 21/Aug/08 12:53 PM Patch adding the SDO_POINT_TYPE value.
Hide
Karel Maesen added a comment - 03/Sep/08 11:15 AM
Good suggestion. I think the user should be able to configure whether to use the SDO_POINT_TYPE, or whether to store it as a general geometry as is now the case.
Show
Karel Maesen added a comment - 03/Sep/08 11:15 AM Good suggestion. I think the user should be able to configure whether to use the SDO_POINT_TYPE, or whether to store it as a general geometry as is now the case.
Hide
Abel Muiño added a comment - 03/Sep/08 8:23 PM
I don't know if it makes any difference for Oracle to store the point information or not (I think that an SDO_POINT_TYPE is still a GEOMETRY), but it makes sense to give control to the user. I'm not sure how to make that transparently.

About the patch, I think that checking the number of dimensions is not the right approach (i.e. there are many 2D geometries that are not points). Since for my app I only use points, it worked fine for me.
Show
Abel Muiño added a comment - 03/Sep/08 8:23 PM I don't know if it makes any difference for Oracle to store the point information or not (I think that an SDO_POINT_TYPE is still a GEOMETRY), but it makes sense to give control to the user. I'm not sure how to make that transparently. About the patch, I think that checking the number of dimensions is not the right approach (i.e. there are many 2D geometries that are not points). Since for my app I only use points, it worked fine for me.
Hide
Pedro Mendes added a comment - 05/Oct/11 11:17 AM
This is a set of patches regarding classes OracleJDBCTypeFactory, SDOGeometryType and SDOPoint.

A few notes about each patch:
  ** SDOPoint
    - Added a new constructor to receive a double array wich hold the coordinates of the point.

  ** OracleJDBCTypeFactory
    - The SDO_POINT_TYPE Struct is added if the geom.getGType() is equal to TypeGeometry.POINT;
    - The SDO_GEOMETRY attributes regarding ELEM_INFO_ARRAY and SDO_ORDINATE_ARRAY are only added if the geom is not a point;
    - The "inner" connection - in this case an OracleConnection - returned by the ConnectionFinder must be putted to NULL after it's use.

  ** SDOGeometryType
    - Added a string (and the getter and setter) to hold the "MDSYS.SDO_POINT_TYPE" type name;
    - In the method convertJTSPoint I've replaced the initialization of ElemInfo and Ordinates (has it not makes sense for Points) for SDOPoint.
Show
Pedro Mendes added a comment - 05/Oct/11 11:17 AM This is a set of patches regarding classes OracleJDBCTypeFactory, SDOGeometryType and SDOPoint. A few notes about each patch:   ** SDOPoint     - Added a new constructor to receive a double array wich hold the coordinates of the point.   ** OracleJDBCTypeFactory     - The SDO_POINT_TYPE Struct is added if the geom.getGType() is equal to TypeGeometry.POINT;     - The SDO_GEOMETRY attributes regarding ELEM_INFO_ARRAY and SDO_ORDINATE_ARRAY are only added if the geom is not a point;     - The "inner" connection - in this case an OracleConnection - returned by the ConnectionFinder must be putted to NULL after it's use.   ** SDOGeometryType     - Added a string (and the getter and setter) to hold the "MDSYS.SDO_POINT_TYPE" type name;     - In the method convertJTSPoint I've replaced the initialization of ElemInfo and Ordinates (has it not makes sense for Points) for SDOPoint.

People

Dates

  • Created:
    21/Aug/08 12:52 PM
    Updated:
    05/Oct/11 11:17 AM