Hey bobb,
but we have a custom EPSG, where do I add this into PGAdmin4
EPSGs are stored in a table called spatial_ref_sys. All you need to do is insert a record that contains the definition in well known text format and proj4 format (for transformation). I'd recommend checking the table first because there over 5000 EPSGs in it.
epsg.io shoud give you an idea of what the insert statement should look like. Example
INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 4326, 'EPSG', 4326, '+proj=longlat +datum=WGS84 +no_defs ', 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]')
Also, it would be nice to add in our own background mapping layers as well, is there a method for adding in WMS/WFS to the layer list?
Till support for custom layers land, once you have added your custom EPSG to the database you can transform the geometries to SRID 4326 and assuming they are on Earth, they will show up on the map. The following functions will be helpful
st_srid - Check the SRID of a shape
st_setsrid - Change an SRID without transforming coordinates
st_transform - Transforms a geometry from one EPSG to another
So when you are selecting data from a different EPSG, use: select st_transform(geometry, 4326) from table_name and it will enable the world map. AFAIK no other EPSG is supported for viewing on the map without transformation. I discovered it by sheer accident.