<DIV>Hi</DIV>  <DIV>&nbsp;I tried what you did but the program wouln't even compile. I have a table named "land" which has an attribute"geometry" of type "circle". I want to retrieve the center of the circle which is of type "point" as defined by postGIS.Here is my Program</DIV>  <DIV>&nbsp;</DIV>  <DIV><FONT face=courier color=#0000bf>import java.sql.*;<BR>import org.postgis.*;</FONT></DIV>  <DIV><FONT face=courier color=#0000bf>public class JavaGIS3 { <BR>&nbsp; public static void main(String[] args) <BR>&nbsp; { <BR>&nbsp;&nbsp;&nbsp; java.sql.Connection conn; <BR>&nbsp;&nbsp;&nbsp; try <BR>&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Class.forName("org.postgresql.Driver"); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String url = "jdbc:postgresql://localhost:5432/dcmms"; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conn = DriverManager.getConnection(url, "postgres", "abcde"); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Statement s = conn.createStatement(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 ResultSet rs = s.executeQuery("select (center(geometry))as mycenter from land"); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResultSetMetaData rsmd = rs.getMetaData();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int i=0;rs.next();i++){<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Geometry geometry = new BinaryParser().parse(rs.getBytes(1));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(geometry.getType()==geometry.POINT){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; System.out.println("Finally retrieved geometry object!")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s.close(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conn.close(); <BR>&nbsp;&nbsp;&nbsp; } <BR>&nbsp;&nbsp;&nbsp; catch( Exception e ) <BR>&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace(); <BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }<BR>}</FONT></DIV>  <div><FONT face=courier color=#0000bf></FONT>&nbsp;</div>  <div><FONT
 face=courier color=#0000bf><FONT size=2></FONT></FONT>&nbsp;</div>  <div><FONT><FONT face=arial size=2>I did what you had said in your email but it would give an error:</FONT></FONT></div><FONT color=#ff0000 size=2>  <div>BinaryParser cannot be resolved to a type</div></FONT>  <div><FONT face=courier color=#0000bf><FONT size=2></FONT></FONT>&nbsp;</div>  <div><FONT face=courier color=#0000bf><FONT face=Arial color=#000000 size=2>What should I do? Did you compile your program?</FONT></div>  <DIV><BR></FONT><B><I>"Gilbert, Antoine" &lt;AGilbert@korem.com&gt;</I></B> wrote:</DIV>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">  <META content="Microsoft Word 11 (filtered)" name=Generator>  <STYLE>  <!--   /* Font Definitions */   @font-face   {font-family:Tahoma;   panose-1:2 11 6 4 3 5 4 4 2 4;}   /* Style Definitions */   p.MsoNormal, li.MsoNormal, div.MsoNormal   {margin:0cm;   margin-bottom:.0001pt;   font-size:12.0pt;  
 font-family:"Times New Roman";}  a:link, span.MsoHyperlink   {color:blue;   text-decoration:underline;}  a:visited, span.MsoHyperlinkFollowed   {color:blue;   text-decoration:underline;}  p   {margin-right:0cm;   margin-left:0cm;   font-size:12.0pt;   font-family:"Times New Roman";}  span.EmailStyle18   {font-family:Arial;   color:navy;}  @page Section1   {size:612.0pt 792.0pt;   margin:72.0pt 90.0pt 72.0pt 90.0pt;}  div.Section1   {page:Section1;}  -->  </STYLE>    <DIV class=Section1>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Here is my example using postgis_1_0_0.jar</SPAN></FONT></div>  <div class=MsoNormal><FONT
 face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Connection connection = TestUtils.getTestConnection();</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Statement stmt = connection.createStatement();</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResultSet rs = stmt.executeQuery("select AsBinary(geom) as geom from \"rue_test_polyline\"");</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 ResultSetMetaData rsmd = rs.getMetaData();</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int i=0;rs.next();i++){</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Geometry geometry = new BinaryParser().parse(rs.getBytes(1));</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(geometry.getType()==geometry.MULTILINESTRING){</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY:
 Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MultiLineString multiline = ((MultiLineString)geometry);</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(multiline.toString());</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("ligne "+i+" contient "+multiline.numLines()+" segment(s)");</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int
 j=0;j&lt;multiline.numLines();j++)</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("&nbsp;&nbsp;&nbsp; segment "+j+":"+multiline.getLine(j).numPoints()+" points");</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 stmt.close();</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connection.close();</SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</div>  <DIV>  <DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">  <HR tabIndex=-1 align=center width="100%" SIZE=2>  </SPAN></FONT></DIV>  <div class=MsoNormal><B><FONT face=Tahoma size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> Fatemeh Abbasinejad [mailto:fabbasinejad@yahoo.com] <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> January 30, 2006 3:43 AM<BR><B><SPAN style="FONT-WEIGHT:
 bold">To:</SPAN></B> postgis-users@postgis.refractions.net<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [postgis-users] JAVA and post GIS</SPAN></FONT></div></DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</div>  <DIV id=RTEContent>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">I am new to PostGIS. Does anyone know how we can retrieve our defined data types <BR>(like point,circle,...) from a ResultSet in java. I used getObject but it didn't work. </SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">-fatemeh</SPAN></FONT></div></DIV>  <DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">  <HR align=center width="100%" SIZE=1>  </SPAN></FONT></DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
 style="FONT-SIZE: 12pt">Bring words and photos together (easily) with<BR><A href="http://us.rd.yahoo.com/mail_us/taglines/PMHM3/*http:/photomail.mail.yahoo.com">PhotoMail </A>- it's free and works with Yahoo! Mail.</SPAN></FONT></div></DIV>_______________________________________________<BR>postgis-users mailing list<BR>postgis-users@postgis.refractions.net<BR>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE>  <DIV><BR></DIV><p>
        
                <hr size=1> <a href="http://us.rd.yahoo.com/evt=38381/ ylc=X3oDMTEzcGlrdGY5BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDMWF1dG9z/*http://autos.yahoo.com/index.html ">Yahoo! Autos</a>. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.