Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

OAS: Calculating distance between two points

Accepted answer
103
Views
2
Comments
peacey
peacey Rank 3 - Community Apprentice

I’m guessing that sdo_geometry would allow me to calculate distance between two lat/long pairs - easy. But I have no idea how I would calculate the driving distance on roads. Have seen something in Spatial Studio. But wanted similar in OAS.

Tagged:

Best Answers

  • Gautam Pisharam-Oracle
    Gautam Pisharam-Oracle Rank 6 - Analytics Lead

    Hi Peacey,

    We will introduce direct support for SDO.Geometry in OAS starting with the next release in OAS 2025. This means, you can visualize Geometry columns with SDO.Geometry datatype, and supports Spatial Calculations for a geometry column or between two geometry columns. It also comes with a specific Spatial function to calculate distance between two geometry columns.

    Let me give you a glimpse of this feature, which is already available in preview mode for OAC now (and will be available in the next release of OAS in 2025)

    OA_GeometryDistance.PNG

    The spatial function GeometryDistance calculates the distance between the columns StartPoint and EndPoint based on coordinates and it does not consider road networks or travel paths. (above Screenshot is from OAC 8.1 November release)

    Now, today, If you are specifically looking for calculating the distance/time based on a shortest distance or shortest time, spatial studio will let you calculate it and capture it to the database.

    OA_GeometryDistance2.PNG

    In the above screenshot, we have used the 'Driving Route' analysis function within Spatial Studio to create the calculated spatial measurements for DRIVE_DISTANCE and DRIVE_TIME based on pin on the map (you can also directly input longitude and latitude for a specific location to use as input in the calculation)

    OA_GeometryDistance3.PNG

    You can create a dataset to the table that has calculated the distance and time through spatial studio, and expose the numbers in Oracle Analytics directly by connecting to it.

    There are also new spatial functions available in Autonomous Database that can calculate the distance based on routing, as mentioned here : https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/sdo_gcdr-package-geocoding.html

    (Refer the function SDO_GCDR.ELOC_ROUTE_DISTANCE , but this function is available only with an Autonomous Database Serverless deployments)

    Note :

    If you like to know more about direct geometry support in OAC now, see the following videos :

    https://www.youtube.com/watch?v=8hiERGcx8vU (Visualizing Geometry Data Type)

    https://www.youtube.com/watch?v=Lz4TGatf-mc (Spatial Calculations)

    This feature will be part of OAS 2025.

    Regards,

    Gautam.

  • peacey
    peacey Rank 3 - Community Apprentice
    Answer ✓

    Many thanks for your reply. Fine with this - looking forward to OAS2025