layer.GetBuffer behaves unpredicted

Description

I use the default shapefiles from {{\MapWindow-Projects\UnitedStates\Shapefiles}}

I'm running OgrDatasourceTests.ImportShapefileTest. Trying to import cities, states and roads into my local database. This works fine.
In the same test method I try to get the data out again using layer.GetBuffer and sf.SaveAs
This initially worked for the cities and states. But caused a crash on roads when calling sf.SaveAs.
So I created a new test: ShapefileTests.SaveAs loading the shapefile and calling SaveAs. This worked fine. So the problem doesn't seems to be with SaveAs

Next I created another test: OgrDatasourceTests.GetBuffer which is just calling GetBuffer on an existing layer and calling SaveAs and now SaveAs is crashing again. Making me believe the problem is in GetBuffer.

Initially the states shapefile had no problem. I opened it in MW5 and deleted the last column (mwShapeId). Save the changes and run OgrDatasourceTests.ImportShapefileTest again. Now this test is failing on this file also, although it is imported correctly into my database.

Here's my simple GetBuffer-SaveAs test:

Environment

None

Activity

Show:
Olivier LeprĂȘtre
April 26, 2018, 7:50 AM

Hi,
I encounter sames unexplanable crashes with shapefile saveas but not only with getbuffer but also with commands like
var layer = new Mw.VectorLayer();
success = layer.Open(ncontext.pgcnx, name, true);
layer.Data.SaveAs(Path.Combine(folder, ficshp));
layer.Close();
So I would thinks that there something that saveas does not like (value not initialized perhaps) but is not catched in saveas causing the crash

Olivier

Assignee

Unassigned

Reporter

Paul Meems

Labels

Epic Link

Fix versions

Affects versions

Priority

Medium
Configure