50
WorkingwithSQLServerwithSpatialWareTables
SpatialWareisaPitneyBowesSoftwareInc.Corporationproductthathelpsusersstore,access,manage,
andmanipulatespatialdataasastandardpartoftheirbusinessdata.Youcanquerybothspatialand
non-spatialdatawithinasingleSQLServerqueryusingSpatialWare.AllofthestrengthsofSQLServer
asarelationaldatabaseareextendedtospatialdatausingSpatialWare.Spatialdatamayforexample
bedirectlymanagedandeditedbymanydifferentuserssimultaneously.
CannotUploadObject
IfyoueditamappableSpatialWaretableandtrytoinsertMapInfoEllipse,RoundedRectangle,orArc
objectsintoit,thefollowingmessagedisplays:
"CannotUpload.ObjectformatisnotsupportedinSpatialWare(Ellipse,RoundedRectangle,orArc)"
Thisisbecauseyouaretryingtoinsertobjectsthatarenotsupported.Tofixtheproblem,deletethese
objectsfromthetableortransformthemtopolylinesorregions.Todeterminewhichobjectshavetobe
deletedortransformed,runaqueryintheMapInfoSQLSelectdialogboxandspecify"obj"intheSelect
Columnclause.Theresultingquerywilltellyouthetypesofobjectsinthetable.Selecttheobjectsyou
wishtodeleteortransformanddisplaytheselectioninaneditablelayerinaMapwindow.Todeletethe
objects,usetheClearMapObjectsOnlyoptionintheEditmenu.Totransformtheobjects,usethe
ConverttoRegionsorConverttoPolylinesoptionintheObjectsmenu.Forbestresults,transformEllipse
andRoundedRectanglesintoregions,andtransformArcsintopolylines.
IfyoumakeaSpatialWaretablemappablewiththeObjectTypedefaultofPointandtrytoinsertaLine
orRegionobjectintoit,thesamemessage"CannotUploadObjectformatisnotsupportedinSpatialWare
(Ellipse,RoundedRectangle,orArc)"displays.Thisisbecauseyouaretryingtoinsertobjectsother
thanapoint.YouneedtomakethetablemappablewiththeObjecttypespecifiedasALL.Tofixthe
problem,deletethetablefromtheMapCatalogusingEasyLoader.Thenre-addthetabletotheMap
CatalogwithanObjecttypeofALLusingtheMakeTableMappableoption.
WorkingwithPostGISTables
SometimeswhenyouarecreatingamapinMapInfoProfessionalandyouarestoringtheresultsin
PostGISyoucreatemapswhichusegeometriesthatarenotsupported:PostGISdoesnotsupportarcs,
ellipses,rectangles,androundedrectangles.
IfyouhavecreatedamapyoudonotwanttolosebutcannotsavetotheDBMSofyourchoice
duetounsupportedgeometries,thenusetheSaveAsmenuoptionandsavethemapwithout
theunsupportedgeometries.
Note:
IfyoutrytosaveamapwithunsupportedspatialgeometrytypesinPostGIS,thesearetheresults:
• SpatialGeometryTypeswithAllUnsupportedObjects:Ifyouhavecreatedamapthatmight
containalloftheunsupportedobjectsandyouaretryingtosavetoPostGIS,thismessagedisplays:
Table has unsupported objects (rounded rectangles, ellipses or
arcs). Convert to regions and/or polylines?
ClickYestoconverttheunsupportedobjectstoregionsorpolylines;youwouldselectNotodecline
toconverttheunsupportedobjects.Ifyoudecline,youcannotsavethemapyouhavecreatedtothe
PostGISdatabase.
• SpatialGeometrytypeswithRegionObjectsOnly:Ifyouhavecreatedamapthatcontainsregion
objectsonlyandyouaretryingtosavetoPostGIS,thismessagedisplays:
Table has unsupported objects (rounded rectangles or ellipses).
Convert to regions?
ClickYestoconverttheunsupportedobjectstoregions;youwouldselectNotodeclinetoconvertthe
unsupportedobjects.Ifyoudecline,youcannotsavethemapyouhavecreatedtothePostGIS
database.
MapInfoProfessional12.5
194
WorkingwithRemoteTablesfromSpecificDatabases
51
• ForSpatialGeometrytypeswithLineObjectsOnly:Ifyouhavecreatedamapthatcontainsline
objectsonlyandyouaretryingtosavetoPostGIS,thismessagedisplays:
Arc is an unsupported object. Convert to polylines?
ClickYestoconverttheunsupportedobjectstopolylines;youwouldselectNotodeclinetoconvert
theunsupportedobjects.Ifyoudecline,youcannotsavethemapyouhavecreatedtotheSQLServer
Spatialdatabase.
• ForSpatialGeometryoftypeRectangle:Ifyouhavecreatedamapthatcontainsrectangleobjects
andyouaretryingtosavetoPostGIS,thismessagedisplays:
Cannot upload Object - Rectangle object type is not supported in this
table. Operation canceled.
ClickOK.YoucannotsavethemapyouhavecreatedtothePostGISdatabase.
WorkingwithOracleSpatialTables
OracleSpatialisanimplementationofaspatialdatabasefromOracleCorporation.Youcaninstallitin
additiontotheMapInfoProfessionalODBCConnectivitycomponent.Althoughithassomesimilarities
tothepreviousOracleSDOrelationalimplementation,itissignificantlydifferent.OracleSpatialmaintains
theOracleSDOimplementationviaarelationalschema.However,MapInfoProfessionaldoesnotsupport
theOracleSDOrelationalschemaviatheOracleCallInterface(OCI).MapInfoProfessionaldoessupport
simultaneousconnectionstoOracleSpatialthroughtheOCIandtootherdatabasesthroughODBC.
SupportedObjectTypes
TheMultipointandCollectionobjecttypesaretranslatedintotheSpatialObjectsOracleMULTIPOINT
andCOLLECTION,respectively,viaOracleOCIandviceversa.However,Oracle'sCOLLECTIONobject
isbroaderinscopethanMapInfoProfessional'sCollection,whichonlyallowsoneREGION,onepolyline
andonemultipoint.Therefore,conversionfromMapInfoProfessionalobjecttoOracleobjectsandthe
conversionfromOracleobjectstoMapInfoProfessionalobjectsmaynotbeaone-to-onetranslation.
ThefollowingtableshowstherelationshipbetweenMapInfoProfessionalobjectsandOracleobjects.
MapInfoProfessionalObjects
OracleSpatialObjects
Multipoint
MULTIPOINT
Collection
COLLECTION
Multipoint
Point(cluster)
Polyline
LineString
MultipleLineString
REGION
Polygon
MultiplePolygons
ThetableindicateshowOracleSpatialobjectsaretranslatedintoMapInfoProfessionalobjects.Allpoint
elementsinanOracleCOLLECTIONwillbetranslatedintoonemultipointinaMapInfoProfessional
Collection;allOracleLineobjects(includingsingleandmultiple)willbetranslatedintooneMapInfo
Professionalpolyline;andallOraclePolygons(includingsingleandmultiple)willbetranslatedintoone
MapInfoProfessionalREGION.Therefore,whenanOracleCOLLECTIONismodifiedandthensaved
backintoOracleServerbyusingMapInfoProfessional,theoriginalstructureoftheOracleCOLLECTION
objectmaybechangedifitismorecomplicatedthantheMapInfoProfessionalCollection.
IfyouareconnectingtoanOracleSpatialdatabase,OracleSpatialisanewspatialschemanumber13.
Itprovidessupportforpoints,lines,andpolygonspatialtypes.
195
MapInfoProfessionalUserGuide
Chapter7:WorkingwithDatainaDBMS
51
OracleSpatialRequirements
ToconnecttoOracleSpatialwithinMapInfoProfessional,youmusthavetheOracleSpatialorOracle
9iand9irelease2,or10Gclientinstalled.SeeyourOracledocumentationfordetailedinformation.
PrimaryKeyusedforNewTableCreationorWhenSavingaRemoteCopy
AnUniquekeyensuresthatanentrydoesnotmatchanyotherentryfromadifferentrecord.Ifarecord
doesnotcontainanyvalue,noerrorisreported.APrimarykeyrequiresthateveryrecordcontainsa
uniquevalueinthatfield.BymakingthesevaluesPrimarykeys,weenforcethateveryrecordhasa
valueinthisfield.
PrimaryKeyAuto-IncrementforOracleDatabases
ThePrimaryauto-incrementfeaturemanagesthePrimarykeyvalueforyou.Whenyouaddanewrecord
toaremoteOracletable,MapInfoProfessionallocksthetable,checksforthehighestvalueofthePrimary
keyofthetable,incrementsitbyone(1),andthenputsthatvalueinthePrimarykeyfield.SQLServer
Spatialusersdonotrequirethisfeatureastheserver-sidesoftwaremanagesthePrimarykey
automatically.
UsetheAutoKeycheckboxintheOpenDBMSTableOptiondialogboxtoenablethisfeature.When
youselecttheAutoKeycheckbox,thePrimarykeyfieldisnoteditableandtheUniquekeyisautomatically
incremented.Ifyoudonotselectthischeckbox,thePrimarykeyfieldremainseditable.
Toaccessthisfeature:
1. FromtheFilemenu,clickOpenandselectanOracledatabasefromtheFilesofTypedrop-down
list.ClickOKtodisplaytheOpenDBMSTableOptionsdialogbox.
2. SelecttheAutoKeyoptiontoincrementthePrimarykeyoftheselectedtableautomaticallyforany
newrecords.
3. ClickOKtocontinue.
OracleObjectMapVerificationSupportingObject/MapValidation
TheCheckRegionsmenuoptionenablesyoutoremoveregionlinesegmentsthatintersecteachother.
Youcanalsothinkofthisasnodeswithinasinglepolygonofaregionwherethepolygonintersectsitself,
aswhenanodehasmorethan2linesegmentsemanatingfromit.
Thesecasescanbebrokendownintotwootherinstances:
• Ifapolygonhas2loopedsections,andthepathtracedbythenodesofthepolygonfollowacursive
figure8pattern,thenwecallthisaFigure8polygon.
• Ifthesame2loopedpolygoncantraceitspathasacursivecapitalletterB,thenwecallthisaBow
Tiepolygon.
WethinkofFigure8asworsethanBowTiebecausetheareaofaFigure8isalwaysincorrect,while
theareaofaBowTiecanbecorrectandaccurate.BothFigure8'sandBowTiesaredetected.
CreatingLegendsfrom/foraLiveTable
YoucanretrieveuniquestylesfromthetableusingtheCreateLegendwizard.Youcanretrievestyles
fromthemapcatalog,ifperformanceisyourprimaryconcern,butifyoupreferamorevisuallydescriptive
andappealingspatialrepresentationoftheuniquemapstylesinyourlivetable,youcancreatelegends
fromalivetableinstead.
Whenareuniquemapstylesavailableforalivetable?
Ingeneral,remotedatabaseshavenoconsistentwayofstoringstylesforgeographicdata.MapInfo
Professionalgivesyoutwodifferentwaysofassociatingstyleswithgeographicdataforremotedatabases.
Thefirstwayistospecifyacommonstyleforadatabasetableinthemapcatalog,whichisusedforall
recordsinthatdatabasetable.Thesecondwayistohaveanadditionalcolumnforthedatabasetable
thatspecifiesastyleforeachrecordinthattable.(MapInfoProfessionalusesthemapcatalogtokeep
trackofthestylecolumnforadatabasetable.)Uniquemapstylesareavailableforadatabasetable
whenithasthisdesignatedstylecolumn.
Toseethisfunctionality:
MapInfoProfessional12.5
196
WorkingwithRemoteTablesfromSpecificDatabases
54
1. OpenaremoteDBMSconnectionandselectalivetablefordisplay.
2. FromtheMapmenu,clickCreateLegendtodisplaytheCreateLegend-ChooseLayersdialog
box.
3. SelectalayertocreatealegendfromandclickNexttodisplaytheCreateLegend-LegendDefault
Propertiesdialogbox.
4. ClickNexttodisplaytheCreateLegend-FramePropertiesdialogbox.
5. IntheStylesfrombox,therearethreeoptions.Thefirstoption,mapcatalog,providestheexisting
supportandisstillthedefaultforlivetables.
• Selectmapcatalogtoretrievethedefaultstylesfortheselectedlegendframefromthemap
catalog.Usethisoptionwhenyouareconcernedwithperformance.Retrievingmapstylesfrom
livetablesonaremotedatabasecantakealongtime,butretrievingadefaultstylefromthemap
catalogcanbesignificantlyfaster.Rememberthatstylesinthemapcatalogmaynotbeasvisually
descriptiveastheotheroptions.Thisisthedefaultoptionforlivetables,butisdisabledforother
typesoftables.
• Selectuniquemapstylestoretrievealluniqueobjectstylesfortheliveaccesstableforavisually
appealinglegend.Forextremelylargetables,thisoptioncantakelongerthanthefirstoption.This
optionisselectedbydefaultwhenthelegendframeisnotaliveaccesstable.
• Selectuniquevaluesinacolumntoretrievethestylesassociatedwiththevaluessavedina
particularcolumninthedatabasetableforavisuallyappealinglegend.Forextremelylargetables,
thisoptioncantakelongerthanthefirstoption.
6. ClickSaveframesettingtoMetadatatopreservethechoiceyoumadeinthisdialogbox.When
youre-openthisdialogboxthesettingsfromthemetadataareusedasdefaultvaluesinsteadofthe
systemsetdefaultvalues.
7. ClickFinish.
SeeTroubleshootingDBMSTableIssuesintheHelpSystem.
MapInfoProfessionaldoesnotMaintaintheCurveTypeinOracleData
WhenreadingOracletables,MapInfoProfessionalchangesrecordscontaininggeometriesthatdonot
directlytranslatetoMapInfoProfessionalgeometrytypes.Thishappenswhenworkingwithlinesand
polygonboundariescontainingsegmentsthatarecurvetypesorcircles.MapInfoProfessionaldoesnot
supportthecurvetype,soitconvertsthesetopolylines.MapInfoProfessionalalsoconvertscirclesinto
regions.Whensavingtheserecordsbacktothedatabase,youmaylosesometopologicalinformation
asaresult.ThisissomethingtobeawareofwhensharingyourOracledatawithotherapplications,such
asAutodesk'sMap3D.
MapInfoProfessionalshowsamessagebeforesavingdatabacktotheOracledatabasewhenthatdata
containscurvedgeometries.Themessageisasfollows:
TheOracletableyouareupdatingcontainsoneormoregeometrytypesthatMapInfoProfessionaldoes
notsupport,sothegeometrytypehasbeenconvertedtoasupportedtype.Savingthesegeometries
mayintroducetopologicalerrorsintoyourdatabase.ClickYestocontinue,orNotodiscardchanges
thatweremadetounsupportedgeometries.Editstoattributedatasaveineithercase.
WhenexecutingtheMapBasicCommitstatement,thepromptdisplaysonlywhenitcontainsthe
Interactivekeyword.
Note:
ConvertingUnsupportedGeometriesinOracle
SometimeswhenyouarecreatingaMapinMapInfoProfessionalandyouarestoringtheresultsin
Oracleyoucreatemapswhichusegeometriesthatarenotsupported:Oracledoesnotsupportarcs,
ellipses,rectangles,androundedrectangles.
IfyouhavecreatedamapyoudonotwanttolosebutcannotsavetotheDBMSofyourchoice
duetounsupportedgeometries,thenusetheSaveAsmenuoptionandsavethemapwithout
theunsupportedgeometries.
Note:
OracleGeometryConversionBehavior
197
MapInfoProfessionalUserGuide
Chapter7:WorkingwithDatainaDBMS
51
IfyoutrytosaveamapwithunsupportedspatialgeometrytypesinOracle,thesearetheresults:
• SpatialGeometryTypeswithAllUnsupportedObjects:Ifyouhavecreatedamapthatmight
containalloftheunsupportedobjectsandyouaretryingtosavetoOracle,thismessagedisplays:
Table has unsupported objects (rounded rectangles, rectangles,
ellipses or arcs). Convert to regions and/or polylines?
ClickYestoconverttheunsupportedobjectstoregionsorpolylines;youwouldselectNotodecline
toconverttheunsupportedobjects.Ifyoudecline,youcannotsavethemapyouhavecreatedtothe
Oracledatabase.Aconfirmationmessageexplainsthattheoperationiscanceled.
• SpatialGeometrytypeswithRegionObjectsOnly:Ifyouhavecreatedamapthatcontainsregion
objectsonlyandyouaretryingtosavetoOracle,thismessagedisplays:
Table has unsupported objects (rounded rectangles, rectangles, or
ellipses). Convert to regions?
ClickYestoconverttheunsupportedobjectstoregions;youwouldselectNotodeclinetoconvertthe
unsupportedobjects.Ifyoudecline,youcannotsavethemapyouhavecreatedtotheOracledatabase.
• ForSpatialGeometrytypeswithLineObjectsOnly:Ifyouhavecreatedamapthatcontainsline
objectsonlyandyouaretryingtosavetoOracle,thismessagedisplays:
Arc is an unsupported object. Convert to polylines?
ClickYestoconverttheunsupportedobjectstopolylines;youwouldselectNotodeclinetoconvert
theunsupportedobjects.Ifyoudecline,youcannotsavethemapyouhavecreatedtotheOracle
database.
OracleOperatingSystemAuthenticationandConfiguration
WhenyouchooseOSauthenticationforauser,theuseraccountismaintainedbytheOracledatabase,
butpasswordadministrationanduserauthenticationisperformedbytheOperatingSystem(OS).With
OSauthentication,yourdatabasereliesontheunderlyingoperatingsystemtorestrictaccesstodatabase
accounts.Adatabasepasswordisnotusedforthistypeoflogin.
Bydefault,Oracleallowsoperating-system-authenticatedloginsonlyoversecureconnections,which
precludesusingOracle.NETandasharedserverconfiguration.Thisdefaultrestrictionpreventsaremote
userfromimpersonatinganotheroperatingsystemuseroveranetworkconnection.
SettingREMOTE_OS_AUTHENTtoTRUEinthedatabaseinitializationparameterfileforcestheRDBMS
toaccepttheclientoperatingsystemusernamereceivedoveranon-secureconnectionanduseitfor
accountaccess.
Anychangetothisparametertakeseffectthenexttimeyoustarttheinstanceandmountthedatabase.
Generally,userauthenticationthroughthehostoperatingsystemoffersfasterandmoreconvenient
connectiontoOraclewithoutspecifyingaseparatedatabaseusernameorpassword.Also,userentries
correspondinthedatabaseandoperatingsystemaudittrails.
SettingPrefixforOSAuthenticatedUser
SettheinitializationparameterOS_AUTHENT_PREFIX,andusethisprefixintheOracledatabaseuser
names.TheOS_AUTHENT_PREFIXparameterdefinesaprefixthattheOracledatabaseaddstothe
beginningofeveryuser'soperatingsystemaccountname.Whenauserattemptstoconnect,Oracle
comparestheprefixedusernamewiththeOracleusernamesinthedatabase.
Forexample,assumethatOS_AUTHENT_PREFIXissetasfollows:
OS_AUTHENT_PREFIX=OPS$
TheinitializationparameterOS_AUTHENT_PREFIXiscase-sensitiveinsomeoperatingsystems.
RefertoyouroperatingsystemspecificOracledocumentationformoreinformationaboutthis
initializationparameter.
Note:
IfausernamedtsmithistoconnecttoanOracledatabaseinstallationandbeauthenticatedbythe
OperatingSystem,thentheOracledatabasecheckswhetheracorrespondingdatabaseuserOPS$tsmith
MapInfoProfessional12.5
198
WorkingwithRemoteTablesfromSpecificDatabases
23
exists.Ifso,theuserwillconnect.AllreferencestoauserauthenticatedbytheOperatingSystemmust
includetheprefix,OPS$,asseenintheexampleOPS$tsmith.
ThedefaultvalueofthisparameterisOPS$forbackwardcompatibilitywithpreviousversionsofOracle
databases.However,youmightprefertosettheprefixvaluetosomeotherstringoranullstring(an
emptysetofdoublequotes:"").Usinganullstringeliminatestheadditionofanyprefixtooperating
systemaccountnames,sothatOracleusernamesexactlymatchoperatingsystemusernames.
AfteryousetOS_AUTHENT_PREFIX,itshouldremainthesameforthelifeofadatabase.Ifyouchange
theprefix,thenanydatabaseusernamethatincludestheoldprefixcannotbeusedtoestablisha
connection,unlessyoualtertheusernametohaveitusepasswordauthentication.
CreatingaUserwhoisAuthenticatedbytheOperatingSystem
ThefollowingstatementcreatesauserwhoisidentifiedbyOracleandauthenticatedbytheoperating
systemoranetworkservice.ThisexampleassumesthatOS_AUTHENT_PREFIX = "".
CREATE USER scott IDENTIFIED EXTERNALLY;
UsingCREATEUSER<username>IDENTIFIEDEXTERNALLY,youcreatedatabaseaccountsthat
mustbeauthenticatedbytheoperatingsystemornetworkservice.Oraclewillthenrelyonthisexternal
loginauthenticationwhenitprovidesthatspecificoperatingsystemuserwithaccesstothedatabase
resourcesofaspecificuser.
SeetheOracleDatabaseAdvancedSecurityAdministrator'sGuide
(http://docs.oracle.com/cd/B19306_01/network.102/b14268/toc.htm)formoreinformationabout
externalauthentication.
199
MapInfoProfessionalUserGuide
Chapter7:WorkingwithDatainaDBMS
Documents you may be interested
Documents you may be interested