I’m calling the Generate/Generate2 routines (ShapeFile.Categories.Generate2) passing valid parameters for the field name or index, the classification type and the number of classes, but my program just goes into an endless spin (no error messages). Any thoughts on what might be happening?
Corrupt shape/dbf files perhaps? The shape file is not ridiculously big (its shapes of each country in the world). I’m using MapWinGIS 5.2.4 (64-bit) inside a Delphi app. Otherwise MapWinGIS is working OK.
For what its worth, I think this might be related to MapWinGIS not liking some shapefiles (or perhaps they are just too complex), I’ve tried calling Shapefile.HasInvalidShapes and that too also goes into a mode with a near(?) endless blue spinning circle? Are my shape files too complex perhaps? I’m working with a standard open source map of Africa that has only 56 shapes and the .shp file is 23 MB in size. Any thought gratefully accepted! Thanks!
Hello @CharlieHeaps
If you don’t mind posting the Shapefile of Africa, I could run it through the debugger to (hopefully) see what’s taking so long.
Regards,
Jerry.
Thanks for getting back to me Jerry - I’ve also been corresponding with Paul Meems who has been very helpful (as usual!). I’ve dug further into this and and it now seems it’s not a MapWinGIS issue but rather an issue with Delphi. I’ve discovered that the calls are only slow when my app is run from within the Delphi IDE. Outside the IDE they seem to run reasonably quickly. This is true whether or not I compile with debugging features on in Delphi (and true for both 32-bit and 64-bit code), but it’s hard to explain since either way the program is making the same single call to the MapWinGIS Active X control. For what its worth, I’m attaching the shape file here. Its quite small: about 60 shapes - one per country. I have no clue what I could do to further assess why the IDE might be slowing down the ActiveX. I should add that its reproducible with a very simple sample app, that I could share if you want. But assuming that wont be of much use as most people here not using Delphi. In short, If anyone has any ideas I’d love to see them!
Thanks!
africa v1.84.zip (933.5 KB)
Charlie
@CharlieHeaps - I might know why this is. When I run from the IDE I noticed (maybe from version 10 onwards of Delphi) that for some reason Delphi seems to hook into the dlls in the MapWindow “gdalplugins” folder - multiple times - you can see it streaming up the IDE output.
I got round it by moving the .dlls. Obviously there could be some issues if your software uses them, but it works for me. Hide / remove them and problem gone (for me). It’s these ones:
![image](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/51b957a0cec32d6d1d1d53e7e18d7ec339c678ab.png)
Regards,
Rob
PS Obviously you can put them back when not debugging or for release
This is great - many thanks Rob. I will try this tip and let you know what I find out.
Dumb question: what tools/approach did you use that allowed you to see Delphi hooking into those DLLs? Is it something in Delphi or a separate utility?