Two (as yet untested, since no test data in SatelliteImage table in database) web methods have been implemented.

GetImagesByHexagon(double longitude, double latitude)
Returns a List<SatelliteImage> of those SatelliteImages that intersect with the GeoHex hexagon whose centroid is (longitude, latitude). The GeoHex object uses lat/lon, so the parameters should should form a WGS84 coordinate.

GetImagesByExtent(double minX, double minY, double maxX, double maxY)
Returns a List<SatelliteImage> of those SatelliteImages that intersect with the bounding box indicated by the parameters.

No projection takes place in these functions, nor in the SP. This means that in the GetImagesByExtent, any coordinate can be entered, the projection of these should be the same as the coordinates of the Exents in the SatelliteImage table.

These WebMethods create a Polygon object (which is a really simple polygon object that consists of a collection of points (XY)). Polygon has a method that returns WKT (this, and the Polygon object itself, should really be replaced by a proper OpenSource package). The WKT is used as input in the GetSatelliteImagesInExtent stored procedure in the database. This SP returns rows from the SatelliteImage table, whose Extent (Geography) intersects with the WKT geometry.

WKT is used because the stored procedure does not accept lists or complex objects (such as the Polygon or a list of coordinates).

These functions could not be tested because the test data is not present in the SatelliteImage table. The most complex here is to create the Extent out of the original satellite images' World File. This spreadsheet may help: Even so, the World File's coordinates (of the images used) are in Metres.

Last edited May 25, 2011 at 2:28 PM by evadienske, version 2


No comments yet.