<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> </font>
<p>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Julien-Samuel Lacroix <jlacroix@mapgears.com></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">"Heidt, Christopher M." <CHRISTOPHER.M.HEIDT@saic.com>,
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>
> <br>
> There are 8745 records in the database. That is why I tried to use
the <br>
> cluster strategy in the first place without success because of the
error <br>
> pointed out by Maxime.<br>
> <br>
> So I tried with a smaller dataset and the wfs layer and the cluster
<br>
> strategy works perfectly.<br>
> It's still doesn't work for the "big" dataset. So I guess
there a too <br>
> many records. Even with the cluster strategy it doesn't load.<br>
> <br>
> 1- Does the cluster strategy should work for 8745 records requested
from <br>
> a shapefile or postgis?<br>
> 2- I cannot set the visibility of this vector layer to false. The
<br>
> request is sent when the page load.<br>
> <br>
> Here is the definition of my Vector layer:<br>
> var WFSstyle = new OpenLayers.Style({<br>
> pointRadius: "${radius}",<br>
> fillColor: "#71FF00",<br>
> fillOpacity: 0.5,<br>
> strokeColor: "#000",<br>
> strokeWidth: 2,<br>
> strokeOpacity: 0.3<br>
> }, {<br>
> context: {<br>
> radius: function(feature) { <br>
> return Math.min(feature.attributes.count,7)
+ 4;<br>
> }<br>
> }<br>
> });<br>
> <br>
> wfsStrategy = new OpenLayers.Layer.Vector("HLM WFS Strategy",<br>
> {<br>
> strategies: [<br>
> new OpenLayers.Strategy.Fixed(),<br>
> new OpenLayers.Strategy.Cluster()
<br>
> ],<br>
> protocol: new OpenLayers.Protocol.HTTP({<br>
> url: <br>
> "http://geo.inspq.rtss.qc.ca/cgi-bin/mapserv.exe?map=/ms4w/paccSante/map/paccsante2.map",
<br>
> <br>
> params: {<br>
>
format: "WFS",<br>
>
service: "WFS",<br>
>
request: "GetFeature",<br>
>
srs: "EPSG:900913",<br>
>
VERSION : "1.0.0",<br>
>
typename : 'HLM_shp_wfs2'<br>
> },<br>
> format: new
OpenLayers.Format.GML()<br>
> }),<br>
> styleMap:new OpenLayers.StyleMap({<br>
> "default":
WFSstyle,<br>
> "select":
{<br>
>
fillColor: "#8aeeef",<br>
>
strokeColor: "#32a8a9"<br>
> }<br>
> })<br>
> },<br>
> {<br>
> extractAttributes:true,<br>
> visibility:
false,<br>
> displayInLayerSwitcher: true
<br>
> });<br>
> <br>
> /Steve Toutant, M. Sc./<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<br>
> <br>
> Tél.: (418) 650-5115 #5281<br>
> Fax.: (418) 654-3144_<br>
> __steve.toutant@inspq.qc.ca_ <mailto:steve.toutant@inspq.qc.ca>_<br>
> __http://www.inspq.qc.ca_ <http://www.inspq.qc.ca/><br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> *"Heidt, Christopher M." <CHRISTOPHER.M.HEIDT@saic.com>*<br>
> <br>
> 08/06/2009 11:02 AM<br>
> <br>
> <br>
> A<br>
> <Steve.Toutant@inspq.qc.ca>,
"Julien-Samuel Lacroix" <br>
> <jlacroix@mapgears.com>, <users@openlayers.org><br>
> cc<br>
> <br>
> Objet<br>
> RE:
[OpenLayers-Users] Problem to load a WFS<br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> How many features are you getting?<br>
> <br>
> <br>
> ------------------------------------------------------------------------<br>
> *From:* users-bounces@openlayers.org <br>
> [mailto:users-bounces@openlayers.org] *On Behalf Of <br>
> *Steve.Toutant@inspq.qc.ca*<br>
> Sent:* Monday, June 08, 2009 10:59 AM*<br>
> To:* Julien-Samuel Lacroix; users@openlayers.org*<br>
> Subject:* Re: [OpenLayers-Users] Problem to load a WFS<br>
> <br>
> <br>
> In the console TAB there is a GET call to my WFS,<br>
> http://geo.inspq.rtss.qc.ca/cgi-bin/mapserv.exe?map=/ms4w/paccSante/map/paccsante2.map&typename=HLM_shp_wfs2&srsName=EPSG%3A900913&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A900913&BBOX=-13586195.339050002,2515633.1906250007,-1219295.6609499985,12299572.809375
<br>
> <br>
> <br>
> I can see the Params and the Header but the Reponse tab is empty.
After <br>
> several minutes I got this message<br>
> <br>
> <br>
> <br>
> <br>
> Here is line #1481<br>
> return envelope;}},parseAttributes:function(node){var attributes={};var
<br>
> childNode=node.firstChild;var <br>
> children,i,child,grandchildren,grandchild,name,value;while(childNode){if(childNode.nodeType==1){children=childNode.childNodes;for(i=0;i<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(":")[1]:child.nodeName;value=grandchild.nodeValue.replace(this.regExes.trimSpace,"");attributes[name]=value;}}}}
<br>
> <br>
> <br>
> If I call the link above directly int IE or Firefox I get the XML
file.<br>
> Also the memory of computer jump to 3gig and I got to kill firefox
(I'm <br>
> on windows)<br>
> <br>
> thanks for your help,<br>
> Steve<br>
> <br>
> <br>
<br>
-- <br>
Julien-Samuel Lacroix<br>
Mapgears<br>
http://www.mapgears.com/<br>
</font></tt>
<br>
<br>
<br>