1.30. Custom coordinate systems

Note

Custom SRS functionality is available on Premium and while using the product On-premise.

Note

Only users with administrative privileges can add and modify SRS.

You can import Spacial Reference Systems from the catalog or create your own.

1.30.1. Add SRS from catalog

To import SRS from the catalog open “Control panel” in the main menu and press “Catalog” in “Spacial reference systems”. You will be redirected to the catalog page. Start typing the name of the SRS in the search bar. When you find the desired SRS in the search results, press the icon with the arrow next to it.

../../_images/new_srs_catalog_en.png

Pic. 1.122. Search results in the catalog

You will be redirected to the import page. Here you can modify the name of SRS to be displayed in your Web GIS.

../../_images/new_srs_import_en.png

Pic. 1.123. Adding SRS from catalog

../../_images/new_srs_import_save_en.png

Pic. 1.124. Completing import

On the next page, press Save to complete the import.

1.30.2. Create SRS using definition

To create a new SRS open “Control panel” in the main menu and press “Create” in “Spacial reference systems”:

../../_images/new_srs_eng_2.png

Pic. 1.125. Creation of a new SRS

You can give an SRS display name and enter its definition in OGC WKT format. You can also import definitions from common formats as PROJ, MapInfo and EPSG, after the import they will get converted to OGC WKT format. Then press “Create” .

1.30.3. Additional coordinate systems

To view the list of all added SRS, go to the “Control panel” and select “List” in the “Spacial reference systems” section. In this list there are two default SRS: «WGS 84 / Lon-lat (EPSG:4326)» and «WGS 84 / Pseudo-Mercator (EPSG:3857)», which can’t be removed or edited (apart from their names):

../../_images/list_srs_eng_2.png

Pic. 1.126. A list of SRS

The added SRS can be used for various purposes:

  1. To capture coordinates on Web maps. If you have set up additional SRS (one or several), you can now conveniently capture coordinates in this SRS by clicking anywhere on the map.

../../_images/use_of_custom_srs1_eng.png

Pic. 1.127. The use of custom SRS

  1. To export vector layers. All custom SRS are also available for data export.

  2. To extend API requests. Support for custom SRS is gradually added to NextGIS Web API too. For example, this request will return a feature in a required SRS:

/api/resource/{id}/feature/{fid}?srs=990002

To find the custom SRS identifier (990002 in this example) open the edit page for the created SRS, for example:

/srs/990002/edit

1.30.4. Custom SRS support for external PostGIS Databases

A common case for Web GIS users is adding an external PostGIS/PostgreSQL database while creating a PosGIS layer. These layers often get incorrectly displayed in the Web GIS. It happens when the spacial reference system has incorrect definition in the external database. To make the Web GIS-DB complex work efficiently, here’s what you need:

  1. External database must have a table of SRS descriptions spacial_ref_sys.

  2. In the geometry column (usually called “geom”) a SRS must be assigned.

  3. The ID of the assigned SRS must be included in spacial_ref_sys.

  4. Data in the external DB must actually be in that coordinate system, a.i. the SRS definition must correspond to the data.

If all the above requirements are met, then whatever SRS you use in your database, layers created in Web GIS will be reprojected “on the fly” and displayed correctly along any other data you have in your Web GIS.

To check if everything works correctly use PostGIS diagnostics.