<br><font size=2 face="sans-serif">The xml file is 4.5mo</font>
<br>
<br><font size=2 face="sans-serif">Thank you very much for your help, I'll
follow your advices.</font>
<br><font size=2 face="sans-serif">Steve</font>
<br><font size=2 face="sans-serif"><br>
</font><font size=3 color=#0066ff><i>Steve Toutant, M. Sc.</i></font><font size=3><br>
Analyste en géomatique<br>
Secteur environnement<br>
Direction des risques biologiques, environnementaux et occupationnels<br>
Institut national de santé publique du Québec<br>
945, avenue Wolfe<br>
Québec, Qc G1V 5B3 </font>
<p><font size=3>Tél.: (418) 650-5115 #5281<br>
Fax.: (418) 654-3144</font><font size=3 color=blue><u><br>
</u></font><a href=mailto:steve.toutant@inspq.qc.ca><font size=3 color=blue><u>steve.toutant@inspq.qc.ca</u></font></a><font size=3 color=blue><u><br>
</u></font><a href=http://www.inspq.qc.ca/><font size=3 color=blue><u>http://www.inspq.qc.ca</u></font></a>
<p><font size=3>&nbsp; </font>
<p>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Julien-Samuel Lacroix &lt;jlacroix@mapgears.com&gt;</b>
</font>
<p><font size=1 face="sans-serif">08/06/2009 01:37 PM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">A</font></div>
<td><font size=1 face="sans-serif">Steve.Toutant@inspq.qc.ca</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">&quot;Heidt, Christopher M.&quot; &lt;CHRISTOPHER.M.HEIDT@saic.com&gt;,
users@openlayers.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td><font size=1 face="sans-serif">Re: [OpenLayers-Users] Problem to load
a WFS</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br>
<br>
<br><tt><font size=2>I think it's possible that too much records make things
fail. I strongly <br>
suggest you to use a WMS layer when zoomed-out and replace it by the WFS
<br>
when zoomed-in. The other option would be to pre-cluster your data on <br>
the server side before sending the BIG WFS XML to the client.<br>
<br>
Just out of curiosity, how big (???Mo) is your 8745 records XML?<br>
<br>
Julien<br>
<br>
Steve.Toutant@inspq.qc.ca wrote:<br>
&gt; <br>
&gt; There are 8745 records in the database. That is why I tried to use
the <br>
&gt; cluster strategy in the first place without success because of the
error <br>
&gt; pointed out by Maxime.<br>
&gt; <br>
&gt; So I tried with a smaller dataset and the wfs layer and the cluster
<br>
&gt; strategy works perfectly.<br>
&gt; It's still doesn't work for the &quot;big&quot; dataset. So I guess
there a too <br>
&gt; many records. Even with the cluster strategy it doesn't load.<br>
&gt; <br>
&gt; 1- Does the cluster strategy should work for 8745 records requested
from <br>
&gt; a shapefile or postgis?<br>
&gt; 2- I cannot set the visibility of this vector layer to false. The
<br>
&gt; request is sent when the page load.<br>
&gt; <br>
&gt; Here is the definition of my Vector layer:<br>
&gt; var WFSstyle = new OpenLayers.Style({<br>
&gt; &nbsp; &nbsp; &nbsp;pointRadius: &quot;${radius}&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp;fillColor: &quot;#71FF00&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp;fillOpacity: 0.5,<br>
&gt; &nbsp; &nbsp; &nbsp;strokeColor: &quot;#000&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp;strokeWidth: 2,<br>
&gt; &nbsp; &nbsp; &nbsp;strokeOpacity: 0.3<br>
&gt; }, {<br>
&gt; &nbsp; &nbsp; &nbsp;context: {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; radius: function(feature) { &nbsp;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return Math.min(feature.attributes.count,7)
+ 4;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; &nbsp;}<br>
&gt; });<br>
&gt; &nbsp;<br>
&gt; wfsStrategy = new OpenLayers.Layer.Vector(&quot;HLM WFS Strategy&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp;{<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strategies: [<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;new OpenLayers.Strategy.Fixed(),<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;new OpenLayers.Strategy.Cluster()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protocol: new OpenLayers.Protocol.HTTP({<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;url: <br>
&gt; &quot;http://geo.inspq.rtss.qc.ca/cgi-bin/mapserv.exe?map=/ms4w/paccSante/map/paccsante2.map&quot;,
<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;params: {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
format: &quot;WFS&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
service: &quot;WFS&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
request: &quot;GetFeature&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
srs: &quot;EPSG:900913&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
VERSION : &quot;1.0.0&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
typename : 'HLM_shp_wfs2'<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;format: new
OpenLayers.Format.GML()<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }),<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; styleMap:new OpenLayers.StyleMap({<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;default&quot;:
WFSstyle,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;select&quot;:
{<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
fillColor: &quot;#8aeeef&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
strokeColor: &quot;#32a8a9&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br>
&gt; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp;{<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extractAttributes:true,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; visibility:
false,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displayInLayerSwitcher: true &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
&gt; &nbsp; &nbsp; &nbsp;});<br>
&gt; <br>
&gt; /Steve Toutant, M. Sc./<br>
&gt; Analyste en géomatique<br>
&gt; Secteur environnement<br>
&gt; Direction des risques biologiques, environnementaux et occupationnels<br>
&gt; Institut national de santé publique du Québec<br>
&gt; 945, avenue Wolfe<br>
&gt; Québec, Qc G1V 5B3<br>
&gt; <br>
&gt; Tél.: (418) 650-5115 #5281<br>
&gt; Fax.: (418) 654-3144_<br>
&gt; __steve.toutant@inspq.qc.ca_ &lt;mailto:steve.toutant@inspq.qc.ca&gt;_<br>
&gt; __http://www.inspq.qc.ca_ &lt;http://www.inspq.qc.ca/&gt;<br>
&gt; <br>
&gt; &nbsp;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; *&quot;Heidt, Christopher M.&quot; &lt;CHRISTOPHER.M.HEIDT@saic.com&gt;*<br>
&gt; <br>
&gt; 08/06/2009 11:02 AM<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
&gt; A<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;Steve.Toutant@inspq.qc.ca&gt;,
&quot;Julien-Samuel Lacroix&quot; <br>
&gt; &lt;jlacroix@mapgears.com&gt;, &lt;users@openlayers.org&gt;<br>
&gt; cc<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
&gt; Objet<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RE:
[OpenLayers-Users] Problem to load a WFS<br>
&gt; <br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; How many features are you getting?<br>
&gt; &nbsp;<br>
&gt; <br>
&gt; ------------------------------------------------------------------------<br>
&gt; *From:* users-bounces@openlayers.org <br>
&gt; [mailto:users-bounces@openlayers.org] *On Behalf Of <br>
&gt; *Steve.Toutant@inspq.qc.ca*<br>
&gt; Sent:* Monday, June 08, 2009 10:59 AM*<br>
&gt; To:* Julien-Samuel Lacroix; users@openlayers.org*<br>
&gt; Subject:* Re: [OpenLayers-Users] Problem to load a WFS<br>
&gt; <br>
&gt; <br>
&gt; In the console TAB there is a GET call to my WFS,<br>
&gt; http://geo.inspq.rtss.qc.ca/cgi-bin/mapserv.exe?map=/ms4w/paccSante/map/paccsante2.map&amp;typename=HLM_shp_wfs2&amp;srsName=EPSG%3A900913&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;SRS=EPSG%3A900913&amp;BBOX=-13586195.339050002,2515633.1906250007,-1219295.6609499985,12299572.809375
<br>
&gt; <br>
&gt; <br>
&gt; I can see the Params and the Header but the Reponse tab is empty.
After <br>
&gt; several minutes I got this message<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Here is line #1481<br>
&gt; return envelope;}},parseAttributes:function(node){var attributes={};var
<br>
&gt; childNode=node.firstChild;var <br>
&gt; children,i,child,grandchildren,grandchild,name,value;while(childNode){if(childNode.nodeType==1){children=childNode.childNodes;for(i=0;i&lt;children.length;++i){child=children[i];if(child.nodeType==1){grandchildren=child.childNodes;if(grandchildren.length==1){grandchild=grandchildren[0];if(grandchild.nodeType==3||grandchild.nodeType==4){name=(child.prefix)?child.nodeName.split(&quot;:&quot;)[1]:child.nodeName;value=grandchild.nodeValue.replace(this.regExes.trimSpace,&quot;&quot;);attributes[name]=value;}}}}
<br>
&gt; <br>
&gt; <br>
&gt; If I call the link above directly int IE or Firefox I get the XML
file.<br>
&gt; Also the memory of computer jump to 3gig and I got to kill firefox
(I'm <br>
&gt; on windows)<br>
&gt; <br>
&gt; thanks for your help,<br>
&gt; Steve<br>
&gt; <br>
&gt; <br>
<br>
-- <br>
Julien-Samuel Lacroix<br>
Mapgears<br>
http://www.mapgears.com/<br>
</font></tt>
<br>
<br>
<br>