This project has moved and is read-only. For the latest updates, please go here.

Help with Imagery

Topics: Data Access
Apr 13, 2007 at 8:18 PM
I've been trying to get my imagery to load into SharpMap for weeks now...I've tried a couple of different ways.

1) using GdalRasterLayer:

SharpMap.Layers.GdalRasterLayer gd = new SharpMap.Layers.GdalRasterLayer("GDAL Test", @"D:\\ms4w\\tifs\\SIDCOMPRESSED\\AlmaNE.tif");

This loads the image fine but when I start zooming SharpMap doesn't maintain the extent of the image. It always loads the image to the full size of the map. No matter what zoom level I am at...and then eventually I get the same "Window out of Range" error that many have already been getting. I have updated the GdalRasterLayer.cs file to the current version and it still isn't working.

2) Mapserver WMS:

I have an installation of MapServer that I am using for other sites and the images are loading fine. I have configured it for use as a WMS and am able to getmap...and getcapabilities with no problem. I have used the WMS service through another mapping application and everything works fine. The problem I'm seeing is that it looks like SharpMap is setting the extent to the LatLong Extent and not the proper UTM extent. But either way no image is visible.

Here's a copy of the getcapabilities for the image layer:
<Title>aGI WMS Server</Title>
<LatLonBoundingBox minx="-92.8071" miny="34.713" maxx="-92.7609" maxy="34.7446" />
<BoundingBox SRS="EPSG:26915"
minx="517666" miny="3.84124e006" maxx="521884" maxy="3.84473e006" />
<Layer queryable="0" opaque="0" cascaded="0">

I have double checked the images I'm trying to load and they are projected correctly and they are 3 Band truecolor images not colormap images. I'm at my wits end on trying to get a usable solution. I am about to look into installing GeoServer to get a workable WMS to use but it looks to be limited to using geoTiff and I don't have the space to store the uncompressed images. And I would prefer to use the existing images that are already being used.

Sorry for the rambling, Any help would be great.

May 17, 2007 at 4:33 PM
If you look at the bottom of gdalrasterlayer.cs there is a bunch of code that is commented out. If you comment out what is currently being used and use the code at the bottom that should fix the issue with the image always loading to the full size
Jun 18, 2007 at 8:45 AM
I dont think i'm understand, anyone can help me with this issue ? cause i've the same problem too

Thank you