<div>Ivan,</div>
<div> </div>
<div>When I view the Polygons in Autocad Map - there is a an issue with the left polygon:</div>
<div> </div>
<div>It is not &#39;closed&#39; properly.  When you select the right polygon it is entirely highlighted.  When you select the left polygon, the left boundary segement does not highlight (since it is not there).</div>
<div> </div>
<div>You may have to add the starting coordinate to close it:</div>
<div> </div>
<div>coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y + 50));<br>coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y + 50));<br>coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y - 50));<br>coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y - 50));<br>
coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y + 50));</div>
<div> </div>
<div>Cheers,</div>
<div><br> </div>
<div class="gmail_quote">2009/3/31 Ivan Milicevic <span dir="ltr">&lt;<a href="mailto:Ivan.Milicevic@supranet.hr">Ivan.Milicevic@supranet.hr</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div lang="HR" vlink="purple" link="blue">
<div>
<p>Hello,</p>
<p> </p>
<p>I have strange problem :)</p>
<p> </p>
<p>-2 polygon features in SDF file (left and right) -I can not select left feature -I can select right feature</p>
<p> </p>
<p>In Map 3D 2010 everything looks ok. In FDO Tools, SDF looks just fine. The difference between those features is that left one is created from web code and right one is created from Map 3D.</p>
<p> </p>
<p>Any idea?</p>
<p> </p>
<p>The link below is link to sdf file:</p>
<p><a href="http://www.supranet.hr/downloads/sdf.zip" target="_blank">http://www.supranet.hr/downloads/sdf.zip</a></p>
<p> </p>
<p>and down there is code that I used to create polygon:</p>
<p> </p>
<p>.......main function......</p>
<p>{</p>
<p style="MARGIN-LEFT: 35.4pt">//adding coord to MgCoordinateCollection</p>
<p style="MARGIN-LEFT: 35.4pt">coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y + 50));</p>
<p style="MARGIN-LEFT: 35.4pt">coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y + 50));</p>
<p style="MARGIN-LEFT: 35.4pt">coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y - 50));</p>
<p style="MARGIN-LEFT: 35.4pt">coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y - 50));</p>
<p style="MARGIN-LEFT: 35.4pt"> </p>
<p style="MARGIN-LEFT: 35.4pt">//creating polygon</p>
<p style="MARGIN-LEFT: 35.4pt">MgPolygon polyObjekt = createPolygon();</p>
<p style="MARGIN-LEFT: 35.4pt">byteReader = agfReaderWriter.Write(polyObjekt);</p>
<p style="MARGIN-LEFT: 35.4pt"> </p>
<p style="MARGIN-LEFT: 35.4pt">//defining properties in MgPropertyCollection</p>
<p style="MARGIN-LEFT: 35.4pt">fillProperties(id, napomena, naziv, oznaka, 1, byteReader);</p>
<p style="MARGIN-LEFT: 35.4pt"> </p>
<p style="MARGIN-LEFT: 35.4pt">//inserting in SDF</p>
<p style="MARGIN-LEFT: 35.4pt">insertOnMap();</p>
<p>}</p>
<p> </p>
<p>public MgPolygon createPolygon()</p>
<p>{</p>
<p style="MARGIN-LEFT: 35.4pt">MgLinearRing mgRing = geometryFactory.CreateLinearRing(coords);</p>
<p style="MARGIN-LEFT: 35.4pt">MgLinearRingCollection mgRingCollection = new MgLinearRingCollection();</p>
<p style="MARGIN-LEFT: 35.4pt">mgRingCollection.Add(mgRing);</p>
<p style="MARGIN-LEFT: 35.4pt"> </p>
<p style="MARGIN-LEFT: 35.4pt">MgPolygon mgPoly = geometryFactory.CreatePolygon(mgRing, null);</p>
<p style="MARGIN-LEFT: 35.4pt">return mgPoly;</p>
<p>}</p>
<p> </p>
<p>public void fillProperties(Int32 ID, string napomena, string naziv, string oznaka, Int32 vrstaObjekta, MgByteReader bReader)</p>
<p>{</p>
<p style="MARGIN-LEFT: 35.4pt">properties.Clear();</p>
<p style="MARGIN-LEFT: 35.4pt">properties.Add(new MgInt32Property(&quot;ID&quot;, ID));</p>
<p style="MARGIN-LEFT: 35.4pt">properties.Add(new MgStringProperty(&quot;NAPOMENA&quot;, napomena));</p>
<p style="MARGIN-LEFT: 35.4pt">properties.Add(new MgStringProperty(&quot;NAZIV&quot;, naziv));</p>
<p style="MARGIN-LEFT: 35.4pt">properties.Add(new MgStringProperty(&quot;OZNAKA&quot;, oznaka));</p>
<p style="MARGIN-LEFT: 35.4pt">properties.Add(new MgInt32Property(&quot;VRSTAOBJEKTA&quot;, vrstaObjekta));</p>
<p style="MARGIN-LEFT: 35.4pt">properties.Add(new MgGeometryProperty(&quot;Geom&quot;, bReader));</p>
<p>}</p>
<p> </p>
<p>public void insertOnMap()</p>
<p>{</p>
<p style="MARGIN-LEFT: 35.4pt">MgSiteConnection siteConnection = null;</p>
<p style="MARGIN-LEFT: 35.4pt">MgUserInformation userInfo = new MgUserInformation(mgSessionId);</p>
<p style="MARGIN-LEFT: 35.4pt">siteConnection = new MgSiteConnection();</p>
<p style="MARGIN-LEFT: 35.4pt">siteConnection.Open(userInfo);</p>
<p style="MARGIN-LEFT: 35.4pt">MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;</p>
<p style="MARGIN-LEFT: 35.4pt">MgFeatureService featureService = siteConnection.CreateService(MgServiceType.FeatureService) as MgFeatureService;</p>
<p style="MARGIN-LEFT: 35.4pt">MgResourceIdentifier resId = new MgResourceIdentifier(&quot;Library://PROJEKTI/ZLZ/PODACI/OBJEKTI.FeatureSource&quot;);</p>
<p style="MARGIN-LEFT: 35.4pt">MgFeatureCommandCollection commands = new MgFeatureCommandCollection();</p>
<p style="MARGIN-LEFT: 35.4pt">string layerClassName = &quot;OBJEKTI&quot;;</p>
<p style="MARGIN-LEFT: 35.4pt">MgInsertFeatures mgInsert = new MgInsertFeatures(layerClassName, properties);</p>
<p style="MARGIN-LEFT: 35.4pt">commands.Add(mgInsert);</p>
<p style="MARGIN-LEFT: 35.4pt">featureService.UpdateFeatures(resId, commands, false);</p>
<p>}&quot;</p>
<p> </p>
<p> </p>
<p><b><i><span style="FONT-SIZE: 10pt">Ivan Miličević</span></i></b><span style="FONT-SIZE: 12pt; FONT-FAMILY: &#39;Times New Roman&#39;,&#39;serif&#39;"></span></p>
<p><i><span style="FONT-SIZE: 10pt">voditelj odjela razvoja</span></i></p>
<p> </p>
<p><b><i><span style="FONT-SIZE: 9pt">SUPRA NET d.o.o.<br></span></i></b><i><span style="FONT-SIZE: 9pt">Majstorska 5, 10000 Zagreb<br>CROATIA<br><br>Mobile: +385 (0)91 434-3940<br>Office: +385 (0)1 434-3940<br>Fax: +385 (0)1 434-3999<br>
Email: <a href="mailto:ivan.milicevic@supranet.hr" target="_blank"><span style="COLOR: blue">ivan.milicevic@supranet.hr</span></a></span></i></p>
<p><i><span style="FONT-SIZE: 9pt">URL: <u><span style="COLOR: blue"><a href="http://www.supranet.hr/" target="_blank"><span style="COLOR: blue">www.supranet.hr</span></a></span></u></span></i></p>
<p> </p></div></div><br>_______________________________________________<br>mapguide-users mailing list<br><a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
<br></blockquote></div><br>