检查给定 dpi 和打印尺寸的矢量对象在打印时是否可见
我有文件(GIS 中使用的 *.shp),其中包含多边形的集合,也许还有其他矢量对象(但多边形对我来说最重要)。我需要删除不可打印的对象。
不知道选择的标准是什么。我认为删除边框长度较小的对象会比删除面积较小的对象更好(这样长的对象会减少为线)。但也许有特殊的算法呢?
换句话说,我只想查找在给定缩放级别下可见的对象。
I have file (*.shp used in GIS) that contains collection of polygons and maybe other vector objects (but polygons are most important for me). I need to remove non printable objects it.
I don't know what criteria chose. I think removing objects with small border length would be better then removing objects with small area (so long objects will reduce to line). But maybe there is special algorithm for that?
In other words I want to find only that objects that are visible at given zoom level.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
那很简单。由于您没有提及任何语言,请考虑以下伪代码,
Contains() 函数看起来像这样,假设 y 值从下到上增加:
Thats quite simple. As you dont mention any language consider the following pseudocode
the Contains() function would look something like that, assuming that y-values increase from bottom to top:
要消除的多边形取决于您要创建的图像的 dpi。如果一条线仅填充一个像素,则应将其消除或替换为点表示。当然,这会受到线宽的影响。许多此类问题可以通过使用专用的地图库来解决,例如 mapnik.org
The polygons to eliminate would depend on the dpi of the image you wish to create. If a line is only going to fill one pixel it should be eliminated or replaced with a point representation. Of course this will be effected by the width of the line. A lot of these sort of problems would be solved by using a dedicated mapping library such as mapnik.org