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

V2.0 Rev 229 compile error "file not found"

Oct 2, 2007 at 9:26 AM

after checkout of rev 229 to clean directory I can't compile it even more.
The error is as following. Fehler 3 Die Quelldatei "G:\AL\Develop\CsharpProgs\WinFormsSharpMap2\SharpMap2\SharpMap\Query\SpatialExpression.cs" konnte nicht geöffnet werden ("Das System kann die angegebene Datei nicht finden. "). SharpMap
This mean, the file ...\Query\SpatialExpression.cs does not exist, right, the directory Query is now empty...

Any suggestions?
Oct 2, 2007 at 4:28 PM
Oops ... forgot to check in the changed project file. I just corrected it - try it again and it should work better.
Oct 2, 2007 at 5:00 PM
Many thanks,

i'm now "one step out of office" :)
But I've tried it before and remove references, after that I bekame the problem with "use namespace Query".
Hopefully it's already corrected, will try it later.
Oct 2, 2007 at 5:25 PM
Thanks for your patience... I'm trying to get a few last issues ironed out before I put up a release. The problem that I'm facing is that certain designs (such as using certain ADO.Net types) are causing behaviors which are quite problematic (stack overflows due to incorrect event sequencing). I have to redo this at the last minute and it's causing quality of the source tree to go down. Fortunately the unit tests will help us recover a lot of what has been lost as they mete out their dreadful red failures until we humbly bend to their demands.
Oct 2, 2007 at 9:57 PM
Edited Oct 3, 2007 at 8:13 PM
First of all sorry if I just confused you with my remark. things here are changing so quickly, thanks to the meteoric speed of codcazions work, and its hard for me to follow everithing...

Personaly I'm doing my tests of the latest revisions not with the supplied demo, but with one I've made from scrach.
In the current revision (230) there's a problem in the DemoWinForm with the order of Opening/Closing of data sets (I still don't quite understand what's the correct way to do it) and some compilation problems. Any way ,to make the provided DemoWinForm functional, according to my experiments, the following steps may help:
Exclude from DemoWinForm project "RandomFeatureLayerFactory.cs" (otherwise it just won't compile)
2. Remove all the references to RandomFeatureLayerFactory class in the code.
3. replace line 54 in MainForm.cs with:
3. once this is done, you can run the demo, and load Shape FIle with file based geo index (hopefully...) (don't forget to hit zoom to extend after you load it... - hapens to me all the time)

Alternatively, just for getting the expression of the new tool, you can create a new WinForms project add a Map member and a MapControl member to the from, then write somethig as follows in the ctor of the form:

using SharpMap.Data.Providers.ShapeFile;
MainForm() //ctor
m_mapControl = new SharpMap.Presentation.WinForms.MapViewControl();
m_mapControl.Dock = DockStyle.Fill;
m_mapControl.BackColor = Color.AliceBlue;

m_map = new SharpMap.Map();
mmapControl.Map = mmap;

//load the layer
//your shape file goes here
shapFile = new ShapeFileProvider(@"D:\Data\Programming\GIS\SharpMap2\DemoWinForms\countries.shp");

//opotional: giving some colors to the map so it wont be black...
VectorStyle s = new VectorStyle();
s.EnableOutline = true;
s.Fill = new SolidStyleBrush(StyleColor.Yellow);
s.Outline = new StylePen(StyleColor.Violet, 0.01);
s.Line = new StylePen(StyleColor.Violet, 0.1);
//end of optinal code
SharpMap.Layers.GeometryLayer layer = new SharpMap.Layers.GeometryLayer(""SomeLayer", shapFile);
layer.Style = s; //assuming you did played with the style
afer this, you can try to add interactivty by copying action heandlers from the origianl WinFormDemoProject.
In summary - codcazian is doing an amazing work these days, and it's quite hard to keep up with his speed, so I just try to find those temporary solutions, in order to learn the new architechture, and without disturbing too much the developing process .
Hope its was helpfull.
Oct 3, 2007 at 3:39 PM
Hi codekaizen and blackrussian!

Many thanks to you! I'm really very interested for the first beta of V2.0!
A tillte question: how to correct add a Map member and a MapControl member to the project form (I've done this already, but may be i'm wrong).
Is it possible to install ShapMap controls in the Visual Studio control palette? If not, I think, it will be a cool possibility in the hopefully near future :)
Oct 3, 2007 at 10:31 PM
Hi Alex,

I'm not sure I fully understood you question. You have reference to all the relevant assemblies but something still doesn't work? Try to remove and add the dependency on the "SharpMap.Presentation.WinForms" project.
I've seen Visual Studio has problems updating correctly dependant assembly when it is added through the Contols toolbox. That's why I find adding the control manually to the form preferable at this stage, when frequent recompiles of the control occur.
(to add them manually just add Map and MapViewConrol members to your form, and follow the code example in my previous post).
Oct 4, 2007 at 9:37 AM
Hi blackrussian

I've modified the exmple DemoWinForm as suggested and get it worked:) Many thanks!

The first problem: it's now extremely slow with a given ShapeFile BCROADS.SHP
The second problem is the rendering problem: if the window goes overlapped by other windows and than would be brought on the top, nothing will be drawn - the control is empty... I think, the image is not cached and not redrawn if WM_PAINT is occurs.

Any suggestions?
Oct 4, 2007 at 10:01 AM
Wait for revision 232?
Oct 4, 2007 at 10:43 AM
sure :)
Oct 11, 2007 at 9:51 AM
Hi codekaizen!

Now we are at rev. 237!!! How long can take it before Beta1 ships out?

Oct 14, 2007 at 3:18 AM
Hi Alex,

The WM_PAINT redraw isn't handled yet correctly, but I have an issue on it to fix anyway, so it will be done next week. I'll add a work item to continue to track it.

Also, I'm not seeing slowness, but I've got layer styles so that the entire layer's geometries aren't rendered when all extents are shown. Given that there are several thousand features in that shapefile, slowness isn't surprising if all features are drawn at once with the current GDI renderer.
Oct 14, 2007 at 3:26 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.