I am new in PostGIS and I am trying to convert a geometry field to GeoJSON Lat/Lng for visualization in a map as a layer.
I had a .HSP file that I exported to PostGIS with OpenJump program.
The .prj of .shp is:
PROJCS["ETRS_1989_UTM_Zone_30N",GEOGCS["GCS_ETRS_1989",DATUM["D_ETRS_1989",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-3.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
For get the SRID I searched in: https://developers.arcgis.com/javascript/3/jshelp/gcs.html and I got the 4258 code.
But when I execute:
ST_AsGeoJSON(ST_Transform(ST_SetSRID(geo,4258),4326))
I get:
"{"type":"Polygon","coordinates":[[[526196.6063,4744503.4952],[526155.287,4744194.9938],[526067.3464,4744213.9994],[526088.0997,4744354.9984],[526109.542,4744513.4959],[526196.6063,4744503.4952]]]}"...
Which is not a Lat/Lng correct value.
What could be wrong?