resolved! effectivelly i must just reverse order of layer for displaying just difference between both of layers!<br><br>
<div class="gmail_quote">2009/6/5 saloua wakrim <span dir="ltr"><<a href="mailto:wakrimsaloua.wakrim@gmail.com">wakrimsaloua.wakrim@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>hi all developpers! i draw polygones in map on layer wich named "<font color="#800000" size="2">champs_reels</font>" (as my code shows it), i want to draw intersection betwen these polygones and polygones of another layer wich named "batiments" (as my code shows), i want drw a polygones wich constitute difference between both of these polygones (on layers" <font color="#800000">champs_reels" and "<font color="#000000">batiments</font>"), this my code when i compile it it gives me this error:</font></div>
<div>A geometry exception occurred.<br>"TopologyException: side location conflict (893583,107815)", if some one has any idea please tell it me, thanks a lot in advance: what's wrong???</div>
<div> </div>
<div><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> query </font><font color="#0000ff" size="2">As</font><font size="2"> MgFeatureQueryOptions = </font><font color="#0000ff" size="2">New</font><font size="2"> MgFeatureQueryOptions()
<p>query.SetFilter(</p></font><font color="#800000" size="2">"ID<>0"</font><font size="2">)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> clalque_vue_cam </font><font color="#0000ff" size="2">As</font><font size="2"> MgLayer = map.GetLayers().GetItem(</font><font color="#800000" size="2">"champs_reels"</font><font size="2">)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> featureReader </font><font color="#0000ff" size="2">As</font><font size="2"> MgFeatureReader = clalque_vue_cam.SelectFeatures(query)
<p></p></font><font color="#0000ff" size="2">While</font><font size="2"> featureReader.ReadNext()
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> geometrypoly </font><font color="#0000ff" size="2">As</font><font size="2"> MgByteReader = featureReader.GetGeometry(</font><font color="#800000" size="2">"BufferGeometry"</font><font size="2">)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> geometryReaderWriter </font><font color="#0000ff" size="2">As</font><font size="2"> MgAgfReaderWriter = </font><font color="#0000ff" size="2">New</font><font size="2"> MgAgfReaderWriter()
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> poly </font><font color="#0000ff" size="2">As</font><font size="2"> MgPolygon = geometryReaderWriter.Read(geometrypoly)
<p>polygones.Add(poly)</p>
<p> </p>
<p></p></font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">While</font><font color="#0000ff" size="2"><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> propertyValues </font><font color="#0000ff" size="2">As</font><font size="2"> MgPropertyCollection = </font><font color="#0000ff" size="2">New</font><font size="2"> MgPropertyCollection()
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> coordcol </font><font color="#0000ff" size="2">As</font><font size="2"> MgCoordinateCollection = </font><font color="#0000ff" size="2">New</font><font size="2"> MgCoordinateCollection()</font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> query2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgFeatureQueryOptions = </font><font color="#0000ff" size="2">New</font><font size="2"> MgFeatureQueryOptions()
<p>query2.SetFilter(</p></font><font color="#800000" size="2">"FeatId<>0"</font><font size="2">)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> batiments </font><font color="#0000ff" size="2">As</font><font size="2"> MgLayer = map.GetLayers().GetItem(</font><font color="#800000" size="2">"batiments"</font><font size="2">)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> featureReader2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgFeatureReader = batiments.SelectFeatures(query2)
<p> </p>
<p></p></font><font color="#0000ff" size="2">While</font><font size="2"> featureReader2.ReadNext()
<p> </p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> geometrybati </font><font color="#0000ff" size="2">As</font><font size="2"> MgByteReader = featureReader2.GetGeometry(</font><font color="#800000" size="2">"Geometry"</font><font size="2">)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> geometryReaderWriter2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgAgfReaderWriter = </font><font color="#0000ff" size="2">New</font><font size="2"> MgAgfReaderWriter()
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> batiment </font><font color="#0000ff" size="2">As</font><font size="2"> MgPolygon = geometryReaderWriter2.Read(geometrybati)
<p></p></font><font color="#008000" size="2">'listbatiments.Add(batiment)</font><font size="2">
<p></p></font><font color="#008000" size="2">' If polygones(i).Touches(batiment) Then</font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> polyintersection </font><font color="#0000ff" size="2">As</font><font size="2"> MgPolygon = polygones(i).Difference(batiment)
<p></p></font><font color="#0000ff" size="2">'Dim</font><font size="2"> cord </font><font color="#0000ff" size="2">As</font><font size="2"> MgCoordinateIterator = polyintersection.GetCoordinates()
<p> </p>
<p></p></font><font color="#0000ff" size="2">'While</font><font size="2"> cord.MoveNext()
<p></p></font><font color="#0000ff" size="2">'Dim</font><font size="2"> cordonees </font><font color="#0000ff" size="2">As</font><font size="2"> MgCoordinate = cord.GetCurrent()
<p>'coordcol.Add(cordonees)</p><font size="2">
<p></p></font><font color="#0000ff" size="2">'Dim</font><font size="2"> outring </font><font color="#0000ff" size="2">As</font><font size="2"> MgLinearRing = geomfactory.CreateLinearRing(coordcol)
<p></p></font><font color="#0000ff" size="2">'Dim</font><font size="2"> poly </font><font color="#0000ff" size="2">As</font><font size="2"> MgPolygon = geomfactory.CreatePolygon(outring, </font><font color="#0000ff" size="2">Nothing</font><font size="2">)
<p>propertyValues.Add(</p></font><font color="#0000ff" size="2">New</font><font size="2"> MgGeometryProperty(</font><font color="#800000" size="2">"BufferGeometry"</font><font size="2">, </font><font color="#0000ff" size="2">New</font><font size="2"> MgAgfReaderWriter().Write(polyintersection )))
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> insert </font><font color="#0000ff" size="2">As</font><font size="2"> MgInsertFeatures = </font><font color="#0000ff" size="2">New</font><font size="2"> MgInsertFeatures(</font><font color="#800000" size="2">"BufferLayerSchema2:BufferClass2"</font><font size="2">, propertyValues)
<p> </p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> commands </font><font color="#0000ff" size="2">As</font><font size="2"> MgFeatureCommandCollection = </font><font color="#0000ff" size="2">New</font><font size="2"> MgFeatureCommandCollection()
<p>commands.Add(insert)</p>
<p> </p>
<p>feature.UpdateFeatures(bufferFeatureResId2, commands, </p></font><font color="#0000ff" size="2">False</font><font size="2">)</font>
<p></p></font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">While</font>
<p><font size="2"> </font></p>
<p></p></font></div>
<div> </div>
<div> </div>
<div> </div>
<div><font color="#800000"></font> </div></blockquote></div><br>