Retrieve the start and end points of a polyline in Oracle

Strangely enough no such function exists (or at least I couldn’t find it).. PostGIS has ST_StartPoint and ST_EndPoint, SQL Server 2008 Spatial has STStartPoint and STEndPoint but not Oracle. It does however has SDO_LRS.GEOM_SEGMENT_START_PT and SDO_LRS.GEOM_SEGMENT_END_PT but this applies (it seems) only for measured polylines – and you need to have the full Oracle Spatial installed. With versions that only have Locator you are out of luck.

So putting my thrifty hat again, I put together 2 simple functions (with the very imaginative names get_start_point and get_end_point) that do just that and included them in the package. Functions should work with both 2D and 3D data. You can download the update “thrifty” package here (or from the box widget on the right).

About these ads

, ,

  1. #1 by Glaukon on November 10, 2014 - 16:18

    Cannot download the updated package file (pck_sdo_thrifty.pck) from the link you provided. Would you mind updating the link or putting the source code on the web page. Thanks in advance!

  2. #2 by Pano Voudouris on November 10, 2014 - 16:37

    I just tested the link and it works. Are you getting some sort of error message?

  3. #3 by Glaukon on November 11, 2014 - 10:52

    I’ve tried it again through my smartphone and it worked. It must have been the firewall then. Sorry for bothering you about this!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 153 other followers

%d bloggers like this: