Select to view content in your preferred language

SDE MSSQL SqlSpatial Geometry Self Intersects problem

7263
22
12-30-2010 12:13 AM
ChrisSmith
Emerging Contributor
Hi

I have created a SqlGeometry using the Microsoft.SqlServer.Types SqlGeometryBuilder, the geometry IsValid and IsSimple but when trying to view it in ArcMap it wont draw, when trying to export to a non SqlSpatial SDE table it complains that the polygon is self intersecting. The geometry uses srid 27700 (BNG) and is viewable in SQL management Studio, I have tried various methods that are suggested to correct the geometry including MakeValid(), STUnion(STStartPoint()) on the SqlSpatial side but since it is valid and doesnt self intersect then it doesnt fix the issue.

Any help is appreciated, Geometry details below



Regards

chris

Geometry as Text...(after trying MakeValid()/StUnion(STStartPoint))

POLYGON ((531405.73999977112 104148.89000034332, 531414.71999979019 104179.65999984741, 531407.15999984741 104182.27999973297, 531406.94000005722 104182.35000038147, 531404.44000005722 104177.02000045776, 531401.59000015259 104168.47000026703, 531401.59999990463 104168.5, 531401.48999977112 104168.19999980927, 531395.61999988556 104152.19999980927, 531405.73999977112 104148.89000034332))

Geometry as Gml...

<Polygon xmlns="http://www.opengis.net/gml">
  <exterior>
    <LinearRing>
      <posList>531405.73999977112 104148.89000034332 531414.71999979019 104179.65999984741 531407.15999984741 104182.27999973297 531406.94000005722 104182.35000038147 531404.44000005722 104177.02000045776 531401.59000015259 104168.47000026703 531401.59999990463 104168.5 531401.48999977112 104168.19999980927 531395.61999988556 104152.19999980927 531405.73999977112 104148.89000034332</posList>
    </LinearRing>
  </exterior>
</Polygon>



Original gml entry from file I am importing...

<gml:Polygon srsName='osgb:BNG'>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>531406.94,104182.35 531404.44,104177.02 531401.59,104168.47 531401.60,104168.50 531401.49,104168.20 531395.62,104152.20 531405.74,104148.89 531414.72,104179.66 531407.16,104182.28 531406.94,104182.35</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
0 Kudos
22 Replies
ChrisSmith
Emerging Contributor
Hi Vince

Yes lets take it offline, have spoken to ESRI UK support and they will contact you guys to help progress this further. I am assuming you are ESRI Inc Redlands based?

Thanks for the help

chris
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Working through two tech support queues probably isn't the fastest way to access my time,
but it may help with the SE_stream_set_invalidshape_mode issue.

I won't post my e-mail address on the web, but the ArcScripts Contact Author page works.

- V
0 Kudos
ZachoryJones
New Contributor

We use sql spatial and come across the self intersecting error in ArcMap, typically after intersecting two featureclasses using STIntersection().  One way we fix the issue is to use Reduce() to minimize the vertex count and that may resolve the self intersecting error or by using STBuffer().  We have issues with godzilla polygons and using reduce will remove allot of vertices without changing the area significantly.  We manage our data in acres with 2 decimal places and using Reduce(.01) works well.  If you use STBuffer(), it ensures esri reads the sql geometry as a polygon instead of mixed, some records as polygon and some as point or lines.  Adding a very small buffer works for us but I understand it may not for others. example: a.shape.Reduce(.01).STBuffer(.01) as SHAPE

0 Kudos