Re: How can I add a custom EPSG to the Map (Geometry) Viewer in PGAdmin4,

Поиск
Список
Период
Сортировка
От Avin Kavish
Тема Re: How can I add a custom EPSG to the Map (Geometry) Viewer in PGAdmin4,
Дата
Msg-id CAFpscORS+K0_oDw1cG5irG6j6e-eQzPxOkEvm+WWwEat1eWBvg@mail.gmail.com
обсуждение исходный текст
Ответ на How can I add a custom EPSG to the Map (Geometry) Viewer in PGAdmin4,  ("Basques, Bob (CI-StPaul)" <bob.basques@ci.stpaul.mn.us>)
Ответы Re: How can I add a custom EPSG to the Map (Geometry) Viewer in PGAdmin4,  (Calle Hedberg <calle.hedberg@gmail.com>)
Список pgadmin-support
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.



On Wed, Jul 31, 2019 at 7:54 PM Basques, Bob (CI-StPaul) <bob.basques@ci.stpaul.mn.us> wrote:
All,

Following the appreciation thread and saw the reference to the geometry viewer, I didn’t even know that was in there.  Anyway, nice, but we have a custom EPSG, where do I add this into PGAdmin4?

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?

Thanks

bobb



В списке pgadmin-support по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: How can I add a custom EPSG to the Map (Geometry) Viewer in PGAdmin4,
Следующее
От: Richard Greenwood
Дата:
Сообщение: no results in 4.11 Ubuntu