Upload
nikojim
View
213
Download
0
Embed Size (px)
Citation preview
8/19/2019 Spatial Primer
1/54
Oracle Spatial, Locator and Location Based ServicesA Primer
Rev 1.2February 2012
(Interim copy – clean to page 46)
Oracle Spatial Primer 1
8/19/2019 Spatial Primer
2/54
Oracle Spatial !ocator an" !ocation #a$e" Service$ – % &rimer
'opyrigt 200* 2012 Forbric 'omputer 'on$ulting !t".
%utor+ ,an$ Forbric
-i$ "ocument provi"e$ an intro"uction to te Spatial IS an" !ocation $upport provi"e" inOracle 'orporation tecnologie$.
-e in/ormation containe" in ti$ "ocument i$ $ubect to cange itout notice. I/ you /in" anyproblem$ in te "ocumentation plea$e report tem to u$ in riting. -i$ "ocument i$ notarrante" to be error/ree.
3uc o/ te in/ormation in ti$ "ocument i$ "erive" /rom te online "ocumentation /or OracleSpatial available at ttp+taiti.oracle.com an" /rom 5nterpri$e 5"ition in$tallation$ o/ teOraclei 7ataba$e ver$ion .2.0.1 Oracle 7ataba$e 10g ver$ion 10.2.0.2 Oracle 7ataba$e11g ver$ion 11.1.0.6 licen$e" un"er te Oracle 7eveloper8$ !icen$e a$ /oun" atttp+otn.oracle.com9 /ully licen$e" in$tallation$ o/ Oraclei 7ataba$e ver$ion .2.0.* Oracle7ataba$e 10g ver$ion 10.2.0.4 Oracle 7ataba$e 11g ver$ion 11.1.0.6 &er$onal 5"ition$ onte 3icro$o/t :in"o$ ;& &ro/e$$ional S&2 plat/orm9 a$ ell a$ te no/ee pro"uctionlicen$e$ o/ Oracle 7ataba$e 10g Relea$e 2 5
8/19/2019 Spatial Primer
3/54
Table of ContentsWhat is Oracle Spatial?..............................................................................................................................5
What are Oracle Location Based Services.................................................................................................5Demos, Documentation, Reerences and We! Sites.................................................................................. "
#irst source or an$thin%........................................................................................................................"
Documentation...................................................................................................................................... "
Recommended !oo&s............................................................................................................................ 'Demo and sample data.......................................................................................................................... '
Reerence and important (e! sites........................................................................................................)
Overvie( o Oracle*s O!+ect Relational technolo%$............................................................................... 1PL-SL?..............................................................................................................................................1
O!+ect /$pes........................................................................................................................................ 11
0ollections...........................................................................................................................................12/ools and /o$s......................................................................................................................................... 1
Data!ase.............................................................................................................................................. 1
ser 3nteraces rom Oracle................................................................................................................ 15
Oracle Spatial Data-O!+ect /$pes............................................................................................................ 1)
SDO46O76/R8............................................................................................................................. 1)#ields.............................................................................................................................................. 1)
7em!er #unctions..........................................................................................................................1)0onstructors....................................................................................................................................1)
Sin%le Point inormation.................................................................................................................19
Ordered sin%le-multi point, or implied line and pol$%on inormation............................................19eometr$ /$pes :SDO4/8P6;................................................................................................... 19
Basic eometries............................................................................................................................2
SDO4PO360/ :.......................................................... 2'SL-77 datat$pes........................................................................................................................ 2)
eometr$ Domain 3ndees.............................................................................................................29
Oracle Spatial Operators, 7ethods, #unctions and Procedures...............................................................@1Operators............................................................................................................................................. @1
eometr$ #unctions :some in Locator;..........................................................................................@2
Spatial =%%re%ate #unctions :some in Locator;.................................................................................. @@0oordinate S$stem su!pro%rams.........................................................................................................@
0atalo% Services or the We! :Spatial Option onl$;........................................................................... @"
eocodin% Pac&a%e :Spatial Option Onl$;.....................................................................................@'
Linear Reerencin% S$stem unctionalit$ :Spatial option onl$;.....................................................@97i%ration tilities :included in Locator;............................................................................................ 1
OpenLS Support :Spatial onl$;........................................................................................................... 2
Point 0loud Support :Spatial onl$;..................................................................................................... @Spatial =nal$sis and 7inin% :Spatial Option onl$;.............................................................................
/rian%ulated 3rre%ular
8/19/2019 Spatial Primer
4/54
eneral tilities.................................................................................................................................. )We! #eatures :Spatial Option onl$;.................................................................................................... 5
Locator vs Spatial.....................................................................................................................................51
Oracle Spatial Primer
8/19/2019 Spatial Primer
5/54
8/19/2019 Spatial Primer
6/54
Demos, Documentation, eferences and Web Sites
-ere are a lot o/ "emo$ an" "emo "ata available on te eb. -i$ "ocument ma@e$ u$e o/publicly available "emo$ ere po$$ible. -e /olloing i$ a li$t o/ recommen"e" $ource$.
First source for anything
Fir$t $pot to loo@ /or anyting relate" to Oracle Spatial or Oracle !ocator $oul" be te Spatialan" !ocation#a$e" Service$ portal on O-A at
ttp+.oracle.comtecnologypro"uct$$patialin"e
8/19/2019 Spatial Primer
7/54
Recommended books
1. &ro Oracle Spatial /or Oracle 7ataba$e 11g
by Ravi@ant ?. Hoturi %lbert o"/rin" 5uro #einat %pre$$9 2Rev 5" e"ition (October 2 200C)IS#A10+ 1>0>*C
2. &ro Oracle Spatial
by 5uro #einat %lbert o"/rin" Ravi@ant ?. Hotur %pre$$9 1 e"ition (Aovember 1> 2004)IS#A10+ 1>0>*
. Spatial 7ataba$e Sy$tem$+ 7e$ign Implementation an" &roect 3anagement
by %lbert H.:. Jeung . #rent ,allSpringer9 1 e"ition (Ganuary 16 200C)IS#A10+ 14020>2
4. Spatial 7ataba$e$+ :it %pplication to IS
by &ilippe Rigau>*60>**6
>. eo$patial %naly$i$
by 3icael G. "e Smit 3icael F. oo"cil" &aul %. !ongley-rouba"or &ubli$ing !t" (Aovember 1C 2006)IS#A10+ 10>**660*
6. 5
8/19/2019 Spatial Primer
8/54
Oracle Spatial Primer )
8/19/2019 Spatial Primer
9/54
Reference and important web sites
In/o $ite$+
&rimary portal+ ttp+.oracle.comtecnologypro"uct$$patialin"e
8/19/2019 Spatial Primer
10/54
Wh! bother?
For mo$t people te term rapical In/ormation Sy$tem conure$ up image$ o/ onlineelectronic map$ i/ it a$ any meaning at all. !ocation #a$e" Service$ a"" pu$pin$ /or te
%-3$ or re$taurant$ on to$e map$. &erap$ "riving "irection$. Or perap$ &S enable" inveicle "riving gui"ance $y$tem$.
In many ca$e$ a vi$ual map i$ u$e" an interme"iary to provi"e a vi$ual calculation $ur/ace.-e "ata $tore" in $ome /orm o/ "ataba$e ill be ren"ere" or "ran on a $creen an" ten$econ"ary tool$ or intuition ill be u$e" to per/orm $ome analy$i$.
,oever IS $y$tem$ !# $ervice$ an" Spatial tool$ can go Duite a bit /urter. In or"er toma@e "eci$ion$ organiBation$ an" in"ivi"ual$ o/ten a$@ to @in"$ o/ Due$tion$
!ocation+ :ere i$ $ometingM7i$tance+ :at o/ intere$t i$ near tat $ometingM
-e$e Due$tion$ o/ten ave un"erlying $econ"ary Due$tion$ /or te organiBation $uc a$P:at i$ te co$t or te paybac@ o/ "oing $ometingM8 P:o "o e nee" to contactM8an" te li@e.
Some e
8/19/2019 Spatial Primer
11/54
Overvie" of Oracle#s Ob$ect elational technolo%!
In or"er to or@ it Oracle Spatial an arcitect an a"mini$trator or a "eveloper $oul" avea rea$onable un"er$tan"ing o/ &!S=! an" o/ Oracle8$ ObectRelational implementation.Recommen"e" rea"ing /rom Oracle$ 7ataba$e "ocumentation inclu"e$+
Q&!S=! E$er$ ui"e an" Re/erenceQL %pplication 7eveloper$ ui"e Fun"amental$Q an"L %pplication 7eveloper$ ui"e ObectRelational Feature$L
PL/SQL?
&!S=! i$ Oracle8$ internal programming language. It a$ "evelope" in te 1*0$ an" i$ba$e" on te %7% programming language ic a$ a lea"ing language reDuire" by te ESovernment8$ Fe"eral In/ormation &roce$$ing Stan"ar" (FI&S) at te time.
Some @ey element$ o/ &!S=! inclu"e• "eclaration$ o/ variable$ an" con$tant$ ic are te "ata an" re/erence$ to "ata
• operator$ u$e" to manipulate te "ata
• $tatement$ o/ operation$ an"or action$
• bloc@$ u$e" to group $tatement$ an" "e/ine program unit$
• pac@age$ u$e" to group program unit$ an" $upporting $tructure$.
&!S=! program$ can be anonymou$ or tey may be name" an" $tore" in te "ataba$e oroter &!S=!enable" tool. Store" &!S=! program$ may be organiBe" a$ in"epen"entproce"ure$ /unction$ or bloc@$ /or u$e in trigger$ or tey may be groupe" into pac@age$.
Since Oracle* te Oracle "ataba$e al$o $upport$ $tore" Gava program$ an" provi"e$ amecani$m to acce$$ $tore" Gava program$ /rom &!S=!.
&!S=! i$ u$e" to• provi"e proce"ure$ tat per/orm "ata an" "ataba$e manipulation
• provi"e acce$$ to Gava cla$$e$ tat can per/orm "ata an" "ataba$e manipulation
• e
8/19/2019 Spatial Primer
12/54
b!ect "ypes
-e ability to e
8/19/2019 Spatial Primer
13/54
#ollections
% collection i$ an or"ere" group o/ element$. -e element$ can be native type$ or E7-$ a$"e$cribe" above. -i$ concept u$e" in tra"itional programming tat encompa$$e$ li$t$array$ an" te li@e. For eac implementation tere i$ a $peci/ic meto" or co"ing $tyle to
acce$$ in"ivi"ual element$.
&!S=!8$ ba$ic collection type$ are+
• Associative arra!s al$o @non a$ inde&'b! tables let you loo@ up element$ u$ingarbitrary number$ an" $tring$ /or $ub$cript value$. (-ey are $imilar to hash tables inoter programming language$.)
• (ested tables ol" an arbitrary number o/ element$. -ey u$e $eDuential number$ a$$ub$cript$. Jou can "e/ine eDuivalent S=! type$ alloing ne$te" table$ to be $tore" in"ataba$e table$ an" manipulate" troug S=!.
• Aarra$s ($ort /or variable$iBe array$) ol" a /i
8/19/2019 Spatial Primer
14/54
Oracle Spatial Primer 1
1 ECLARE
2 TYPE $/_#a/$_r$c i& RECOR ( 3 ir&t#a/$ $/!y$$&4ir&t_#a/$TYPE, 6 a&t#a/$ $/!y$$&4a&t_#a/$TYPE, 5 ir$dat$ $/!y$$&4ir$_dat$TYPE
7 ).8 9 :: Array ty$ tat ca# !d i#!r/ati!# 10 $/!y$$& ; TYPE E/Li&t_arr +S VARRAY(10) O $/_#a/$_r$c. 10 S$#i!rSa$&$!$ E/Li&t_arr. 11 12 :: $car$ a c%r&!r t! &$$ct a &%&$t ! c!%/#&4 13 CRSOR c1 +S SELECT ir&t_#a/$, a&t_#a/$, ir$_dat$ 16 RO' $/!y$$&. 15 Ty$ *a/$S$t +S TABLE O c1RO S$#i!rT$#4LAST. 29 E* +. 2; OR i i# 144E#dC!%#t$r LOOP 30 S$#i!rSa$&$!$4ETE*(1). 31 S$#i!rSa$&$!$(i) => S$#i!rT$#(i). 32 B'S_OTPT4PT_L+*E(S$#i!rSa$&$!$(i)4a&t#a/$ FF
33 , FF 36 S$#i!rSa$&$!$(i)4ir&t#a/$ FF , FF 35 S$#i!rSa$&$!$(i)4ir$dat$). 37 E* LOOP. 38 E* +. 39 E*. 3; G
8/19/2019 Spatial Primer
15/54
Tools and To!s
Database
Oracle Spatial an" Oracle !ocator are implemente" a$ obectrelational type$ it a$$ociate"
pac@age$ an" meto"$. !ocator i$ a $ub$et o/ Spatial an" i$ 100V compatible it Spatial.
Spatial i$ inclu"e" in te licen$e /or &er$onal 5"ition an" i$ an option to te 5nterpri$e 5"itiono/ all ver$ion$ $ince Oracle *i a$ intro"uce". -e recommen"e" ver$ion$ are
)ersion *+ S+ S+- ++ P+
Oracle*i 7ataba$e Relea$e *.1.C.4 J J
Oraclei 7ataba$e Relea$e 2 .2.0.* J J
Oracle 7ataba$e 10g Relea$e 2 10.2.0.4 J J
Oracle 7ataba$e 11g Relea$e 1 11.1.0.6 J J
Oracle 7ataba$e 11g Relea$e 2 11.2.0. J J
Table 1: Database Releases and Editions that include Oracle Spatal Option
!ocator a$ intro"uce" it Oracle*i a$ part o/ te inter3e"ia /eature $et to allo te"ataba$e to an"le Pinternet8 "ata type$. inter3e"ia i$ inclu"e" it all e"ition$ o/ te"ataba$e. -e recommen"e" ver$ion$ o/ te "ataba$e are 7ataba$e Relea$e ?er$ion ;5S5(1)55 &5
)ersion *+ S+ S+- ++ P+
Oracle*i 7ataba$e Relea$e *.1.C.4 J J J
Oraclei 7ataba$e Relea$e 2 .2.0.* J J J
Oracle 7ataba$e 10g Relea$e 25
8/19/2019 Spatial Primer
16/54
$ser %nterfaces from racle
S=!&lu$ ba$ic a"mini$tration an" manipulation (O-A)S=!7eveloper (v 1.>) ba$ic a"mini$tration an" manipulation (O-A)eoraptor a""in $patial e
8/19/2019 Spatial Primer
17/54
Oracle Spatial Basics
Oracle Spatial i$ a $et o/ Obect -ype$ meto"$ pac@age$ /unction$ an" proce"ure$. -e$emay be groupe" a$
#a$ic eometry repre$ente" a$
• Single point in/ormation in 2 or "imen$ion$
• !ine an" &olygon in/ormation in 2 an" "imen$ion$ repre$ente" by an or"ere"
collection o/ point$ it implie" $traigt or curve" line $egment$ beteen point$• Function$ to calculate geometryrelate" propertie$ $uc a$ lengt an" area o/ one
obect "i$tance beteen multiple obect$ topological relation$ip beteen obect$an" te li@e
eore/erence" eometry u$ing te above but re/erence" to @non coor"inate $y$tem$
• E$ing te ba$ic eometry an" a""ing a Spatial Re/erence I7 to $elect te appropriate
coor"inate $y$tem• Obect geometry conver$ion$ beteen coor"inate $y$tem$
• !inear Re/erencing engineering e
8/19/2019 Spatial Primer
18/54
Oracle Database --% a""$ /ull "imen$ional $upport an" $upport /or -riangulate" IrregularAetor@$ an" &oint 'lou"$
/eature0Capabilit! Oracle1i Oracl2i Oracle-.% Oracle --%27 eometry J J J J
7 eometry J J J
!RS J J
eoco"ing J J
-opology J J
Aetor@ J J
eoRa$ter J J
3ap?ieer J J-riangulate" Irregular Aetor@$ J
&oint 'lou"$ J
Table 3: Features Introduced by Version
Oracle Spatial Primer 1)
8/19/2019 Spatial Primer
19/54
Oracle Spatial Data SDO34+O5+T6
-i$ i$ te ba$ic obect type u$e" trougout Oracle Spatial an" Oracle !ocator. It con$i$t$ o/> /iel"$ an" a number o/ meto"$.
Fields
/ield Definition Oracle2i Oracle-.% Oracle--%
S7O-J&5 AE3#5R J J J
S7OSRI7 AE3#5R J J J
S7O&OIA- S7O&OIA--J&5 J J J
S7O5!53IAFO S7O5!53IAFO%RR%J J J J
S7OOR7IA%-5S S7OOR7IA%-5%RR%J J J JTable : Fields in SDO!"EO#ETR$
&ember Functions
5ember/unction eturns Oracle2i Oracle-.% Oracle--%
5--J&5 AE3#5R J J J
5-7I3S AE3#5R J J J
5-!RS7I3 AE3#5R J J J
5-:H# #!O# J J
5-:H- '!O# J J
S-'oor"7im S3%!!IA- J J
S-I$?ali" IA-55R J J
Table %: #e&ber Functions in SDO!"EO#ETR$
Oracle Spatial Primer 19
8/19/2019 Spatial Primer
20/54
#onstructors
Basic for Oracle8i, Oracle9i, Oracle Database 10g, Oracle Database 11g
CO*STRCTOR *CT+O* SO_?EO'ETRY (&d!_ty$ +* +*TE?ER,&rid +* +*TE?ER EALT *LL,!i#t +* SO_PO+*T_TYPE,$$/$#t_i#!_array +* SO_ELE'_+*O_ARRAY,!rdi#at$_array +* SO_OR+*ATE_ARRAY)
New in Oracle Database 10g
CO*STRCTOR *CT+O* SO_?EO'ETRY(I-t +* CLOB,&rid +* +*TE?ER EALT *LL)
CO*STRCTOR *CT+O* SO_?EO'ETRY(I-t +* VARCHAR2,&rid +* +*TE?ER EALT *LL)
CO*STRCTOR *CT+O* SO_?EO'ETRY(I- +* BLOB,&rid +* +*TE?ER EALT *LL)
Sin%le Point information
% $ingle point may be $tore" eiter in te S7O&OIA- /iel" or te S7OOR7IA%-5S array. I/$tore" in te S7O&OIA- ten te S7O5!535A-IAFO array an" te S7OOR7IA%-5Sarray mu$t be empty. -e $ingle point in/ormation may con$i$t o/ 2 or "imen$ion$ a$"e/ine" by te -J&5.
&rior to Oracle 7ataba$e 11g only te /ir$t 2 "imen$ion$ are u$e" in lengt an" "i$tancecalculation$ a$ Oraclei an" Oracle 7ataba$e 10g only provi"e $torage /or 7 but not /ull7 /unctionality.
Ordered sin%le0multi point, or implied line and pol!%on information
3ultiple point$ point clou"$ line$ (ic imply lengt) polygon$ (ic imply area) polygon$it voi"$ are $tore" a$ or"ere" $et$ o/ point$ in te S7OOR7IA%-5S array.
Since tere may be multiple or"ere" $et$ in te $ingle array an" $ince eac o/ te$e mayave "i//erent purpo$e$ te S7O5!535A-IAFO i$ u$e" to "e$cribe te $tart o/ eacor"ere" $et an" te "e/inition o/ te $et. % $peci/ic or"ere" $et i$ terminate" en te ne
8/19/2019 Spatial Primer
21/54
'eometry "ypes (SD)'"*P+,
-e /ir$t /iel" i$ te eometry type. It "e/ine$ at @in" o/ geometry an" tere/ore icmeto"$ an" /unction$ may be u$e". :en intro"uce" in Oracle*i *.1.> it $imply "e/ine" tegeometry.
Starting it Oracle*i *.1.C te -J&5 a$ been overloa"e" to inclu"e o many"imen$ion$ are to be $tore" an" eter !inear Re/erence in/ormation i$ to be $tore". -eterm P7imen$ion$8 i$ mi$lea"ing a$ it really repre$ent$ te amount o/ $torage (o manyentrie$ in te array) are u$e" to $tore te in/ormation about one point.
For a 2 "imen$ional geometry to number$ ill $tore te po$ition o/ a point an" i/ !RS i$u$e" a tir" number ill be u$e" to $tore te !RS Pmea$ure8 or value to be recor"e" /or tatpoint. So a 27 line it !RS oul" contain (
3ultiline 6
3ultipolygon C
Soli" *
3ulti$oli"
Table ': (asic "eo&etries
Oracle Spatial Primer 21
8/19/2019 Spatial Primer
22/54
SDO34T6P+
-e S7O-J&5 value$ buil" on te ba$ic -ype previou$ly "e$cribe". %$ o/ Oraclei teS7O-J&5 i$ co"e" a$ 4 "igit$ te /ir$t "igit repre$enting te number o/ or"inate$ to u$eitin a coor"inate an" te la$t "igit i"enti/ying te eometry type /orm te above table.
Oracle Spatial Primer 22
8/19/2019 Spatial Primer
23/54
4eometr! 1i 4T6P+ 4T6P+ Definition
En@non 0 "l00 7N24 /or 2 or 4 P"imen$ion$8 tat areinterprete" by te calling program but notinterprete" by Oracle Spatial
&oint 1 2001 27 point (
8/19/2019 Spatial Primer
24/54
4eometr! 1i 4T6P+ 4T6P+ Definition
Soli" "l0* %n enclo$e" volume con$i$ting o/ multiple$ur/ace$. 'an be a cuboi" or /u$trum
3ulti$oli" "l0 -e geometry a$ multiple $oli"$.
Table ): SDO!"T$*Es as o+ Oracle,i-
(umber of ordinates in a Spatial ob$ect
&rior to Oracle 7ataba$e 11g Relea$e 2 eac geometry i$ limite" to 104*>C6 or"inate$.5ac 27 point u$e$ 2 coor"inate$. % 7 point u$e$ coor"inate$ an" !RS u$e$ one or"inate$lot per point. -ere/ore a 7 polygon it !RS i$ limite" to about W million point$.
%$ o/ Oracle 7ataba$e 11g Relea$e 2 it i$ po$$ible to convert eac geometry to $uport104*>C60 or"inate$. %gain eac 27 point u$e$ 2 coor"inate$ eac 7 point u$e$ coor"inate$ an" !RS u$e$ one or"inate $lot per point. -ere/ore a 7 polygon it !RS i$
limite" to about million point$. ,oever /or bac@ar" compatibility 11g Relea$e 2 "e/ault$to u$ing te $ame 1 million or"inate$ /rom previou$ relea$e$.
SD)P%-" definition
-i$ /iel" may be u$e" i/ te "ata to be $tore" in a $imple 2 or "imen$ional point. -e /iel"i$ "e/ine" a$ an S7O&OIA--J&5 ic i$
cr$at$ !r r$ac$ TYPE SO_PO+*T_TYPE AS OBJECT ( *'BER,Y *'BER,
*'BER)
:en $imple point$ are to be manage" ti$ can be $igni/icantly /a$ter to u$e tan te /ormalS7OOR7IA%-5S array. ,oever "irection can not be a$$ociate" it te point.
+*SERT +*TO d$/! VALES(;0,!i#t_!#y,SO_?EO'ETRY(
2001,*LL,SO_PO+*T_TYPE(12, 16, *LL),*LL,
*LL)).
Oracle Spatial Primer 2
8/19/2019 Spatial Primer
25/54
SD)+L+&+-")%-F definition
-i$ /iel" "e$cribe$ te content$ an" $peci/ic u$e o/ te S7OOR7IA%-5 array ($een ne
8/19/2019 Spatial Primer
26/54
+lementT!pe
7nterp Description8 Oracle2Database
OracleDatabase
-.%
OracleDatabase
--%
0 n 5
8/19/2019 Spatial Primer
27/54
+lementT!pe
7nterp Description Oracle2Database
OracleDatabase
-.%
OracleDatabase
--%
&olygon$
100 1 &olygon it $traigt line$egment$. !a$t point mu$t matc
te /ir$t (itin tolerance) to clo$ete area. &oint$ are '': an" ti$contribute$ (a""$) to te total area.
SO_?EO'ETRY(2003,*LL,*LL,SO_ELE'_+*O_ARRAY(1,1003,1),SO_OR+*ATE_ARRAY(5,2, 7,2, 8,5, 5,7, 8,9, 5,9, 5,2))
J J J
200 1 % ?oi". &olygon a$ in 100 butte point$ mu$t rotate 'loc@i$e.-i$ $ubtract$ /rom te area.
S7O5O35-RJ(200AE!!AE!!
S7O5!53IAFO%RR%J(12001)S7OOR7IA%-5%RR%J(10> *> * 10 10> ))
J J J
100 2 &olygon it arc $egment$. (Seearc line). 'ounter cloc@i$e areaa""ing. Remember te triplet$.
S7O5O35-RJ(200AE!!AE!!S7O5!53IAFO%RR%J(11002)S7OOR7IA%-5%RR%J(10> *> * 10 10> ))
J J J
200 2 &olygon voi" it arc $egment$.(See arc line). 'loc@i$e area$ubtracting.
S7O5O35-RJ(200AE!!AE!!S7O5!53IAFO%RR%J(12002)S7OOR7IA%-5%RR%J(10> *> * 10 10> ))
J J J
100 %reaa""ing OptimiBe" rectangle.Aee"$ only 2 point$ (loer le/tupper rigt).
S7O5O35-RJ(200AE!!AE!!S7O5!53IAFO%RR%J(1100)
S7OOR7IA%-5%RR%J(>> 1010))
J J J
200 %rea$ubtracting OptimiBe"rectangle. Aee"$ only 2 point$(loer le/t upper rigt).
S7O5O35-RJ(200AE!!AE!!S7O5!53IAFO%RR%J(1200)
J J J
Oracle Spatial Primer 2'
8/19/2019 Spatial Primer
28/54
+lementT!pe
7nterp Description Oracle2Database
OracleDatabase
-.%
OracleDatabase
--%
S7OOR7IA%-5%RR%J(1111 66))
100 4 %reaa""ing optimiBe" circle.
ReDuire$ point$ on tecircum/erence o/ circle.
S7O5O35-RJ(200AE!!AE!!S7O5!53IAFO%RR%J(1200)S7OOR7IA%-5%RR%J(1111 66))
J J J
200 4 %rea$ubtracting optimiBe" circle.ReDuire$ point$ on tecircum/erence o/ circle.
S7O5O35-RJ(200AE!!AE!!S7O5!53IAFO%RR%J(1200)S7OOR7IA%-5%RR%J(1111 66))
J J J
'ompoun" !ine String
4 n % $et o/ Pn8 line$ $egment$ eacaving it$ on type P28 element"e/inition.
S7O5O35-RJ(2002AE!!AE!!S7O5!53IAFO%RR%J(142121 $traigt22) curve"S7OOR7IA%-5%RR%J(1010 1014 610 1410))
J J J
'ompoun" &olygon
100>200>
n % $et o/ Pn8 line $egment$ eacaving it$ on type P28 element"e/inition te la$t point clo$ing tote /ir$t point to create a polygon.
-e 100> polygon a""$ area to tetotal erea$ te 200> polygon i$a voi" or ole an" $ubtract$ /romte total area.
J J J
Sur/ace
10062006
n % $et o/ Pn8 polygon$ tat ma@e upa $ur/ace. -e in"ivi"ual polygon$may be type
8/19/2019 Spatial Primer
29/54
+lementT!pe
7nterp Description Oracle2Database
OracleDatabase
-.%
OracleDatabase
--%
$oli" te 1006 $ur/ace a""$ to tevolume an" te 2006 $ur/ace i$u$e" to create a ole in te $oli".
Soli" or volume
100C n % $oli" tat con$i$t$ o/ Pn8 $ur/ace$.:en calculating volume all 1006$ur/ace$ a"" to te total volumean" 2006 $ur/ace are u$e" to buil"ole$.
n n J
100C OptimiBe" bo
8/19/2019 Spatial Primer
30/54
SDO34+O5+T6 definition
For Oracle8i through Oracle Database 11g Release 1, the definition is.
create or replace TYPE SDO_GEOMETRY AS OBJECT (
SDO_GTYPE NUMBER,SDO_SRID NUMBER,SDO_POINT SDO_POINT_TYPE,SDO_ELEM_INFO SDO_ELEM_INFO_ARRAY,SDO_ORDINATES SDO_ORDINATE_ARRAY,MEMBER FUNCTION GET_GTYPERETURN NUMBER DETERMINISTIC,MEMBER FUNCTION GET_DIMSRETURN NUMBER DETERMINISTIC,MEMBER FUNCTION GET_LRS_DIMRETURN NUMBER DETERMINISTIC)
ALTER TYPE SDO_GEOMETRYADD MEMBER FUNCTION GET_WKB RETURN BLOB DETERMINISTIC,ADD MEMBER FUNCTION GET_WKT RETURN CLOB DETERMINISTIC,
ADD MEMBER FUNCTION ST_CoordDim RETURN SMALLINT DETERMINISTIC,ADD MEMBER FUNCTION ST_IsValid RETURN INTEGER DETERMINISTIC,ADD CONSTRUCTOR FUNCTION SDO_GEOMETRY(wkt IN CLOB,
srid IN INTEGER DEFAULT NULL) RETURN SELF AS RESULT,ADD CONSTRUCTOR FUNCTION SDO_GEOMETRY(wkt IN VARCHAR2,
srid IN INTEGER DEFAULT NULL) RETURN SELF AS RESULT,ADD CONSTRUCTOR FUNCTION SDO_GEOMETRY(wkb IN BLOB,
srid IN INTEGER DEFAULT NULL) RETURN SELF AS RESULTCASCADE
create or replace TYPE SDO_POINT_TYPE AS OBJECT (X NUMBER,Y NUMBER,Z NUMBER)
create or replace TYPE SDO_ELEM_INFO_ARRAY AS
VARRAY (1048576) of NUMBER
create or replace TYPE SDO_ORDINATE_ARRAY ASVARRAY(1048576) OF NUMBER
/he principal chan%e in the 11% Release 2 deinition is the increase in ordinates rom 1 million to 1million in the varra$.
Oracle Spatial Primer @
8/19/2019 Spatial Primer
31/54
S9L055 datat!pes
-e S-5O35-RJ i$ ne to Oracle 7ataba$e 11g. It provi"e$ compatibility it te ISOS=!33 $tan"ar". -e ba$ic type$ an" ineritance$ are
S-5O35-RJ
S-!IA5S-RIAS-'IR'E!%RS-RIAS-'O3&OEA7'ER?5S-'ER?5 S-SERF%'5S-'ER?5&O!JOAS-5O3'O!!5'-IOAS-3E!-I'ER?5S-3E!-I&OIA-S-3E!-ISERF%'5
S-&oint
cr$at$ !r r$ac$ TYPE ST_?EO'ETRY AS OBJECT (?EO' SO_?EO'ETRY,
Oracle Spatial Primer @1
8/19/2019 Spatial Primer
32/54
4eometr! Domain 7nde&es
-o "imen$ional rectangle$ may be "e/ine" u$ing 2 point$ in oppo$ing corner$. %ny rectanglemay be "e/ine" it a total o/ 4 or"inate$.
In"eNTRE F ALSE (%&$ &$ $a t)&d!_rdr_ctr$$>N0:50, d$ 10 (i#d$K PCTREE)
/* these are used to create the domain table */
ta$ac$>Qi#itia>Q #$Kt>Q /i#$Kt$#t&>Q 'aK$Kt$#t&>Q
Pcti#cr$a&$>QQ (!r cr$ati# t$/ ta$&)) M
N *OPARALLEL F PARALLEL i#t$$r M M.
Special con$i"eration$ /or $patial in"e
8/19/2019 Spatial Primer
33/54
Spatial 5etadata
5ac o/ te maor obect type$ S7O5O35-RJ S7O-O&O5O35-RJ an" $o ona$ a$$ociate" meta"ata. -i$ meta"ata i$ u$e" by te variou$ meto"$ /unction$ an"proce"ure$ to "etermine te "e/ault con"ition$ reDuire" /or operation$ $uc a$ coor"inate
$y$tem tran$/ormation$.
$S+R)SD)'+&)&+".D.".
E$e" to i"enti/y eac $patial (IS) layer. 3any (mo$t) program$ ill not or@ itout ti$meta"ata. %l$o u$e" by operator$ to a$$ociate a $patial in"e< to te layer to permit $patialoperator /iltering. -e "e/inition$ in Oracle 7ataba$e 11g are
Cr$at$ Ty$ SO_+'_ELE'E*T a& OBJECT (SO_+'*A'E VARCHAR2(76),SO_LB *'BER,
SO_B *'BER,SO_TOLERA*CE *'BER).
CREATE TABLE 'SYS4SO_?EO'_'ETAATA_TABLE( SO_O
8/19/2019 Spatial Primer
34/54
Oracle Spatial Operators, 5ethods, /unctions and Procedures
perators
Operator$ are u$e" OA!J in te :,5R5 clau$e. -ey u$e Spatial In"e
8/19/2019 Spatial Primer
35/54
Operator Oraclei Oracle 7ataba$e 10g Or
S7OFI!-5R J J J
S7OGOIA J J
S7OAA J J J
S7OAA7IS-%A'5 J J J
S7OR5!%-5 J J J
S7O:I-,IA7IS-%A'5 J J J
!O'%-OR:I-,IA7IS-%A'566 J
-e /olloing are convenience operator$ to $impli/y common S7OR5!%-5 u$age
S7O%AJIA-5R%'- . J J
S7O'OA-%IAS . J J
S7O'O?5R57#J . J J
S7O'O?5RS . J J
S7O5=E%! . J J
S7OIASI75 . J J
S7OOA . J J
S7OO?5R!%J7ISGOIA- . J J
S7OO?5R!%JIA-5RS5'- . J J
S7OO?5R!%&S . J J
S7O-OE', . J J
Table ,: Spatial Operators
'eometry Functionseometry /unction$ are "etermini$tic an" may be u$e" a$ e
8/19/2019 Spatial Primer
36/54
4eometr! /unctionSDO34+O5+T6:;func<
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
R5!%-5 varc n J n J J
S7O%R'75ASIFJ geom n J n J J
S7O%R5% num n J n J J
S7O#EFF5R geom n J n J J
S7O'5A-ROI7 geom n J n J J
S7O'!OS5S-&OIA-S num na J
S7O'OA?5;,E!! geom n J n J J
S7O7IFF5R5A'5 geom n J n J J
S7O7IS-%A'5 num J J J J J
S7OIA-5RS5'-IOA geom n J n J J
S7O!5A-, num n J n J J
S7O3%;3#ROR7IA%-5 num n J n J J
S7O3#R geom n J n J J
S7O3IA3#ROR7IA%-5 num n J n J J
S7O&OIA-OASERF%'5 geom n J n J J
S7OEAIOA geom n J n J J
S7O?O!E35 na J
S7O;OR geom n J n J J
?%!I7%-55O35-RJ varc J J n < <
?%!I7%-55O35-RJ:I-,'OA-5;- varc J J J J J
?%!I7%-5!%J5R varc J J n < <
?%!I7%-5!%J5R:I-, 'OA-5;-
varc J J J J J
:I-,IA7IS-%A'5 varc n J n J J
Table 10: Spatial Functions so&e o+ hich are in Locator
8/19/2019 Spatial Primer
37/54
A%%re%ate /unctions=(ot in a pac>a%e
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
S7O%R'5A-ROI7 geom n J n J J
S7O%R'OA'%-!IA5S geom n J J
S7O%R'OA?5;,E!! geom n J n J J
S7O%R!RS'OA'%- geom n J n J J
S7O%R3#R geom n J n J J
S7O%REAIOA geom n J n J J
Table 11: Functions that operate on or return areates
create or replace type SDOAggrType as Object (
Geometry mdsys.sdo_geometry,Tolerance NUMBER)
#oordinate System subprograms
-e$e $ubprogram$ are u$e" to convert beteen coor"inate $y$tem$ $uc a$ &roecte" an"eo"etic $y$tem$ or beteen "i//erent &roecte" $y$tem$ an" te li@e.
:it Oracle 7ataba$e 10g te tran$/ormation$ e
8/19/2019 Spatial Primer
38/54
Coordinate TransformSDO3CS:;func<
T!pe Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
-R%ASFOR3 Funct n J J J J
-R%ASFOR3!%J5R &roc n J J J J
?I5:&OR--R%ASFOR3 Funct J J < < <
-e /olloing ere intro"uce" in Oracle 7ataba$e 10g or iger to an"le a""itional coor"inate $y$tem$tan"ar"$ O' 5&S an" $o on.
%77&R5F5R5A'5FORO& n J J
'OA?5R-A%7'OA-O;3! n J J
'OA?5R-A-?2-O;3! n J J
'OA?5R-;3!-OA%7'OA n J J
'OA?5R-;3!-OA-?2 n J J
'R5%-5'OA'%-5A%-5O& n J J
'R5%-5O#?IOES5&SRE!5S n J J
'R5%-5&R5F'OA'%-5A%-57O& n J J
75!5-5%!!5&SRE!5S n J J
75!5-5O& n J J
75-5R3IA5',%IA n J J
75-5R3IA575F%E!-',%IA n J J
FIA75O'RS n J J
FIA7&ROG'RS n J J
FRO3O'SI3&!5F5%-ER5SRS n J J
FRO3ESA J
5-5&S7%-%?5RSIOA J
3%H527 J
3%H57 J
3%&5&SSRI7-OOR%'!5 n J J
3%&OR%'!5SRI7-O5&S n J J
R5?OH5&R5F5R5A'5FORO& n J J
!ocator Spatial !ocator Spatial !ocator Spatial
- OO'SI3&!5F5%-ER SRS n J J
E&7%-5:H-SFOR%!!5&S'RS
n J J
E&7%-5:H-SFOR5&S'RS
n J J
E&7%-5:H-SFOR5&S7%-E3
n J J
E&7%-5:H-SFOR5&S5!!I&S
n J J
E&7%-5:H-SFOR5&SO& n J J
Oracle Spatial Primer @)
8/19/2019 Spatial Primer
39/54
Coordinate TransformSDO3CS:;func<
T!pe Oracle2i Database OracleDatabase -.%
OracleDatabase --%
E&7%-5:H-SFOR5&S&%R%3
n J J
E&7%-5:H-SFOR5&S&3 n J J
?%!I7%-5:H- n J J
Table 12: *rocedures and +unctions related to coordinate syste&
#atalog Ser0ices for the 1eb (Spatial ption only,
-e$e /unction$ ere intro"uce" in Oracle 7ataba$e 11g
Catalo% Web Services /unctions5DS6S:SDO3CSW3POC+SS
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
7elete'apabilitie$In/o J
7elete7omainIn/o J
7elete&lugin3ap J
7eleteRecor"?ie3ap J
etRecor"-ypeI" J
In$ert'apabilitie$In/o J
In$ert7omainIn/o J
In$ert&lugin3ap
In$ertRecor"?ie3ap
In$ertRt7ataEp"ate"
In$ertRt37Ep"ate"
Table 13: 4atalo Ser5ices +or the 6eb 7Spatial Option only8
Oracle Spatial Primer @9
8/19/2019 Spatial Primer
40/54
'eocoding Package (Spatial ption nly,
-e eoco"ing pac@age a$ intro"uce" in Oracle 7ataba$e 10g. It reDuire$ $upportingtable$ ic mu$t be loa"e" it "ata not $upplie" by Oracle. In a""ition to te S7O'7Rpac@age Oracle Spatial inclu"e$ relate" /unctionality in te ava pac@age$.
-e parameter$ an" return value$ o/ten inclu"e one or more o/ • S7OH5J:OR7%RR%J ic i$ a varray o/ $tring$ (varcar2) tat may $tore
arbitrarily /ormatte" a""re$$ in/ormation9• S7O5O%77R obect type$ ic contain$ te S7O H5J:OR7%RR%J an" te
$tructure" re$ult$ /rom te analy$i$9• S7O%77R%RR%J varray o/ S7O5O%77R obect$.
4eocodin% /unctionsSDO34CD:;<
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
5O'O75 J J
5O'O75%77R J J
5O'O75%77R%!! J J
5O'O75%!! J J
5O'O75%S 5O35-RJ J J
R5?5RS55O'O75 J J
Table 1: "eocodin *ac9ae 7Spatial Option Only8
create or replace type SDO_keywordArray asVARRAY(10000) of VARCHAR2(9000)
create or replace type SDO_geo_addr as object (id NUMBER,addresslines SDO_KEYWORDARRAY,placeName VARCHAR2(200),streetName VARCHAR2(200),intersectStreet VARCHAR2(200),secUnit VARCHAR2(200),settlement VARCHAR2(200),municipality VARCHAR2(200),region VARCHAR2(200),
country VARCHAR2(100),postalCode VARCHAR2(20),postalAddonCode VARCHAR2(20),fullPostalCode VARCHAR2(40),poBox VARCHAR2(100),houseNumber VARCHAR2(100),baseName VARCHAR2(200),streetType VARCHAR2(20),streetTypeBefore VARCHAR2(1),
Oracle Spatial Primer
8/19/2019 Spatial Primer
41/54
streetTypeAttached VARCHAR2(1),streetPrefix VARCHAR2(20),streetSuffix VARCHAR2(20),side VARCHAR2(1),percent NUMBER,edgeId NUMBER,errorMessage VARCHAR2(20),matchcode NUMBER,matchmode VARCHAR2(30),
longitude NUMBER,latitude NUMBER,matchVector VARCHAR2(20),
CONSTRUCTOR FUNCTION SDO_GEO_ADDRRETURN SELF AS RESULT,
CONSTRUCTOR FUNCTION SDO_GEO_ADDR(country VARCHAR2, lines SDO_KEYWORDARRAY, matchmode VARCHAR2)
RETURN SELF AS RESULT,
CONSTRUCTOR FUNCTION SDO_GEO_ADDR(country VARCHAR2, matchmode VARCHAR2,street VARCHAR2,settlement VARCHAR2, municipality VARCHAR2, region VARCHAR2,postalcode VARCHAR2)
RETURN SELF AS RESULT,
CONSTRUCTOR FUNCTION SDO_GEO_ADDR(id NUMBER, addresslines SDO_KEYWORDARRAY, placeName VARCHAR2,streetName VARCHAR2, intersectStreet VARCHAR2,secUnit VARCHAR2, settlement VARCHAR2,municipality VARCHAR2, region VARCHAR2,country VARCHAR2, postalCode VARCHAR2,postalAddonCode VARCHAR2, fullPostalCode VARCHAR2,poBox VARCHAR2, houseNumber VARCHAR2,baseName VARCHAR2, streetType VARCHAR2,streetTypeBefore VARCHAR2,streetTypeAttached VARCHAR2, streetPrefix VARCHAR2,streetSuffix VARCHAR2, side VARCHAR2,percent NUMBER, edgeId NUMBER,errorMessage VARCHAR2, matchcode NUMBER,
matchmode VARCHAR2, longitude NUMBER, latitude NUMBER)RETURN SELF as RESULT
Oracle Spatial Primer 1
8/19/2019 Spatial Primer
42/54
Linear Referencing System functionality (Spatial option only,
!RS a""$ a Pmea$ure8 to eac coor"inate giving bot "irection an" relative "i$tance to tecoor"inate$ o/ a geometry. 5
8/19/2019 Spatial Primer
43/54
LS /unctionsSDO3LS:;func<
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
'reate an" 5"it !RS eometry
'!I&5O3S535A- J J J
'OA'%-5A%-55O3S535A-S J J J
75FIA55O3S535A- &roc J J J7JA%3I'S535A- J J J
!RSIA-5RS5'-IOA J
OFFS5-5O3S535A- J J J
R575FIA55O3S535A- &roc J J J
R5S5-35%SER5 J J
R5?5RS55O35-RJ J J J
R5?5RS535%SER5 J J J
S'%!55O3S535A- J < <
S5-&-35%SER5 J J
S&!I-5O3S535A- &roc J J J
-R%AS!%-535%SER5 J J J
=uery an" vali"ate !RS eometry
'OAA5'-575O3S535A-S J J J
FIA7!RS7I3&OS J J J
FIA735%SER5 J J J
FIA7OFFS5- J J
5O3S535A-5A7 35%SER5 J J J
5O3S535A-5A7&- J J J
5O3S535A-!5A-, J J J
5O3S535A-S-%R-35%SER5 J J J
5O3S535A-S-%R-&- J J J
5-35%SER5 J J J
5-A5;- S,%&5&- J J
5-A5;- S,%&5&- 35%SER5 J J
5-&R5? S,%&5&- J J
5-&R5?S,%&5&-35%SER5 J J
IS5O3S535A-75FIA57 J J
IS35%SER575'R5%SIA J J
IS35%SER5IA'R5%SIA J J
ISS,%&5&-35%SER5 J J
!O'%-5&- J J J35%SER5R%A5 J J J
35%SER5-O&5R'5A-%5 J J J
&5R'5A-%5-O35%SER5 J J J
&ROG5'-&- J J J
?%!I75O3S535A- J J J
?%!I7!RS&- J J J
Oracle Spatial Primer @
8/19/2019 Spatial Primer
44/54
LS /unctionsSDO3LS:;func<
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
?%!I735%SER5 J J J
?%!I7%-5!RS5O35-RJ J J
'onvert beteen !RS an" Stan"ar" eometry
'OA?5R--O!RS7I3 %RR%J J J J
'OA?5R--O!RS5O3 J J J'OA?5R--O!RS!%J5R J J J
'OA?5R--OS-77I3 %RR%J J J
'OA?5R--OS-75O3 J J J
'OA?5R--OS-7!%J5R J J J
Table 1%: Linear Re+erencin Syste& +unctionality 7Spatial option only8
Oracle Spatial Primer
8/19/2019 Spatial Primer
45/54
&igration $tilities (included in Locator,
-e $"omigrate pac@age i$ u$e" en upgra"ing a $patial "ataba$e or en importing$patial geometry "ata create" un"er te rule$ o/ an ol"er ver$ion o/ Oracle Spatial. %$ o/Oracle 7ataba$e 10g mo$t o/ te /unction$ ave been "eprecate". It i$ only po$$ible toconvert /rom Oracle *.1.> to Pcurrent8.
5i%ration /unctionSDO3574AT+:;func<
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
FRO3*1>-O*1; J J < < < <
OIS35-%7%-%FRO3 J J < < < <
OIS35-%7%-%-O J J < < < <
-OC4 J J < < < <
-O*1; J J < < < <
-O'ERR5A- J J J J J J
Table 1': #iration tilities 7included in Locator8
penLS Support (Spatial only,
Intro"uce" in Oracle 7ataba$e 11g
OpenLS Pac>a%eSDO3OLS
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
3a@eOpen!S'lobReDue$t J
3a@eOpen!SReDue$t J
Table 1): OpenLS Support 7Spatial only8
Oracle Spatial Primer 5
8/19/2019 Spatial Primer
46/54
Point #loud Support (Spatial only,
Intro"uce" in Oracle 7ataba$e 11g
Point Cloud Pac>a%eSDO3PC3P@4
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
'!I&&' J
'R5%-5&' J
7RO&75&5A75A'I5S J
IAI- J
-O5O35-RJ J
Table 1.: *oint 4loud Support 7Spatial only8
create or replace TYPE SDO_PC AS OBJECT (base_table VARCHAR2(70),base_table_col VARCHAR2(1024),pc_id NUMBER,blk_table VARCHAR2(70),ptn_params VARCHAR2(1024),pc_extent sdo_geometry,pc_tol NUMBER,pc_tot_dimensions NUMBER,pc_domain sdo_orgscl_type,pc_val_attr_tables SDO_STRING_ARRAY,pc_other_attrs SYS.XMLTYPE)
create or replace TYPE SDO_PC_BLK AS OBJECT (obj_id NUMBER ,blk_id NUMBER,blk_extent sdo_geometry,blk_domain sdo_orgscl_type,pcblk_min_res NUMBER,pcblk_max_res NUMBER,num_points NUMBER,num_unsorted_points NUMBER,pt_sort_dim NUMBER,points BLOB)
Oracle Spatial Primer "
8/19/2019 Spatial Primer
47/54
Spatial .nalysis and &ining (Spatial ption only,
-i$ a$ intro"uce" in Oracle 7ataba$e 10g to cover /reDuently reDuire" /unctionality $uc a$returning te proportional area$ o/ inter$ecting geometrie$.
Aone o/ te S7OS%3 capability i$ inclu"e" in !ocator it Oracle 7ataba$e 10g
A%%re%ate /unctions=(ot in a pac>a%e
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
Anal!sis and 5inin%SDO3SA5
Oracle Database -.% Oracle Database --%Spatial Locator Spatial
%R5%-5SFOR5O35-RJ J J %R5%-5SFOR!%J5R J J#IA5O35-RJ J J#IA!%J5R J J'O!O'%-57R5F5R5A'5F5%-ER5S J JSI3&!IFJ5O35-RJ
J JSI3&!IFJ!%J5R J JS&%-I%!'!ES-5RS J J-I!57%R5%-5S J J-I!57#IAS J J
Oracle Spatial Primer '
8/19/2019 Spatial Primer
48/54
"riangulated %rregular -etworks "%-s (Spatial option only,
-i$ a$ intro"uce" in Oracle 7ataba$e 11g a$ part o/ te tree "imen$ional $upport.
A%%re%ate /unctions
=(ot in a pac>a%e
ret Oracle2i Database Oracle
Database -.%
Oracle
Database --%Locator Spatial Locator Spatial Locator Spatial
Anal!sis and 5inin%SDO3SA5
Oracle Database -.% Oracle Database --%Spatial Locator Spatial
'!I&-IA . J'R5%-5-IA . J7RO&75&5A75A'I5S : JIAI- . J-O5O35-RJ . J
create or replace TYPE SDO_TIN AS OBJECT (base_table VARCHAR2(70),
base_table_col VARCHAR2(1024),tin_id NUMBER,blk_table VARCHAR2(70),ptn_params VARCHAR2(1024),tin_extent sdo_geometry,tin_tol NUMBER,tin_tot_dimensions NUMBER,tin_domain sdo_orgscl_type,tin_break_lines SDO_GEOMETRY,tin_stop_lines SDO_GEOMETRY,tin_void_rgns SDO_GEOMETRY,tin_val_attr_tables SDO_STRING_ARRAY,tin_other_attrs SYS.XMLTYPE)
create or replace TYPE SDO_TIN_BLK AS OBJECT (
obj_id NUMBER ,blk_id NUMBER,blk_extent sdo_geometry,blk_domain sdo_orgscl_type,pcblk_min_res NUMBER,pcblk_max_res NUMBER,num_points NUMBER,num_unsorted_points NUMBER,pt_sort_dim NUMBER,points BLOB,
Oracle Spatial Primer )
8/19/2019 Spatial Primer
49/54
tr_lvl NUMBER,tr_res NUMBER,num_triangles NUMBER,tr_sort_dim NUMBER,triangles BLOB)
Oracle Spatial Primer 9
8/19/2019 Spatial Primer
50/54
"uning $tilities (some in Locator,
Oracle a$ "eprecate" =ua"tree In"ea%e
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
Tunin% /unctionSDO3T(+:;func<
Oracle2i Database OracleDatabase -.%OracleDatabase --%Locator Spatial Locator Spatial Locator Spatial
%A%!JZ5R-R55 A J < < %?5R%53#R A J J J J5S-I3%-5IA75; &5RFOR3%A'5
A J < <5S-I3%-5R-R55IA75; SIZ5
. J J J5S-I3%-5-I!IA!5?5! A J < <5S-I3%-5-O-%! AE3-I!5S
A J < <5;-5A-OF A J J J J,IS-OR%3%A%!JSIS A J < <3I;IAFO A J J J J=E%!I-J75R%7%-IOA A J J J JR-R55=E%!I-J A J < <
Oracle Spatial Primer 5
8/19/2019 Spatial Primer
51/54
'eneral $tilities
-i$ i$ a collection o/ u$e/ul utilitie$ /or e
8/19/2019 Spatial Primer
52/54
R5?5RS5!IA5S-RIA . J J JSI3&!IFJ . J J J-O3!115O35-RJ J-O3!5O35-RJ . J J J-O:H#5O35-RJ . J J J-O:H-5O35-RJ . J J J?%!I7%-5:H#5O35-RJ
. JJ
J?%!I7%-5:H-5O35-RJ . J J J
Oracle Spatial Primer 52
8/19/2019 Spatial Primer
53/54
1eb Features (Spatial ption only,
Intro"uce" in Oracle 7ataba$e 11g
A%%re%ate /unctions=(ot in a pac>a%e
ret Oracle2i Database OracleDatabase -.%
OracleDatabase --%
Locator Spatial Locator Spatial Locator Spatial
Web /eatures Loc> Pac>a%e
SDO3W/S3LOC@Oracle Database-.%Oracle Database --%Spatial Locator Spatial
Regi$terFeature-able . JEnRegi$terFeature-able JWeb /eatures Process Pac>a%eSDO3W/S3LOC@Oracle Database-.%
Oracle Database --%Spatial Locator Spatial7ropFeature-ype J7ropFeature-ype$ Jen'ollection&roc$ JetFeature-ypeI" JrantFeature-ype-oE$er Jrant37%cce$$-oE$er JIn$ert'apabilitie$In/o JIn$ertFt7ataEp"ate" JIn$ertFt37Ep"ate" J&opulateFeature-ype;3!In/o J&ubli$Feature-ype J
Regi$ter3-able?ie JRevo@eFeature-ypeFromE$er JRevo@e37%cce$$FromE$er J
EnRegi$ter3-able?ie . J
Oracle Spatial Primer 5@
8/19/2019 Spatial Primer
54/54
Locator 0s Spatial
Oracle !ocator i$ a proper $ub$et o/ te Oracle Spatial option. It i$ available an" inclu"e" inte licen$e o/ all e"ition$ o/ te Oracle "ataba$e. -ypical in$tallation$ o/ any $upporte"ver$ion an" e"ition ill inclu"e Oracle !ocator. Oracle !ocator inclu"e$ te rigt to u$e $omebut not all /unction$ an" proce"ure$ /orm $everal pac@age$ tat are /ormally part o/ Oracle
Spatial. It i$ tere/ore po$$ible to ina"vertently u$e Oracle Spatial capability en notproperly licen$e".
In general Oracle !ocator provi"e$ te $ub$et o/ Oracle Spatial nece$$ary to $tore e//icientlyretrieve an" manipulate geometrie$ (or type S7O5O35-RJ) but AO- to per/orm anya"vance" analy$i$ or interpretation o/ tat "ata. In oter or"$ !ocator i$ u$e/ul a$ te"ataba$e bein" tir" party tool$.
One big a"vantage o/ !ocator i$ tat te Oracle "ataba$e may be u$e" a$ a neutral $toragemecani$m. 7ata may be manipulate" u$ing $ome very poer/ul but potentially e