ImportShapefile not working with linestrings

Description

Hi,

I tried to use OgrDataSource ImportShapefile. I implemented the example found in Mapwindow link. The result is that points are integrated but not linestrings. Layer is created but is empty. There is no invalid geometry in the file. I'm using the very last version of Mapwingis from github.

Thanks,

Olivier

example

Environment

None

Activity

Show:
Paul Meems
February 19, 2017, 9:00 PM
Edited

I've just created a small test and I have no problems importing point, linestring nor polygon shapefile.
Here's my code:

Perhaps you can share you shapefile?

Paul Meems
February 21, 2017, 8:57 PM

I just tried with the shapefile send by Olivier and I can import them, but no features are imported.
So that is strange.

I also extended my earlier unit test to use GetBuffer and sf.SaveAs and with my point data I have no problems, but with my lines and polygons SaveAs throws an error.
I need to dive into the C++ code to look for the problem.

I updated the code of the unit test in my previous comment.

Paul Meems
February 21, 2017, 9:21 PM

I tried debugging the C++ code and saw the exception is thrown in WriteRecord().
I'm not sure why. Do you have some ideas? I'll commit my unit tests.

Olivier Leprêtre
February 22, 2017, 2:35 PM

Hi,

I did another test with a huge polygon layer (1 257 866 feats) it took several minutes, ended without error, layer. created with coorect columns names but. empty.

I noticed also that the geometry field is renamed to wkb_geometry even if the initial file was geom or the_geom.

Olivier

Assignee

Paul Meems

Reporter

Olivier Leprêtre

Labels

None

Fix versions

Priority

High
Configure