1个背景
As the wireless communication technology is developing faster and faster, the Long Term Evolution networks are widely installed all over the word. Since the Long Term Evolution network is based on wide-band radio access technology, there is only one radio carrier available for most of the operator. Since the frequency resource is limited, many telecom operators use same frequency TD-LTE networks. In the same frequency TD-LTE networks, overlapping coverage seriously impact download speed. RF optimization is a conventional method of controlling overlapping coverage. However, the network optimization resources are always limited, we must evaluate the wireless network coverage and quality as a whole, and identify the problems in priority.
Drive test data is widely used to evaluate the wireless network coverage and quality. And we will future associate the Drive test data with the map. Traditionally, we use a desktop software MapInfo to analysis the Drive test data point with the street and road, which is a very heavy labor task. Recently, we find a new approach the PostGIS middleware, we could transfer the city maps into Raster data, we can we could future associate the Drive test data point with the city map raster data , just like we associate the Drive test data point with the polygon object.在本文中,我们将描述如何将地图点与Raster联系起来。我的问题是,在光栅对象中有超过10000*10000像素的情况下,如果函数st_worldtorastercoordx(rast,geom),我们如何提高速度。此问题与中间件PostGIS Raster对象相关联.
2 Creat驱动器-测试数据点对象
2.1创建点对象字段
在以前的对象中,我们使用水壶中间件将驱动器测试数据文件加载到Postgres数据库中。在数据库中,目标表是atu_sample,现在我们将更新表以添加几何对象“point”。下面是命令:
alter atu_sample添加列几何(点,4326)
2.2向点分配价值
在驱动器测试数据文件中,我们有表示空间位置的经度和纬度,现在我们将它们转换为一个几何对象“点”,下面是命令:
更新atu_sample set geom =st_geomfromtext(‘POINT(’\\x_
3 Creat Raster数据
为了将point与Raster数据关联起来,我们必须首先设置一个Raster数据。在本文中,我们将把作为矢量数据的城市地图转换为栅格数据。
3.1武汉市进口边界多边形
3.1.1在本项目中,我们将武汉市边界多边形导入到PostGIS数据库中,武汉市是湖北省省会中国。它依赖于MAPinfo格式传输函数,图形用户界面条目可以在下图中看到:从图片中可以看到,目标文件的格式是ESRI文件,这是PostGIS可以支持的默认格式。
3.1.2创建PG脚本,然后将位于ESRI形状文件中的武汉城市地图转换为PostGIS脚本。它依赖于工具shp2pgsql,它是PostGIS的插件组件。下面是命令:
shp2pgsql -W“GBK”-s 4326 wh_region.shp > 123.txt这里的-s 4326表示坐标系参数,在未来的空间对象中有一定的应用价值。
3.1.3脚本执行现在,我们将打开PGADMIN,并将脚本传输到PostGIS数据库中,最终得到一个名为武汉的talbe。执行脚本时,postGIS中有空间数据表。
3.2测量武汉边界的高度和宽度
3.2.1绘制武汉市ConvexHull 在这里输入图像描述图2-4:在图2-4中绘制武汉市的ConvexHull,绘制武汉市的ConvexHull,它将围绕武汉市的边界。
3.2.2用标尺使用标尺工具测量高度和宽度
In the Mapinfo, we have a tool with the name Ruler, which can be used to measure the height and width of the ConvexHull of Wuhan city. [enter image description here](http://i.stack.imgur.com/MYh4d.png) Figure 2-5 to measure height and width Finally we get the data:132.7KM and 155.5KM.3.3在我们的项目中创建武汉栅格数据,我们将创建100*100米的像素。因此,我们将首先计算出武汉市ConvexHull的高度和宽度的参数。根据我们以前测量的数据,高度132.7KM,宽度155.5KM,因此可以计算出等分参数为1327和1555。
3.3.1创建Raster持久化表现在我们将创建一个可以存储Raster数据的表。下面是SQL命令:创建表子类( rid integer NULL,rast光栅,约束myrasters_pkey主键(rid) );
3.3.2在前面的步骤中插入栅格记录,我们有了表格wh_region和qually参数的风水对象,我们可以用函数ST_AsRaster创建光栅实例。下面是命令: insert从wh_region选择gid,ST_AsRaster( geom ,1327,1555,‘8 8BUI’);
4关联点到Raster 4.1添加驱动测试点光栅坐标数据场,找出点与光栅的关系,即要找出某个点位于哪个像素中。为了记录这种关系,我们首先在表atu_sample中添加两个数据字段x整数和y整数。下面是命令: alter atu_sample添加列x integer;alter atu_sample添加Y列整数;
4.2栅格绘图
利用函数st_worldtorastercoordx(rast,geom)和st_worldtorastercoordy(rast,geom),可以方便地找出某个点位于哪个像素中,得到像素坐标数据。然后我们将更新tabe,下面是命令:
更新atu_sample set x =st_worldtorastercoordx(rast,geom);
更新atu_sample set y =st_worldtorastercoordy(rast,geom);
Geom:
在上面的例子中,我们有12000个点和一个1327* 1555光栅数据。完成这项任务需要160多秒。在未来的项目中,我们将有超过1200000点,我们如何解决性能问题?
发布于 2016-03-23 12:47:16
有关3.3,请参阅这篇文章。你不需要测量你的面积来把它转换成栅格。确保你用很小的瓷砖制作一个平铺的光栅覆盖。
对于4:你不需要计算你的点到栅格中的位置。从您的坐标表中用ST_MakePoint()创建点,并确保它们位于适当的坐标系中。然后创建一个新表,将点投影到与带有ST_Transform()的光栅表相同的坐标系中,并对该表进行索引。然后使用如下查询查询像素值:
SELECT ST_Value(rast, geom) val
FROM rastertable, geomtable
WHERE ST_Intersects(rast, geom)https://stackoverflow.com/questions/36053974
复制相似问题