<div>If the polygons are loaded as a Shapefile without the SDF conversion, the spatialfilter query will work on both polygons and the GetFeatureInfo WMS call will work as well.</div>
<div> </div>
<div>The spatialfilter returns a MgPolygon where the first polygon is the ExteriorRing and the second is the InteriorRing.</div>
<div> </div>
<div> </div>
<div>So this scenario will work fine without converting to SDF.</div>
<div> </div>
<div> </div>
<div>Cheers,</div>
<div> </div>
<div> </div>
<div>Kori Maleski</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Thu, Jan 15, 2009 at 11:51 AM, Kori Maleski <span dir="ltr"><<a href="mailto:kori.maleski@gmail.com">kori.maleski@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Thanks Mark,</div>
<div> </div>
<div>That clarifies what I am seeing. </div>
<div> </div>
<div>GetGeometryType() only yields MgPolygon instead of MgMultiPolygon, so it is the conversion to SDF where the Shapefile geometry is lost/changed.</div>
<div> </div>
<div>The Repair Geometry in ArcMap was already completed and does not affect nor remedy the issue.</div>
<div> </div>
<div> </div>
<div>To workaround the issue (in SDF format):</div>
<div> </div>
<div>I have to explode the Polygon into 2 Pieces.</div>
<div>Then I have to do a spatial filter to retrieve the common ID.</div>
<div>Then requery to get both of the desired geometries.</div>
<div> </div>
<div> </div>
<div>I will test my application to see if utilizing the shape file without converting behaves properly with my code and the WMS.</div>
<div> </div>
<div> </div>
<div>Cheers and thanks,</div>
<div> </div><font color="#888888">
<div> </div>
<div>Kori Maleski</div></font>
<div>
<div></div>
<div class="Wj3C7c">
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Thu, Jan 15, 2009 at 11:35 AM, Mark Pendergraft <span dir="ltr"><<a href="mailto:markp@meadgilman.com" target="_blank">markp@meadgilman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div lang="EN-US" vlink="purple" link="blue">
<div>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">I queried the feature programmatically (as a SDF) and tried to assign it to a mgMultiPolygon and it didn't fly. It did work as a mgPolygon though.</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">So, the problem seems to be that the geometry is being stored as a polygon instead of a multipolygon. I have features in my map that aren't connected and I'm able to select them with no problem, but they are multipolygons. This must have something to do with the conversion process in ArcMap or in MapGuide Studio. I don't have ArcMap so I can't comment on what is going on in that arena. Your guess is as good as mine on whether this is an ArcMap issue or a MapGuide Studio issue.</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d"> </span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">However, if you load the data as a SHP file (uncheck "convert to SDF" in MapGuide Studio) and then view the layer in Studio, you can select either side. So perhaps the solution is to just use the SHP file in your map instead of converting it to SDF.</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d"> </span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">Hope that helps</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">-Mark Pendergraft</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d"> </span></p>
<div style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<p><b><span style="FONT-SIZE: 10pt">From:</span></b><span style="FONT-SIZE: 10pt"> <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>Kori Maleski<br>
<b>Sent:</b> Thursday, January 15, 2009 9:41 AM
<div><br><b>To:</b> MapGuide Users Mail List<br></div><b>Subject:</b> Re: [mapguide-users] Polygons and Intersection Problem</span>
<p></p>
<p></p></p></div>
<div>
<div></div>
<div>
<p> </p>
<div>
<p>In the studio preview, it fails as well.</p></div>
<div>
<p> </p></div>
<div>
<p>Using the select tool, clicking on one polygon will highlight/select the entirety, while clicking on the other will yield no highlight/select.</p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p>Cheers,</p></div>
<div>
<p> </p></div>
<div>
<p>Kori Maleski</p></div>
<div>
<p> </p></div>
<div>
<p><br><br> </p></div>
<div>
<p>On Thu, Jan 15, 2009 at 10:16 AM, Kori Maleski <<a href="mailto:kori.maleski@gmail.com" target="_blank">kori.maleski@gmail.com</a>> wrote:</p>
<div>
<p>Mark,</p></div>
<div>
<p> </p></div>
<div>
<p>I have attached a shapefile with one of the polygons in question. The spatialfilter fails on any dissolve multipolygon like this one.</p></div>
<div>
<p> </p></div>
<div>
<p>Again, I converted it to sdf via a load procedure.</p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p>Cheers,</p></div>
<div>
<p>Kori Maleski</p></div>
<div>
<p> </p></div>
<div>
<p><br> </p></div>
<div>
<div>
<div>
<p>On Thu, Jan 15, 2009 at 10:08 AM, Mark Pendergraft <<a href="mailto:markp@meadgilman.com" target="_blank">markp@meadgilman.com</a>> wrote:</p></div></div>
<blockquote style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 6pt; PADDING-BOTTOM: 0in; MARGIN-LEFT: 4.8pt; BORDER-LEFT: #cccccc 1pt solid; MARGIN-RIGHT: 0in; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<div>
<div>
<div>
<div>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">Could you upload your SDF file with the 2 polygons?</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">-Mark P.</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d"> </span></p>
<div style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<p><b><span style="FONT-SIZE: 10pt">From:</span></b><span style="FONT-SIZE: 10pt"> <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>Kori Maleski<br>
<b>Sent:</b> Thursday, January 15, 2009 9:03 AM<br><b>To:</b> MapGuide Users Mail List<br><b>Subject:</b> [mapguide-users] Polygons and Intersection Problem</span></p></div>
<div>
<div>
<p> </p>
<div>
<p> </p></div>
<div>
<p>Hi All,</p></div>
<div>
<p> </p></div>
<div>
<p>Intersection problem:</p></div>
<div>
<p> </p></div>
<div>
<p>I have an application performs a query on a polygon layer with a point - using intersection with the spatialfilter.</p></div>
<div>
<p> </p></div>
<div>
<p>The problem is this:</p></div>
<div>
<p> </p></div>
<div>
<p>The polygon originated from a shapefile - loaded as SDF via studio.</p></div>
<div>
<p>The single polygon feature originally was 2 distinct polygons dissolved together via ArcMap.</p></div>
<div>
<p> </p></div>
<div>
<p>The intersection works only on one of the polygons, and fails to return a feature reader at all when within the other polygon.</p></div>
<div>
<p> </p></div>
<div>
<p>This fails in both code execution and as a GeFeatureInfo WMS request in the same manner.</p></div>
<div>
<p> </p></div>
<div>
<p>Has anyone encountered this?</p></div>
<div>
<p>Has anyone worked around?</p></div>
<div>
<p> </p></div>
<div>
<p>Is it better to explode the feature? I require the geometery from each part to do a highlight.</p></div>
<div>
<p> </p></div>
<div>
<p>Is there an issue with how a shapefile multipolygon is converted to SDF?</p></div>
<div>
<p>Or is this an isse with the SelectFeatures functionality?</p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p>Cheers,</p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p>Kori Maleski</p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p>$geometryFactory = new MgGeometryFactory();<br> <br> // create a coordinate<br> $coordinate = $geometryFactory->CreateCoordinateXY($x,$y);<br> <br> // create a point<br> $point = $geometryFactory->CreatePoint($coordinate);<br>
<br> $queryOptions = new MgFeatureQueryOptions();<br> $queryOptions->SetSpatialFilter('Geometry',$point,MgFeatureSpatialOperations::Intersects);<br> <br> <br> $layerResource = new MgResourceIdentifier($layerdefinition); <br>
$layer = new MgLayer($layerResource, $resourceService);<br> <br> <br> $layerClassName = $layer->GetFeatureClassName();<br> <br> $layerFeatureId = $layer->GetFeatureSourceId(); <br> $layerFeatureResource = new MgResourceIdentifier($layerFeatureId); <br>
$layerId = $layer->GetObjectId(); <br> <br> $featureReader = $featureService->SelectFeatures($layerFeatureResource,$layerClassName,$queryOptions); </p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p> </p></div>
<div>
<p> </p></div></div></div></div></div>
<p> </p></div></div>
<p style="MARGIN-BOTTOM: 12pt">_______________________________________________<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></p>
</blockquote></div>
<p> </p></div>
<p> </p></div></div></div></div><br>_______________________________________________<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></blockquote></div><br></div></div></blockquote></div><br>