This project is read-only.

Unable to use DotSpatial.Analysis

Nov 1, 2011 at 10:14 PM

Hello,

I am unable to reference anything inside the DotSpatial.Analysis namespace. I am adding a reference to DotSpatial.Analysis and as soon as I add the using DotSpatial.Analysis statement and build, I get the "The type or namespace name 'Analysis' does not exist in the namespace 'DotSpatial' (are you missing an assembly reference?)" error.

But, I have added the reference, not sure what's going on. I am using the latest build. Please help!

Thanks,

VK.

Nov 1, 2011 at 11:17 PM

Can you post your sample project?

Nov 8, 2011 at 7:47 PM

Mudnug,

I tried with yesterday's binaries too, still unable to build.

I dont see any way to attach my project. Here's what I am trying to do

using DotSpatial.Data;
using DotSpatial.Topology;
using DotSpatial.Analysis;

List<Coordinate> coordinates = new List<Coordinate>();
            coordinates.AddRange(new Coordinate[] { new Coordinate(-115.481, 44.138), new Coordinate(-91.481, 44.138), new Coordinate(-91.481, 32.73), new Coordinate(-115.481, 32.73), new Coordinate(-115.481, 44.138) });
            Polygon polygon = new Polygon(coordinates);

                        ClipRaster.ClipRasterWithPolygon(@"C:\shared\55d98aab-1315-4b62-b4ab-6fd4422ba5cc.tif", polygon as IFeature, @"C:\shared\output.tif", null);

            Console.WriteLine("Done");
            Console.ReadLine();
When I build I get a "Error 2 The type or namespace name 'Analysis' does not exist in the namespace 'DotSpatial' (are you missing an assembly reference?)" error.
I am not sure what I am missing.
Thanks,
VK.
Nov 8, 2011 at 9:27 PM

Check your "Target Framework" in your project settings in Visual Studio.  If it is set to ".NET Framework 4 Client Profile", try changing it to ".NET Framework 4".

Nov 9, 2011 at 4:28 PM

Thanks Kellison, that worked!!

VK.