Hello,

I'm sorry, but I'm still not sure if I understand your question properly.

If you have a map pane and you want to zoom in to a particular
location you can use the setDisplayArea method:
http://docs.geotools.org/stable/javadocs/org/geotools/swing/JMapPane.html#setDisplayArea(org.opengis.geometry.Envelope)

For example, if you want to display an area w map units wide, centred
on a given position, you could do this:
double xPos = ...
double yPos = ...
double w2 = w / 2;

ReferencedEnvelope env = new ReferencedEnvelope(xPos - w2, xPos + w2,
yPos - w2, yPos + w2, crs);
mapPane.setDisplayArea( env );

If you are asking about the specifics of your database query then
hopefully someone else here can assist you.

Michael

On 26 June 2011 00:50, lexmc <[email protected]> wrote:
> This is my code:
>
> public static void query() throws ClassNotFoundException, SQLException,
> IOException
>        {
>                Connection connection = null;
>                try {
>                        Class.forName("com.mysql.jdbc.Driver");
>
>                        connection = DriverManager.getConnection(URL, 
> USERNAME, PASSWORD);
>                        Statement st = connection.createStatement();
>                        ResultSet rs = st.executeQuery("select * from prova 
> where
> (FOGLIO="+m.a+") AND (NUMERO="+m.b+")");
>                        //I don't know if I can put a geometry value into a
> resultset
>                        while(rs.next())
>                        {
>                                //now i have my geometry value and i have to 
> zoom on it
>                        }
>
>                } finally {
>                        if (connection != null) {
>                                connection.close();
>                        }
>                }
>        }
>
> this is my problem.
>
> --
> View this message in context: 
> http://osgeo-org.1803224.n2.nabble.com/Convert-a-geometry-value-to-a-x-y-coordinate-tp6511208p6514877.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense..
> http://p.sf.net/sfu/splunk-d2d-c1
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to