Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open a shapefile which contains faulty data #6

Open
airbreather opened this issue Apr 29, 2018 · 2 comments
Open

Open a shapefile which contains faulty data #6

airbreather opened this issue Apr 29, 2018 · 2 comments

Comments

@airbreather
Copy link
Member

From @laetitiamh on September 7, 2016 14:58

Hi!

I am trying to open a shapefile that contains building outlines using NetTopologySuite.IO.ShapefileReader.
I only get around 700 of the 5000+ buildings as a result as the reading stops early because of a faulty linear ring "Number of points must be 0 or >3". This shapefile is automatically generated and contains some errors. I can open the same file in a tool like http://mapshaper.org/ and I can see all the outlines.

The ShapefileEnumerator::MoveNext will return false when it encounters such an exception and as a result the ShapeFileReader::ReadAll will abort the foreach loop.
Could we specifiy as an option to the ShapefileReader to continue reading until the end of the file even when it finds faulty geometries?

Thank you very much!

Copied from original issue: NetTopologySuite/NetTopologySuite#121

@airbreather
Copy link
Member Author

From @laetitiamh on October 20, 2016 15:57

Any comment on this issue? Thanks!

@airbreather
Copy link
Member Author

From @axmand on November 1, 2017 4:30

I have the same problem, source code

it will be calling ValidateConstruction while executing instantiation of LinearRing.

var features = soruce.ToFeatureSource().where(p=>p is ILinearRing);

i think this problem can be resolved by adding a property such as "ForceIgnoreValidateConstruction:true".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant