Ahmet,<br><br>You might want to work with WKT while debugging and switch to WKB later. <br>Did you use ST_AsBinary(geometry column) in the SQL query string?<br><br><div class="gmail_quote">On Tue, Dec 28, 2010 at 3:08 PM, <span dir="ltr"><<a href="mailto:ahmettemiz88@gmail.com">ahmettemiz88@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">thank you<br><br>while (rs.next()) {<br>                                        //g1 = com.vividsolutions.jts.geom.Geometry.wkbReader.read(WKBReader.hexToBytes(rs.getString(1)));<br>
                                        g1 = org.gdal.ogr.Geometry.CreateFromWkb(rs.getBytes(1));<br>                                        if (g1 != null) {<br>                                         System.out.println( g1.GetGeometryType());<br>                                        } <br><br>        }<br><br>g1 returns null.<br>can you tell me what the wrong is ?<br>
<br>regards<br><br>28 Ara 2010 10:49 tarihinde, Chaitanya kumar CH <<a href="http://chaitanya.ch" target="_blank">chaitanya.ch</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>> şunu yazdı:<div><div></div>
<div class="h5"><br>> Ahmet,<br>> <br>> If you are querying the postgis database directly, you can use ST_AsText() or ST_AsBinary() to get the geometry in the WKT or the WKB format and use OGRGeometry::importFromWkt() <br>
> or OGRGeometry::importFromWkb() respectively to load them into the OGR objects. This question is actually for the postgis list.<br>> <br>> 2010/12/28 ahmet temiz <a href="mailto:ahmettemiz88@gmail.com" target="_blank">ahmettemiz88@gmail.com</a>><br>
> <br>> hello<br>> <br>> <br>> <br>> how can I get postgis-polygon object using Resultset in Java ?<br>> <br>> <br>> <br>> like this way :<br>> <br>> <br>> <br>> ResultSet rs = stmt.executeQuery(qstr);<br>
> <br>> while (rs.next()) {<br>> <br>> gdal.Geometry geo=????<br>> <br>> }<br>> <br>> <br>> <br>> regards<br>> <br>> --<br>> <br>> Ahmet Temiz<br>> <br>> Jeoloji Müh.<br>
> <br>> Planlama ve Zarar Azaltma Dairesi Başkanlığı<br>> <br>> Bilgi ve CBS grubu<br>> <br>> Eskişehir Yolu 10. km.<br>> <br>> Lodumlu / Ankara<br>> <br>> Tel : 0 312 2872680 / 1535<br>> <br>
> _______________________________________________<br>> <br>> gdal-dev mailing list<br>> <br>> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>> <br>> <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
> <br>> <br>> <br>> <br>> -- <br>> Best regards,<br>> Chaitanya kumar CH.<br>> /tʃaɪθənjə/ /kʊmɑr/ <br>> +91-9494447584<br>> 17.2416N 80.1426E<br>></div></div></blockquote></div><br><br clear="all">
<br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9494447584<br>17.2416N 80.1426E<br>