[mapguide-users] Re: Inserting features in PostGIS fails

ar_gaeta ar_gaeta at yahoo.it
Wed Dec 29 09:12:11 EST 2010


Solved.
The problem was that I called:

MgInsertFeatures insertFeature1 = new MgInsertFeatures(layername,
properties); 
layer.UpdateFeatures(commands); 

Instead the right way is to use:

        MgLayer layer = (MgLayer)map.GetLayers().GetItem(layername);
	String layerFeatureId = layer.GetFeatureSourceId();
        MgResourceIdentifier fdo_ris = new
MgResourceIdentifier(layerFeatureId);	
	String layerClassName = layer.GetFeatureClassName();

        MgPropertyCollection properties = new MgPropertyCollection();
	properties.Add(new MgDoubleProperty("id_analisi", id_analisi));

	MgInsertFeatures insertFeature1 = new MgInsertFeatures(layerClassName,
properties);
	MgFeatureCommandCollection commands = new MgFeatureCommandCollection();
	commands.Add(insertFeature1);
	featureService.UpdateFeatures(fdo_ris, commands, false);

If someone need the complete code, could ask me.

Bye.
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Inserting-features-in-PostGIS-fails-tp1813557p5874539.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list