I have a PostgreSQL/PostGIS database with a two string fields containing Lat and Long coordinates in degrees and decimal minutes, like this 45° 24.5' N
3° 43.01' E
.
How can I convert them into decimal degrees, for use in ST_GeographyFromText
?
postgispostgresqlsql
I have a PostgreSQL/PostGIS database with a two string fields containing Lat and Long coordinates in degrees and decimal minutes, like this 45° 24.5' N
3° 43.01' E
.
How can I convert them into decimal degrees, for use in ST_GeographyFromText
?
Best Answer
You may try this:
DMS2DD for PostGIS
EDIT
Presuming this is your PostGIS table,
running the DMS2DD function gives this:
EDIT 2
Because you have only
Degrees and Minutes
,in the DMS2DD function you need to comment one single line to achieve your results: