将多边形从图像保存到PostGIS数据库 [英] save polygon from image to PostGIS database

查看:310
本文介绍了将多边形从图像保存到PostGIS数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一种用于从卫星图像中检测建筑物的软件.

I'm working on a software to detect buildings from satellite imagery.

到目前为止,我已经设法将建筑物与图像的其他对象分开. 我现在的问题是如何将多边形中的每座建筑物保存到PostGIS数据库中?

so far I have managed to separate the building with other objects of the image. My problem now is how to save every building in the shape of a polygon into a PostGIS database?

在Java和PostGIS中是否有可用的ata函数库?

Are there libraries available ata function in java and PostGIS?

推荐答案

使用python函数raster2pgsql将图像添加到postgis,

Add the image to postgis using the python function raster2pgsql, http://suite.opengeo.org/opengeo-docs/dataadmin/pgGettingStarted/raster2pgsql.html

然后,您可以根据一系列连续的像素值,使用ST_DumpAsPolygons将图像转换为矢量.参见 http://postgis.net/docs/RT_ST_DumpAsPolygons.html

Then, you can use ST_DumpAsPolygons to convert your image to vectors, based on a range of contiguous pixel values. See http://postgis.net/docs/RT_ST_DumpAsPolygons.html

通常的想法是,您可以通过一定范围的像素值来创建多边形,尽管在您的情况下看起来仅为255.

The general idea is that you create a polygon from a range of pixel values, though in your case that would appear to be just 255.

您实际上可以以这种方式直接在Postgis中进行建筑物检测,前提是建筑物具有足够独特的值.

You could actually do the building detection directly in Postgis in this fashion, assuming that the buildings take on sufficiently unique values.

什么是蓝色,作为关注点?

What is the blue, as a matter of interest?.

这篇关于将多边形从图像保存到PostGIS数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆