-
Notifications
You must be signed in to change notification settings - Fork 24
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
Cannot read a polygon with a hole from a ShapeFile #70
Comments
FInally I figured out what is a problem. Both the problem polygon and its hole have IsCCW = true, which is really strange, because as I far as I know shells must be clockwise, and holes should be counterclockwise. I would like to suggest a solution like this (in PolygonHandler.cs file, in Read method, after the initialization of lists shells and holes):
I am not sure how this will work in cases when we should have more than one shell - if someone can help me with this, it would be great! :) Thank you! |
I tried to load the simble polygon "wrongly formatted" with arcmap successfully (see shell_bad_ccw.zip), using qgis I see that the polygon is visualized but there are problems with identify operation (i.e.: clicking on it). Anyway, to me the input looks simply wrong: I will do a deeper check but the correct behavior to me is to throw an exception instead to read as EDIT: I just checked what happens inside PolygonHandler and there are A LOT of mess...
@dmitriytuma can you confirm the results? I don't see any |
…hat are not inside any shell, due mainly to invalid inputs with shell and holes not correctly oriented - as separate shells
Support for a polygon with holes has been added in the successor library. For invalid geometries use following code: var options = new ShapefileReaderOptions()
{
GeometryBuilderMode = GeometryBuilderMode.FixInvalidShapes
};
var currentFeatures = Shapefile.ReadAllFeatures(shpStream, dbfStream, options); |
Hello!
I have a problem with reading of one specific polygon in the attached shapefile (Example.zip) - this polygon has one hole, but it is read as MULTIPOLYGON EMPTY.
Other polygons can be read without any problems.
But I can see the problem polygon, when I import the attached file in mapshaper, here it is marked in a red border:
![Problem polygon with a hole](https://user-images.githubusercontent.com/75642056/109326405-d1156a80-785f-11eb-8673-7784cd3b2a93.PNG)
Meanwhile, there is another one polygon inside the hole
I have already tried types like
ShapefileReader
,ShapeDataReader
,ShapefileDataReader
, but result is the same.One of my tries looks like:
The projection of the shape file is UTM35N.
Please, can someone check this and help me?
Thank you!
The text was updated successfully, but these errors were encountered: