RE: [Geoserver-devel] MySQL and Geoserver

Chris,

I will have to look into the within method to see if it returns a NOT DISJOINT. I will look at the other
functions to figure out the best possible solution and get back to you on Monday but
i do think the MBRIntersects method is not the right one. Thanks for the help an
i will talk to you soon.

Thanks again!!
Ed

-----Original Message-----
From: Chris Holmes [mailto:cholmes@anonymised.com]
Sent: Friday, February 11, 2005 3:16 PM
To: Erie, Edward C.
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] MySQL and Geoserver

It very well could be that the call is wrong. Which is why MySQL is not
included in the standard distribution of GeoServer, it's a beta download.

Are you sure it should be within? I'm happy to change it - I think I'm
the MySQL module maintainer by default, since no one else has really
picked it up. But I have not really looked into it to make sure the calls
are exactly right. Does a within return a NOT DISJOINT? Because that's
what a bounding box should be. I think a within may miss features that
cross the border of the bounding box, that aren't completely within.

Chris

----- Original Message -----
From: "Erie, Edward C." <edward.erie@anonymised.com>
To: <geoserver-devel@lists.sourceforge.net>
Sent: Friday, February 11, 2005 1:42 PM
Subject: [Geoserver-devel] MySQL and Geoserver

I am having difficulty retrieving data through WMS. I have set up MySql
as the datastore and have a table called plot. In this table i have a
column called geo that represents the interface Geometry. Geoserver is
set up properly and I can access the data through a GetFeature call to the
WFS. When i perform the following http call
http://localhost:8080/geoserver/wms?request=GetMap&bbox=130,75,150,85&Format=image/png&width=600&height=400&layers=plot&styles=normal
i retrieve an empty png file. The geometry data for column geo are all
points that fall within this bounding box. I looked at the sql that was
being used by the WMS to access the geometry data and it was the
following:

SELECT primaryKey, AsText(geo) AS geo FROM plot WHERE MBRIntersects(geo,
Geometry
FromText('POLYGON ((130 75, 130 85, 150 85, 150 75, 130 75))', -1));

I noticed that the MBRIntersects method was being used. Is this correct?
Shouldn't it be using the MBRWithin method? I re-ran the query with the
MBRWithin method and my results returned correctly. Any help would be
appreciated!!!

Thanks
Ed

--

You know, it's also possible that the MySQL method isn't implemented
correctly, as their spatial support is so new. Because according to OGC
specs intersects is the one that is supposed to return a not disjoint.
Granted MBRIntersects is just against the envelope, so it wouldn't even be
exactly correct. But I do think an intersects should be used here.
Within is supposed to be for features entirely contained by the envelope.
For points this is fine, but for lines and polygons it will miss all the
ones that pass the border, I believe.

Chris

On Fri, 11 Feb 2005, Erie, Edward C. wrote:

Chris,

I will have to look into the within method to see if it returns a NOT DISJOINT. I will look at the other
functions to figure out the best possible solution and get back to you on Monday but
i do think the MBRIntersects method is not the right one. Thanks for the help an
i will talk to you soon.

Thanks again!!
Ed

-----Original Message-----
From: Chris Holmes [mailto:cholmes@anonymised.com]
Sent: Friday, February 11, 2005 3:16 PM
To: Erie, Edward C.
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] MySQL and Geoserver

It very well could be that the call is wrong. Which is why MySQL is not
included in the standard distribution of GeoServer, it's a beta download.

Are you sure it should be within? I'm happy to change it - I think I'm
the MySQL module maintainer by default, since no one else has really
picked it up. But I have not really looked into it to make sure the calls
are exactly right. Does a within return a NOT DISJOINT? Because that's
what a bounding box should be. I think a within may miss features that
cross the border of the bounding box, that aren't completely within.

Chris

----- Original Message -----
From: "Erie, Edward C." <edward.erie@anonymised.com>
To: <geoserver-devel@lists.sourceforge.net>
Sent: Friday, February 11, 2005 1:42 PM
Subject: [Geoserver-devel] MySQL and Geoserver

I am having difficulty retrieving data through WMS. I have set up MySql
as the datastore and have a table called plot. In this table i have a
column called geo that represents the interface Geometry. Geoserver is
set up properly and I can access the data through a GetFeature call to the
WFS. When i perform the following http call
http://localhost:8080/geoserver/wms?request=GetMap&bbox=130,75,150,85&Format=image/png&width=600&height=400&layers=plot&styles=normal
i retrieve an empty png file. The geometry data for column geo are all
points that fall within this bounding box. I looked at the sql that was
being used by the WMS to access the geometry data and it was the
following:

SELECT primaryKey, AsText(geo) AS geo FROM plot WHERE MBRIntersects(geo,
Geometry
FromText('POLYGON ((130 75, 130 85, 150 85, 150 75, 130 75))', -1));

I noticed that the MBRIntersects method was being used. Is this correct?
Shouldn't it be using the MBRWithin method? I re-ran the query with the
MBRWithin method and my results returned correctly. Any help would be
appreciated!!!

Thanks
Ed

--