This project is read-only.

Problems with raster layer

Nov 10, 2010 at 7:29 PM


I think I ran on some problems with raster layer.

1. Nothing happens when I try to change raster layer opacity, neither through code nor through symbolyzer editor at runtime. The folowing code loads raster, but without change in opacity:

                RasterSymbolizer mySymbolizer = new RasterSymbolizer();
                mySymbolizer.Opacity = 0.1f;
                Raster raster = new Raster();
                raster.Open(ofd.FileName);  //I tried with DTED and ASCI grid
                RasterLayer myLayer = (RasterLayer) this.Layers.Add(raster);
                myLayer.Symbolizer = mySymbolizer;

2. Exception is thrown when trying to change values in raster with, for instance:

                Raster raster = new Raster();
                for (int i = 0; i < 10; i++)
                    for (int j = 0; j < 10; j++)
                        raster.Value[i, j] = 300.0;  //double value

From exception stack trace:

System.ArgumentException was unhandled
  Message=Object must be of type Double.
       at System.Double.CompareTo(Object value)
       at DotSpatial.Data.ValueGrid`1.set_Item(Int32 row, Int32 column, Double value) in C:\Dev\DotSpatial\DotSpatial.Data\DotSpatial.Data\ValueGrid.cs:line 143


There are also some bugs that I've found with MapImageLayer, though not the same as with RasterLayer, so it's better to write about them in separate discussion.

Would this be more suitable for "developers" or for "users" discuusion topics in order to know where to send future posts?



Nov 10, 2010 at 9:08 PM

For the best effect, separate out each specific problem you run into as separate issues, and log them with the issue tracker.  Even if you aren't sure whether it is an issue or an intended feature or you may just be calling it wrong.  Try to also set whether it discusses an issue, like a crash, or a feature, like adding support for a new file format.  Also set the "Impact" to high for quick fixes that would benefit a large percentage of users.  Medium for rarer use-cases or fixes that might take more time.  Low for major redesigns or features that only help a small percentage of users.  Thanks a lot for your feedback.  These are exactly the kinds of things we need to track down and fix.



Nov 11, 2010 at 9:42 AM

Thanks, I will post them as separate issues. I'll also try to provide as much details as I can for each detected problem.


Nov 11, 2010 at 10:32 PM

I've put these two bugs to the issue tracker. How can I change "Impact" for the posts?



Nov 12, 2010 at 12:39 AM
There isn't a whole set of settable comboboxes on the right side of the editor when you are creating an issue? If not then don't worry about it. If you are not registered as a developer then you may not have access to that feature, which actually makes sense, since some of the features enable assigning an issue to a developer, setting a planned release and so on. A developer will decide if your bug fixes are easy or hard and set the impact. I may do it myself tonight, or it may have to wait a bit until one of us has time to look at it.


On Thu, Nov 11, 2010 at 2:32 PM, dragandm <> wrote:

From: dragandm

I've put these two bugs to the issue tracker. How can I change "Impact" for the posts?



Read the full discussion online.

To add a post to this discussion, reply to this email (

To start a new discussion for this project, email

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at