Doctrine、PostGIS 和 MapFish 的性能问题
我正在使用 Symfony 和 MapFish 插件 http://www.symfony-project.org 开发 WebGIS 应用程序/plugins/sfMapFishPlugin
我使用 MapFish 生成的 GeoJSON 通过 OpenLayers 渲染图层,当然是在矢量图层中。
当我显示多达 3k 个功能的图层时,一切正常。当我尝试使用具有 10k 或更多功能的层时,应用程序崩溃。我不知道阈值,因为我的层要么具有 2-3k 个特征,要么具有 10-13k 个特征。
我认为问题与学说有关,因为日志中的最后一个报告类似于:
Sep 02 13:22:40 symfony [info] {Doctrine_Connection_Statement} execute :
然后查询以获取地理记录。
我说我认为问题在于特征的数量。因此,我使用 OpenLayers.Strategy.BBox() 来减少要获取和显示的功能数量。结果是一样的。该应用程序在执行查询时似乎卡住了。
如果我向用于获取要素 GeoJSON 的查询字符串添加限制,则应用程序可以正常工作。所以我不认为这与 MapFish 插件有关,而是与 Doctrine 有关。
有人有一些启示吗? 谢谢!
I am developing a WebGIS application using Symfony with the MapFish plugin http://www.symfony-project.org/plugins/sfMapFishPlugin
I use the GeoJSON produced by MapFish to render layers through OpenLayers, in a vector layer of course.
When I show layers up to 3k features everything works fine. When I try with layers with 10k features or more the application crash. I don't know the threshold, because I either have layers with 2-3k features or with 10-13k features.
I think the problem is related with doctrine, because the last report in the log is something like:
Sep 02 13:22:40 symfony [info] {Doctrine_Connection_Statement} execute :
and then the query to fetch the geographical records.
I said I think the problem is the number of features. So I used the OpenLayers.Strategy.BBox() to decrease the number of feature to get and to show. The result is the same. The app seems stuck while executing the query.
If I add a limit to the query string used to get the features' GeoJSON the application works. So I don't think this is related to the MapFish plugin but with Doctrine.
Anyone has some enlightenment?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
即使理论上可行,尝试在地图上显示如此多的矢量特征也是一个坏主意。
您最好更改要素的显示方式(例如,低缩放级别的光栅,单击时获取要素......)。
即使您的服务在合理的时间内做出响应,您的浏览器也会被卡住,或者至少会出现非常糟糕的性能......
我是 sfMapFishPlugin 的作者,我从未尝试过查询如此多的功能,更没有尝试在 OL 地图上显示它们。
查看有关此主题的 OpenLayers 常见问题解答:http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#WhatisthemaximumnumberofCooperativesFeaturesIcandrawwithaVectorlayer,随着最近浏览器的改进有点过时,但地图上的 10k 个矢量特征并不是 合理。
哈特哈,
Even if theorically possible, it’s a bad idea to try to show so many vector features on a map.
You'd better change the way features are displayed (eg. raster for low zoom levels, get feature on click…).
Even if your service answer in a reasonable time, your browser will be stuck, or at least will have very bad performance…
I’m the author of sfMapFishPlugin and I never ever tried to query so many features, and even less tried to show them on a OL map.
Check out OpenLayers FAQ on this subject: http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#WhatisthemaximumnumberofCoordinatesFeaturesIcandrawwithaVectorlayer , a bit outdated with recent browsers improvements, but 10k vector features on a map is not reasonable.
HTH,