After much testing, I created a shp with a ESRI's tool, and she has worked.
Before, I was creating the shp with gvSIG, and it seems that there is a
problem in some way not understood with MapGuide.<br><br>Thanks to all.<br><br><br><div class="gmail_quote"><br>2009/3/4 Micho Gar <span dir="ltr"><<a href="mailto:michogar@gmail.com">michogar@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks to all, <br><br>this the XML for this resource<br><br><FeatureSource xsi:noNamespaceSchemaLocation="FeatureSource-1.0.0.xsd"><br>
<Provider>OSGeo.SHP</Provider><br>−<br><Parameter><br>
<Name>DefaultFileLocation</Name><br><Value>%MG_DATA_PATH_ALIAS[datos]%poligonos/zonas.shp</Value><br></Parameter><br>−<br><Parameter><br><Name>TemporaryFileLocation</Name><br>
<Value>%MG_DATA_PATH_ALIAS[datos]%temp/</Value><br></Parameter><br></FeatureSource><br><br><div style="text-align: left;" dir="ltr">I am still looking for that these days I could not get it.<br>
<br><br><br><br></div><br><br><div class="gmail_quote">2009/3/3 Ivan Milicevic <span dir="ltr"><<a href="mailto:Ivan.Milicevic@supranet.hr" target="_blank">Ivan.Milicevic@supranet.hr</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
<div link="blue" vlink="purple" lang="HR">
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">MIcho,</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Please, open </span><a href="http://gis.supranet.hr/mapguide/mapagent/index.html" target="_blank">http://gis.supranet.hr/mapguide/mapagent/index.html</a>
click on Resource->GetResourceContent</p>
<p> </p>
<p>Maybe your feature source is set to rtead only. I had the
same problem in past couple of days.<span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:mapguide-users-bounces@lists.osgeo.org" target="_blank">mapguide-users-bounces@lists.osgeo.org</a>
[mailto:<a href="mailto:mapguide-users-bounces@lists.osgeo.org" target="_blank">mapguide-users-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Micho Gar<br>
<b>Sent:</b> Monday, March 02, 2009 6:44 PM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> [mapguide-users] Polygon are not recorded in feature</span></p>
</div><div><div></div><div>
<p> </p>
<p>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("Library://ConectorGPS/Datos/poligonosZonas.FeatureSource");<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<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("Geometry", geom));<br>
propiedades.Add(new MgStringProperty("ID", "zona1"));<br>
zonasComando.Add(new MgInsertFeatures("zonasCapa", 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("zonasCapa");<br>
zonasCapa.SetVisible(true);<br>
zonasCapa.ForceRefresh();<br>
mapa.Save(resourceService); <br>
out.println("finish");<br>
<br>
<br>
Thanks<br clear="all">
<br>
-- <br>
# michogar<br>
# Analista Programador SIG<br>
# Ubuntu Linux Counter 462666<br>
<br>
<br>
<br>
"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!."<br>
<br>
<br>
"It has a legend that if you play an original Windows Vista DVD backwards
to hear Bill Gates Satanic chanting songs ... But that's not the worst ... If
you play it right ... It installs!. </p>
</div></div></div>
</div>
<br></div></div><div class="im">_______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">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></div></blockquote></div><br><br clear="all"><div><div></div><div class="h5"><br>-- <br># michogar<br># Analista Programador SIG<br># Ubuntu Linux Counter 462666<br><br><br><br>"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!."<br>
<br>        <br>"It has a legend that if you play an original Windows Vista DVD backwards to hear Bill Gates Satanic chanting songs ... But that's not the worst ... If you play it right ... It installs!. <br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br># michogar<br># Analista Programador SIG<br># Ubuntu Linux Counter 462666<br><br><br><br>"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!."<br>
<br>        <br>"It has a legend that if you play an original Windows Vista DVD backwards to hear Bill Gates Satanic chanting songs ... But that's not the worst ... If you play it right ... It installs!. <br>