<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19328"></HEAD>
<BODY>
<DIV><FONT size=2 face=Arial><SPAN
class=018415514-06112012>Hello,</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=018415514-06112012>When trying to
perform a spatial query (excerpt of code is below), I get after around 4 minutes
an "500 Internal Server Error" in Firebug. The MapGuide error.log file shows
nothing.</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=018415514-06112012>I have a layer with
around 2500 polygons and a layer with 2500 points (both SDF, same
coordinate system). The goal should be to show the points that have a specific
serial number and are also inside a polygon.</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=018415514-06112012>When reducing the
number of objects in the polygon layer to around 2100, everything works fine. It
seems MapGuide can't take more polygon objects for a spatial query. Memory
isn't a problem: mgserver.exe is only about 80MB during the
query.</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=018415514-06112012></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=018415514-06112012>Has anyone
got</SPAN></FONT><FONT size=2 face=Arial><SPAN class=018415514-06112012> an
idea, on how to process more than the 2100 objects?</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=018415514-06112012></SPAN></FONT><FONT
size=2 face=Arial></FONT> </DIV>
<DIV><SPAN class=018415514-06112012><FONT size=2
face=Arial>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=018415514-06112012><FONT size=2
face=Arial>Jan</FONT></SPAN></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=018415514-06112012>MapGuide Open Source
2.2 32bit, WinXP, 2 GB RAM</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=018415514-06112012>Basic
Layout</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=018415514-06112012>Code
(excerpt):</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> $inputGeometries =
new MgPolygonCollection();</FONT></DIV>
<DIV><FONT size=2 face=Arial> $<SPAN
class=018415514-06112012>abfrage</SPAN> = new
MgFeatureQueryOptions();</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> $layer =
$map->GetLayers()->GetItem('<SPAN
class=018415514-06112012>Polygonlayer'</SPAN>);<BR>
$featureReader = $layer->SelectFeatures($<SPAN
class=018415514-06112012>abfrage</SPAN>);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
while
($featureReader->ReadNext())<BR>
{<BR>
$featureGeometryData =
$featureReader->GetGeometry('Geometry');<BR>
$featureGeometry =
$agfReaderWriter->Read($featureGeometryData);<BR>
$inputGeometries->Add($featureGeometry);<BR>
}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
$geometryFactory = new
MgGeometryFactory();<BR>
$mergedGeometries =
$geometryFactory->CreateMultiPolygon($inputGeometries);<BR>
$queryOptions = new MgFeatureQueryOptions();</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
$selection = new MgSelection($map); </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
$layer = $map->GetLayers()->GetItem('<SPAN
class=018415514-06112012>Pointlayer'</SPAN>);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
$suchfilter = "(" . $schluessel1 . " = " . $jahr . ") AND (" . $schluessel2 . "
= " . $serie .
")";<BR> <BR> <SPAN
class=018415514-06112012> </SPAN>
$queryOptions->SetFilter($suchfilter);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
$queryOptions->SetSpatialFilter('Geometry', $mergedGeometries,
MgFeatureSpatialOperations::Inside);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
$featureReader = $layer->SelectFeatures($queryOptions);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
$selection->AddFeatures($layer, $featureReader, 0);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial>
$selectionXml = $selection->ToXml();<BR></FONT></DIV></BODY></HTML>