Hi all, <br>         <br>I have a code that should save the polygons in the feature source after using the Digitize. In principle I do not give any error, but when reviewing the shp the polygon don´t appear. I leave with you the code because I don´t see anything bad.<br>
<br>MgUserInformation userInfo = new MgUserInformation(sessionId);<br>MgSiteConnection siteConnection = new MgSiteConnection();<br>siteConnection.Open(userInfo);<br><br>MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);<br>
MgFeatureService featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);<br><br>MgResourceIdentifier zonasFeatureId = new MgResourceIdentifier(&quot;Library://ConectorGPS/Datos/poligonosZonas.FeatureSource&quot;);<br>
MgFeatureCommandCollection zonasComando = new MgFeatureCommandCollection();<br><br>//Abrimos el mapa<br>MgMap mapa = new MgMap();<br>mapa.Open(resourceService, mapName);<br><br>//creamos la geometria<br>MgGeometryFactory geometryFactory = new MgGeometryFactory();<br>
MgCoordinateCollection coordinateCollection = new MgCoordinateCollection();<br>//MgLinearRingCollection interiorRingCollection = new MgLinearRingCollection();<br>MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter();<br>
<br>int count = xCollection.length;<br>for(int i=0; i&lt;count;i++)<br>{<br>    Double x = Double.valueOf(xCollection[i]);<br>    Double y = Double.valueOf(yCollection[i]);<br>    MgCoordinate  coordinate = geometryFactory.CreateCoordinateXY(x,y);<br>
    coordinateCollection.Add(coordinate);<br>}<br>MgLinearRing exteriorRing = geometryFactory.CreateLinearRing(coordinateCollection);<br>MgPolygon polygon = geometryFactory.CreatePolygon(exteriorRing,null);<br>MgByteReader geom = geometryReaderWriter.Write(polygon);<br>
<br>//creamos una coleccion de propiedades y la insertamos<br>MgPropertyCollection propiedades = new MgPropertyCollection();<br>propiedades.Add(new MgGeometryProperty(&quot;Geometry&quot;, geom));<br>propiedades.Add(new MgStringProperty(&quot;ID&quot;, &quot;zona1&quot;));<br>
zonasComando.Add(new MgInsertFeatures(&quot;zonasCapa&quot;, propiedades));<br><br>featureService.UpdateFeatures(zonasFeatureId, zonasComando, false);<br><br>//capturamos la capa para salvar el mapa y refrescar<br>MgLayerBase zonasCapa = mapa.GetLayers().GetItem(&quot;zonasCapa&quot;);<br>
zonasCapa.SetVisible(true);<br>zonasCapa.ForceRefresh();<br>mapa.Save(resourceService);    <br>out.println(&quot;finish&quot;);<br><br><br>Thanks<br clear="all"><br>-- <br># michogar<br># Analista Programador SIG<br># Ubuntu Linux Counter 462666<br>
<br><br><br>&quot;Cuenta una leyenda que si reproduces un DVD de Windows Vista original al revés se oye a Bill Gates entonando cantos satánicos... Pero eso no es lo peor... Si lo reproduces del derecho... ¡Se instala!.&quot;<br>
<br>        <br>&quot;It has a legend that if you play an original Windows Vista DVD backwards to hear Bill Gates Satanic chanting songs ... But that&#39;s not the worst ... If you play it right ... It installs!. <br>