MapWindow Developer Team : MapWindow Discussion Forum
I've made changes to improve loading/saving time of shapefiles. Details: - the information about each shape will be hold in the CShapeWrapper class which will lie underneath CShape; - no COM Points will be used for storing shape data internally; - COM poi
Changes for ocx Shape and Shapefile classes
Posted by: Sergei ()
Date: May 23, 2010 09:23AM

I've made changes to improve loading/saving time of shapefiles.

Details:
- the information about each shape will be hold in the CShapeWrapper class which will lie underneath CShape;
- no COM Points will be used for storing shape data internally;
- COM points will be created on the fly when they are requested from the outside (Shape.get_Point).

Benefits:
- the loading of shapfile into memory becomes 5 times faster, saving to the disk - about 2 times faster;
- certain increase of speed will be noticeable for drawing of in-memory shapefile and MapWinGis.Shape/OGRGeometry conversion (GEOS methods).

Switching between old new code:
As changes are serious I preserved old code completely using conditional compilation. To use old code it's necessary to define SHAPE_OLD in MapWinGis.h file (defined by default). When it's not defined the new code is used.
When SHAPE_OLD isn't defined the new drawing procedure, I'm working on now, will be used also. It's far from being finished and is good for testing only.

Known problems
In most cases no error codes will return for reworked methods in Shape class - will be done later.
The shapefile types without Z and M values were tested only.

Sergei

Options: ReplyQuote


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: