Skip to content

Instantly share code, notes, and snippets.

@pramsey pramsey/3005.txt
Last active Feb 22, 2019

Embed
What would you like to do?
-- Resolving 3005 via Proj4
postgis=# select st_astext(st_transform('SRID=4326;POINT(-125 45)',3005));
st_astext
------------------------------------------
POINT(1079515.82040926 561.626612238131)
(1 row)
-- Also resolving 3005 via Proj4!!!!
postgis=# select st_astext(st_transform('SRID=4326;POINT(-125 45)','EPSG:3005'));
st_astext
------------------------------------------
POINT(1079516.99896456 561.070351860499)
(1 row)
postgis=# select st_astext(st_transform('POINT(-125 45)','EPSG:4326', 'EPSG:3005'));
st_astext
------------------------------------------
POINT(1079515.82040926 561.626612238131)
(1 row)
-- EPSG.IO proj4 definition
postgis=# select st_astext(st_transform('SRID=4326;POINT(-125 45)','+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '));
st_astext
------------------------------------------
POINT(1079515.82040926 561.626612238131)
(1 row)
-- spatial_ref_sys definition (not used in current resolution system at all, EPSG code comes first)
postgis=# select st_astext(st_transform('SRID=4326;POINT(-125 45)','+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m'));
st_astext
------------------------------------------
POINT(1079516.99896456 561.070351860499)
(1 row)
postgis=# select proj4text from spatial_ref_sys where srid = 3005;
proj4text
-----------------------------------------------------------------------------------------------------------
+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m +no_defs
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.