-
Notifications
You must be signed in to change notification settings - Fork 8
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
When trying to import a Shapefile (With a polygon completely inside another one) using Geography type, outter Polygon fails and is detected as MultiPolyline #2
Comments
Hi @Danpamio ! Thanks for reporting this. |
|
Nevertheless, this is still a bug, because MakeValid() looses the shape type (Polygon) and, as you said, returns a LineString, which is not acceptable with a Polygon shape file as input. |
:) Started my Georefencing work with your tool, but had a few issues when working with SQL Server 2016 and 2017 (I tried the SqlServerSpatial140.dll to SqlServerSpatial.dll renaming tip, but still..) So Im only using it with SQL Server 2008. Great work btw! |
Gotta say that I'm impressed how fast we are talking about it! Yes, Area 5 returns valid with @dotMorten shape2sql hash and It even works using with STIntersects! |
Ok thanks for checking.
|
Awesome @xfischer! Own you guys beers! If you need anything from here that can help, just let me know. |
It's been quite a few years since I touched Shape2Sql, but I do remember doing quite a few hoops to ensure geographies were valid before importing (and going through several hoops to auto-fix them). The problem is ShapeFiles are always flat-earth geometry, but once you pretend those coordinates are spherical, you quickly get into self-intersecting problems, or geometries spanning more than half a hemisphere etc. |
Thanks a lot for your input @dotMorten ! I knew there was no easy solution. The ugly trick I had was to do a tiny positive/negative buffer. But this was a last resort! |
Hey Fischer!
Found out that when I try to import the attached shapefile (made it just as an example for you) using Geography type, SRID 4326, on MS SQL Server 2016, Area 4 is perfectly imported as Geography type, but Area 5 don't, it is imported as a multi polyline and I really have no idea why.
I have already tested importing the same shapefile using Shape2SQL by Morten Nielsen (another great master!), and both areas were imported correctly as geography.
Please, feel free to contact me if you need further information.
Thank you for your great work.
xfisher_1.0.8_issue_example_ShapeFile.zip
The text was updated successfully, but these errors were encountered: