问题
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