[Mapserver-users] PLEASE HELP...

Smith, Michael ERDC-CRREL-NH Michael.Smith@erdc.usace.army.mil
Thu, 22 May 2003 11:16:34 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C32075.21B9E800
Content-Type: text/plain

Richard, 
 
Mapserver needs to be compiled with the oracle libraries
 
i.e. --with-oraclespatial = /path/to/oracle/home
 
Then, in the map file use 
 
 CONNECTIONTYPE oraclespatial
 CONNECTION 'user/password@tnsname' <mailto:'user/password@tnsname'> 
 DATA 'sdo_geometry_column FROM tablename'
 
I've also found that if you use this format for the DATA line, that mapserver will only select data with the extents of you map view, if you use 'sdo_geom_col from (select * from tablename)' which is also valid, on every redraw you will be retrieving the entire data table and not using a spatial index.
 
You do not have to use OGR to access Oracle. OGR is slower at this point but does support more features (attribute queries mainly). 
 
Another importtant point is to increase the ARRAY_SIZE in the maporaclespatial.c code. By default, it is set at 1, but we get much, much faster performance by increasing the ARRAY_SIZE to 500 or 1000. Basically this allows mapserver to send 500 ot 1000 rows at a time. 
 
Mike Smith 
email: michael.smith@erdc.usace.army.mil 
RSGISC 
ERDC - CRREL 
Hanover, NH  03755 
(603) 646-4765 
-----Original Message-----
From: Becher, Richard [mailto:RichardBecher@SierraSystems.com] 
Sent: Thursday, May 22, 2003 10:17 AM
To: Mapserver-users@lists.gis.umn.edu
Subject: [Mapserver-users] PLEASE HELP...
Importance: High


I have not been able to get a response on how to display data using Mapserver from Oracle.
 
I have created a connection to my Oracle db and I do not get any errors.
 
However, the data does not display.
 
I was told that I can't do this direct connection to Oracle and that I have to use OGR.
 
Can someone please confirm this and give me any help on how to simply display data from my Oracle database using Mapserver?
 
Any help would be GREATLY appreciated.
 
Cheers,
 
Richard Becher
Sierra Systems
130 Slater Street, Suite 800
Ottawa, Ontario K1P 6E2
Phone: 613.236.7888, Extension: 350
Fax: 613.236.9333
Email: RichardBecher@SierraSystems.com
www.SierraSystems.com <http://www.sierrasystems.com/> 
 
 

------_=_NextPart_001_01C32075.21B9E800
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns=3D"http://www.w3.org/TR/REC-html40" xmlns:o =3D=20
"urn:schemas-microsoft-com:office:office" xmlns:w =3D=20
"urn:schemas-microsoft-com:office:word" xmlns:st1 =3D=20
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<TITLE>Message</TITLE>

<META content=3DWord.Document name=3DProgId>
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<META content=3D"Microsoft Word 10" name=3DOriginator><LINK=20
href=3D"cid:filelist.xml@01C3204B.49BB6600" =
rel=3DFile-List><o:SmartTagType=20
name=3D"PostalCode"=20
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTag=
Type><o:SmartTagType=20
name=3D"State"=20
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTag=
Type><o:SmartTagType=20
name=3D"City"=20
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTag=
Type><o:SmartTagType=20
name=3D"place"=20
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTag=
Type><o:SmartTagType=20
name=3D"Street"=20
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTag=
Type><o:SmartTagType=20
name=3D"address"=20
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTag=
Type><!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if !mso]>
<STYLE>st1\:* {
	BEHAVIOR: url(#default#ieooui)
}
</STYLE>
<![endif]-->
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in =
1.25in; mso-header-margin: .5in; mso-footer-margin: .5in; =
mso-paper-source: 0; }
P.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
A:link {
	COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
	COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
	COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
	COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
P.MsoAutoSig {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-pagination: widow-orphan; mso-fareast-font-family: "Times New =
Roman"
}
LI.MsoAutoSig {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-pagination: widow-orphan; mso-fareast-font-family: "Times New =
Roman"
}
DIV.MsoAutoSig {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-pagination: widow-orphan; mso-fareast-font-family: "Times New =
Roman"
}
SPAN.EmailStyle17 {
	COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: =
personal-compose; mso-style-noshow: yes; mso-ansi-font-size: 10.0pt; =
mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; =
mso-hansi-font-family: Arial; mso-bidi-font-family: Arial
}
SPAN.SpellE {
	mso-style-name: ""; mso-spl-e: yes
}
DIV.Section1 {
	page: Section1
}
</STYLE>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */=20
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]--></HEAD>
<BODY lang=3DEN-US style=3D"tab-interval: .5in" vLink=3Dpurple =
link=3Dblue>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Richard, </FONT></SPAN></DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Mapserver needs to be compiled with the oracle=20
libraries</FONT></SPAN></DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff size=3D2>i.e.=20
--with-oraclespatial =3D /path/to/oracle/home</FONT></SPAN></DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff size=3D2>Then,=20
in the map file use </FONT></SPAN></DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>&nbsp;CONNECTIONTYPE oraclespatial<BR>&nbsp;CONNECTION '<A=20
href=3D"mailto:'user/password@tnsname'">user/password@tnsname'</A><BR>&n=
bsp;DATA=20
'sdo_geometry_column FROM tablename'</FONT></SPAN></DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff size=3D2>I've=20
also found that if you use this format for the DATA line, that =
mapserver will=20
only select data with the extents of you map view, if you use =
'sdo_geom_col from=20
(select * from tablename)' which is also valid, on every redraw you =
will be=20
retrieving the entire data table and not using a spatial=20
index.</FONT></SPAN></DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff size=3D2>You do=20
not have to use OGR to access Oracle. OGR is slower at this point but =
does=20
support more features (attribute queries mainly). </FONT></SPAN></DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Another importtant point is to increase the ARRAY_SIZE in the=20
maporaclespatial.c code. By default, it is set at 1, but we get much, =
much=20
faster performance by increasing the ARRAY_SIZE to 500 or 1000. =
Basically this=20
allows mapserver to send 500 ot 1000 rows at a time. =
</FONT></SPAN></DIV>
<DIV><SPAN class=3D812200815-22052003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D1>Mike Smith</FONT> <BR><FONT =
face=3DArial=20
size=3D1>email: michael.smith@erdc.usace.army.mil</FONT> <BR><FONT =
face=3DArial=20
size=3D1>RSGISC</FONT> <BR><FONT face=3DArial size=3D1>ERDC - CRREL =
</FONT><BR><FONT=20
face=3DArial size=3D1>Hanover, NH&nbsp; 03755</FONT> <BR><FONT =
face=3DArial=20
size=3D1>(603) 646-4765</FONT> </DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr =
align=3Dleft><FONT=20
  face=3DTahoma size=3D2>-----Original Message-----<BR><B>From:</B> =
Becher, Richard=20
  [mailto:RichardBecher@SierraSystems.com] <BR><B>Sent:</B> Thursday, =
May 22,=20
  2003 10:17 AM<BR><B>To:</B>=20
  Mapserver-users@lists.gis.umn.edu<BR><B>Subject:</B> =
[Mapserver-users] PLEASE=20
  HELP...<BR><B>Importance:</B> High<BR><BR></FONT></DIV>
  <DIV class=3DSection1>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have not been able to =
get a=20
  response on how to display data using <SPAN =
class=3DSpellE>Mapserver</SPAN> from=20
  Oracle.<o:p></o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have created a =
connection to my=20
  Oracle db and I do not get any errors.<o:p></o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">However, the data does =
not=20
  display.<o:p></o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I was told that I can't =
do this=20
  direct connection to Oracle and that I have to use=20
  OGR.<o:p></o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Can someone please =
confirm this=20
  and give me any help on how to simply display data from my Oracle =
database=20
  using <SPAN =
class=3DSpellE>Mapserver</SPAN>?<o:p></o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Any help would be =
GREATLY=20
  appreciated.<o:p></o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">Cheers,<o:p></o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><STRONG><B><FONT face=3D"Times New Roman" =
color=3Dgreen=20
  size=3D3><SPAN style=3D"FONT-SIZE: 12pt; COLOR: green; mso-no-proof: =
yes">Richard=20
  Becher<o:p></o:p></SPAN></FONT></B></STRONG></P>
  <P class=3DMsoNormal><EM><B><I><FONT face=3D"Times New Roman" =
color=3Dgreen=20
  size=3D3><SPAN=20
  style=3D"FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: green; =
mso-no-proof: yes">Sierra=20
  Systems</SPAN></FONT></I></B></EM><B><FONT color=3Dgreen><SPAN=20
  style=3D"FONT-WEIGHT: bold; COLOR: green; mso-no-proof: =
yes"><BR></SPAN></FONT></B><st1:Street><st1:address=20
  style=3D"BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: =
url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x"><FONT=20
  color=3Dnavy size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: yes">130 Slater=20
  Street,&nbsp;Suite 800</SPAN></FONT></st1:address></st1:Street><FONT=20
  color=3Dnavy><SPAN=20
  style=3D"COLOR: navy; mso-no-proof: =
yes"><BR></SPAN></FONT><st1:place><st1:City><FONT=20
  color=3Dnavy size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: =
yes">Ottawa</SPAN></FONT></st1:City><FONT=20
  color=3Dnavy size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: yes">,=20
  </SPAN></FONT><st1:State><FONT color=3Dnavy size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: =
yes">Ontario</SPAN></FONT></st1:State><FONT=20
  color=3Dnavy size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: yes">=20
  </SPAN></FONT><st1:PostalCode><FONT color=3Dnavy size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: yes">K1P=20
  6E2</SPAN></FONT></st1:PostalCode></st1:place><FONT =
color=3Dnavy><SPAN=20
  style=3D"COLOR: navy; mso-no-proof: yes"><BR></SPAN></FONT><FONT =
color=3Dnavy=20
  size=3D2><SPAN style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: =
yes">Phone:=20
  613.236.7888, Extension: 350<o:p></o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3D"Times New Roman" color=3Dnavy =
size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: yes">Fax:=20
  613.236.9333</SPAN></FONT><FONT color=3Dnavy><SPAN=20
  style=3D"COLOR: navy; mso-no-proof: yes"><BR></SPAN></FONT><FONT =
color=3Dnavy=20
  size=3D2><SPAN style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: =
yes">Email:=20
  RichardBecher@SierraSystems.com</SPAN></FONT><FONT color=3Dnavy><SPAN =

  style=3D"COLOR: navy; mso-no-proof: yes"><BR></SPAN></FONT><FONT =
color=3Dnavy=20
  size=3D2><SPAN style=3D"FONT-SIZE: 10pt; COLOR: navy; mso-no-proof: =
yes"><A=20
  =
href=3D"http://www.sierrasystems.com/">www.SierraSystems.com</A></SPAN><=
/FONT><SPAN=20
  style=3D"mso-no-proof: yes"><o:p></o:p></SPAN></P>
  <P class=3DMsoAutoSig><FONT face=3D"Times New Roman" size=3D3><SPAN=20
  style=3D"FONT-SIZE: 12pt; mso-no-proof: =
yes"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20
  style=3D"FONT-SIZE: =
12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTM=
L>

------_=_NextPart_001_01C32075.21B9E800--
_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users