<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2838" name=GENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2>Hi Rod,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2>Are you sure that "Shape" is the field with the geometry in
it? In my experience, shapefiles that are loaded by a Load Procedure use a
geometry column of "Geometry".</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2>Try echoing out the following:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2>
$featureReader->GetClassDefinition()->GetDefaultGeometryPropertyName();<o:p></o:p></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006></SPAN><SPAN
class=827015819-11042006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2>BTW; Sylvan Lake is cool. My aunt and uncle
have a farm near Bluffton/Rimbey and I've been there for both summers and ice
fishing. Good memories.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2>Jason</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=827015819-11042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Rod Buchinski
[mailto:rbuchinski@sylvanlake.ca] <BR><B>Sent:</B> Tuesday, April 11, 2006
12:21<BR><B>To:</B> users@mapguide.osgeo.org<BR><B>Subject:</B> [mapguide-users]
Specify Shapefile Geometry<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Good Day,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">For some reason mapguide is unable
to understand the geometry of my shapefile. The shapefile is a polygon with the
geometry information contained in the ‘Shape’ field. However when I use the
‘Shape’ field in the following code I get an error which states: “The specified
object was not found – GetItem line 115”. </SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here is the code:</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
$byteReader = $featureReader->GetGeometry('Shape');</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
$geometry = $geometryReaderWriter->Read($byteReader);</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
$point = $geometry->GetCentroid();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
$x = $point->GetCoordinate()->GetX();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
$y = $point->GetCoordinate()->GetY();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">so what I think should happen here
is the GetGeometry function should look at the ‘Shape’ field, identify that the
shapefile is a polygon, then get the xy coordinates of the centroid of the
polygon which is then sent to another function which can then zoom to
those coordinates. But I keep getting the error that I mentioned. Could anyone
point me in the right direction?</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt">Rod</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV></BODY></HTML>