Thank you for the answer. When I execute this code:<br><br>    public static void main(String[] args) throws Throwable {<br>        Class.forName("org.postgresql.Driver").newInstance();<br>        String sql = "CREATE TABLE test (pk_0 int4 NOT NULL);";<br>
        sql += "select AddGeometryColumn('test','the_geom','-1','GEOMETRY','2');";<br>        sql += "insert into test "<br>                + "values(3, "<br>
                + "GeomFromText('LINESTRING(191232 243118,191108 243242)',-1));";<br><br>        Connection c = DriverManager<br>                .getConnection("jdbc:postgresql://127.0.0.1/gdms/test",<br>
                        "postgres", "postgres");<br>        ((PGConnection) c)<br>                .addDataType("geometry", org.postgis.PGgeometry.class);<br>        ((PGConnection) c).addDataType("box3d", org.postgis.PGbox3d.class);<br>
<br>        Statement st = c.createStatement();<br>        try {<br>            st.execute("drop table test");<br>        } catch (SQLException e) {<br><br>        }<br>        st.execute(sql);<br><br>        ResultSet rs = st.executeQuery("select * from test");<br>
        rs.next();<br>        String geom = rs.getString(2);<br>        JtsBinaryParser parser = new JtsBinaryParser();<br>        Geometry g = parser.parse(geom);<br>        Coordinate[] coords = g.getCoordinates();<br>        for (Coordinate coordinate : coords) {<br>
            System.out.println(coordinate);<br>        }<br>    }<br><br>I obtain this output:<br>(191232.0, 243118.0, 0.0)<br>(191108.0, 243242.0, 0.0)<br><br>I think I should obtain <br>(191232.0, 243118.0, NaN)<br>(191108.0, 243242.0, NaN)<br>
<br>am I wrong?<br><br><br>Fernando.<br><br><div class="gmail_quote">On Wed, Mar 5, 2008 at 12:14 PM, Mark Cave-Ayland <<a href="mailto:mark.cave-ayland@siriusit.co.uk">mark.cave-ayland@siriusit.co.uk</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">On Wednesday 05 March 2008 10:13:26 Fernando González wrote:<br>

> Hi,<br>
><br>
> I'm storing and reading some geometries from a postgis table. The table is<br>
> 2D. I'm using a jar I have compiled with the "make postgis_jts" command. It<br>
> works very well except for one thing. I write 2D JTS geometries, this is<br>
> with the z component equal to NaN, into a postgis table but when I read<br>
> them the Z coordinate is no longer equal to NaN but equal to 0. is this a<br>
> feature? a bug?<br>
><br>
> I'm using this code to read the geometry. To store them I use GeomFromText<br>
> function and I specify only X-Y components for each coordinate (I'm not<br>
> specifying the Z coordinate):<br>
><br>
> JtsBinaryParser parser = new JtsBinaryParser();<br>
> String bytes = rs.getString(fieldId);<br>
> Geometry geom = parser.parse(bytes);<br>
><br>
> is it clear? I can write some code to reproduce the problem if anyone is<br>
> interested.<br>
><br>
> Thanks in advance,<br>
> Fernando<br>
<br>
<br>
</div></div>Hi Fernando,<br>
<br>
Yes please. I may not be the person that eventually looks at this, however a<br>
reproducible test case is enormously helpful in cases like these.<br>
<br>
<br>
ATB,<br>
<br>
Mark.<br>
<br>
--<br>
<font color="#888888">Mark Cave-Ayland<br>
Sirius Corporation - The Open Source Experts<br>
<a href="http://www.siriusit.co.uk" target="_blank">http://www.siriusit.co.uk</a><br>
T: +44 870 608 0063<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</font></blockquote></div><br>