[GIS] Getting a Bounding Box in Latitude / Longitude using PostGIS shp2pgsql

coordinate systemextentspostgis

Using the PostGIS shp2pgsql -s 4326 … I generated the sql file and created my spatially enabled table.

When executing my query:

select box2d(ST_extent(the_geom)) from feature_data;

I'm returned with:

BOX(490755.1875 5460528,504640.4375 5466997)

My result appears to be in Easting and Northing, but I would like to return the bounding box in latitude / longitude. I have limited experience with GIS. How can I convert this result to the latitude / longitude coordinate system?

Best Answer

Looks like your shapefile uses the following projection: http://spatialreference.org/ref/sr-org/6855/

At least this looks like the content of the .prj file you posted: http://spatialreference.org/ref/sr-org/6855/html/

To add this reference system to PostGIS, you can run: http://spatialreference.org/ref/sr-org/6855/postgis/

The correct query then would be:

SELECT box2d(ST_Transform(ST_SetSRID(the_geom,96855),4326)) FROM feature_data;
Related Question