I imported a shapefile ("Test.shp") using DB Manager and ran the following query to extract distances between the outer rings of polygons:
SELECT a.gid from_gid, b.gid to_gid, st_shortestline(a.the_geom,b.the_geom), st_distance(a.the_geom,b.the_geom) AS distanceFROMpublic."Test" AS a,(SELECT* FROM public."Test") AS bWHERE st_dwithin(a.the_geom,b.the_geom,100)I obtain the results but I would like to have the distance column, along with its values, to be inserted back into the attribute table of the shapefile. How could I do this?
Although I'm getting started in using PostGIS, I'm sure this kind of question has been asked before so I will delete this post if it is a duplicate.
أكثر...
SELECT a.gid from_gid, b.gid to_gid, st_shortestline(a.the_geom,b.the_geom), st_distance(a.the_geom,b.the_geom) AS distanceFROMpublic."Test" AS a,(SELECT* FROM public."Test") AS bWHERE st_dwithin(a.the_geom,b.the_geom,100)I obtain the results but I would like to have the distance column, along with its values, to be inserted back into the attribute table of the shapefile. How could I do this?
Although I'm getting started in using PostGIS, I'm sure this kind of question has been asked before so I will delete this post if it is a duplicate.
أكثر...