Spatial (MOSC)

MOSC Banner

Calculating the Distance Between Points

edited Jan 6, 2011 8:44AM in Spatial (MOSC) 2 commentsAnswered ✓
Hi, I have a table testgis with columns id integer and loc sdo_geometry

I did the following :

insert into testgis values (1,sdo_geometry(2001,null,sdo_point_type (-85.335871,35.412591,null), null, null)); 

insert into testgis values (2,sdo_geometry(2001,null,sdo_point_type (-85.592933,35.113892,null), null, null)); 

commit;

insert into user_sdo_geom_metadata('testgis','LOC',mdsys.sdo_dim_array(mdsys.sdo_dim_element('Longitude',-180,180,3),mdsys.sdo_dim_element('Latitude',-90,90,3));

commit;

select sdo_geom.sdo_distance(a.loc, b.loc, .005,'UNIT=FOOT') from testgis a, testgis b where a.id = 1 and b.id = 2;

I get

0ra-13293 : cannot specify unit for geometry without a goereferenced SRID

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center