save polygon from image to PostGIS database

余生长醉 提交于 2019-12-10 11:43:59

问题


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

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?

Are there libraries available ata function in java and PostGIS?


回答1:


Add the image to postgis using the python function raster2pgsql, http://suite.opengeo.org/opengeo-docs/dataadmin/pgGettingStarted/raster2pgsql.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

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.

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?.



来源:https://stackoverflow.com/questions/22642860/save-polygon-from-image-to-postgis-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!