[mapguide-users] Re: Create feature source

Lee lee.wade at eurocoast.nsw.gov.au
Sun Nov 28 19:20:19 EST 2010


Hi, what would be the code to create an oracle feature source at
(Library://New Feature source.FeatureSource). My site on MG Studio 2010 has
the oracle connection running. Am running through  MG Enterprise 2010.

This is a query.aspx file that needs to search on the oracle table with
connection properties Library://New Feature source.FeatureSource
 
I think I need to replace the following code with the oracle feature source:

// Create the Feature Source (SDF)

                MgFeatureSchema sdfSchema = this.CreateFilterSchema();
                MgCreateSdfParams sdfParams = new MgCreateSdfParams("MAPCS",
map.GetMapSRS(), sdfSchema);
                featureService.CreateFeatureSource(sdfResId, sdfParams);

                // Create the Layer

                MgResourceIdentifier layerResId = new
MgResourceIdentifier("Session:" + GetParameter(this.args, "SESSION") +
"//Filter.LayerDefinition");
                String layerDefinition =
File.ReadAllText(GetQueryXmlTemplatePath());
                layerDefinition = layerDefinition.Replace("%s",
sdfResId.ToString());

                MgByteReader reader = new MgByteReader(layerDefinition,
"text/xml");
                resourceService.SetResource(layerResId, reader, null);

                layer = new MgLayer(layerResId, resourceService);

                layer.SetName("_QuerySpatialFilter");
                layer.SetLegendLabel("_QuerySpatialFilter");
                layer.SetDisplayInLegend(false);
                layer.SetSelectable(false);

                layers.Insert(0, layer);
            }

thank you
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Create-feature-source-tp5768882p5782902.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list