<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi i have configurate MGOS 2.0.2 whit .Net and IIS, 
i try to make application but when i try to use the example to find a feature 
like a parcel whit id i have problem i run this code and dont have error but the 
xml select dont return nothing because is null only show the head of xml. I 
change the call of GetGeometry method whit "Geom" in the example is "Data" 
because i dont have "Data" attribute whit geometric i have "Geom" whit geometric 
attribute. The layer is a SDF i build it whit autocad map 2009 and firts its a 
shape file and i convert to SDF to use whit MGOS.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>using System;<BR>using System.Data;<BR>using 
System.Configuration;<BR>using System.Collections;<BR>using System.Web;<BR>using 
System.Web.Security;<BR>using System.Web.UI;<BR>using 
System.Web.UI.WebControls;<BR>using System.Web.UI.WebControls.WebParts;<BR>using 
System.Web.UI.HtmlControls;<BR>using OSGeo.MapGuide;<BR>using 
System.Collections.Specialized;<BR>using 
System.Text.RegularExpressions;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>public partial class 
gis_ubicacion_GISFrmInformacionLote : 
System.Web.UI.Page<BR>{<BR>&nbsp;&nbsp;&nbsp; protected void Page_Load(object 
sender, EventArgs e)<BR>&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NameValueCollection 
requestParams = Request.HttpMethod == "GET" ? Request.QueryString : 
Request.Form;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String mgSessionId = 
requestParams["SESSION"];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String 
mgLocale = 
requestParams["LOCALE"];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String 
mgMapName = "mss_map";</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String 
realPath = 
Request.ServerVariables["APPL_PHYSICAL_PATH"];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
String configPath = realPath + 
"..\\webconfig.ini";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MapGuideApi.MgInitializeWebTier(configPath);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MgUserInformation userInfo = new MgUserInformation(mgSessionId);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MgSiteConnection siteConnection = new 
MgSiteConnection();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
siteConnection.Open(userInfo);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MgMap map = new 
MgMap(siteConnection);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
map.Open(mgMapName);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MgFeatureQueryOptions districtQuery = new 
MgFeatureQueryOptions();<BR><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
districtQuery.SetFilter("IDLOT = '40010101'");</STRONG></FONT></DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<STRONG>MgLayer layer = map.GetLayers().GetItem("lay_lote") as 
MgLayer;<BR></STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MgFeatureReader featureReader = 
layer.SelectFeatures(districtQuery);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
featureReader.ReadNext();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MgByteReader districtGeometryData = 
featureReader.GetGeometry("Geom");<BR></STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MgAgfReaderWriter agfReaderWriter = new 
MgAgfReaderWriter();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MgGeometry 
districtGeometry = agfReaderWriter.Read(districtGeometryData);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MgFeatureQueryOptions queryOptions = new 
MgFeatureQueryOptions();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
queryOptions.SetFilter("IDLOT = 
'40010101'");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
queryOptions.SetSpatialFilter("SHPGEOM",districtGeometry,MgFeatureSpatialOperations.Inside);</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layer = 
map.GetLayers().GetItem("lay_lote") as 
MgLayer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; featureReader = 
layer.SelectFeatures(queryOptions);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layer = 
map.GetLayers().GetItem("lay_lote") as 
MgLayer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MgSelection selection = 
new MgSelection(map);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
selection.AddFeatures(layer, featureReader, 
0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String selectionXml = 
selection.ToXml();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
litSelectionXml.Text = Server.HtmlEncode(selectionXml);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
hfSelectionXml.Value = selectionXml;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; }<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Pd. Sorry for my english i speek spanish. 
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Miguel Vasquez</FONT></DIV>
<DIV><FONT face=Arial size=2>Especialista GIS</FONT></DIV>
<DIV><FONT face=Arial size=2>Municipalidad de Santiago de Surco.</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>