geo-io/crs

Coordinate Reference System (CRS) utilities.

Maintainers

👁 jsor

Package info

github.com/geo-io/crs

pkg:composer/geo-io/crs

Statistics

Installs: 25 292

Dependents: 1

Suggesters: 0

Stars: 2

Open Issues: 0

v2.0.0 2021-09-10 13:49 UTC

Requires

  • php: ^8.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 66f6f63874a404c297b8260adb139ce01789f447

  • Jan Sorgalla <jsorgalla.woop@gmail.com>

geoiospatialcrssrssrid

This package is auto-updated.

Last update: 2026-06-20 18:52:21 UTC


README

👁 Build Status
👁 Coverage Status

Coordinate Reference System (CRS) utilities.

Installation

Install through composer. Check the packagist page for all available versions.

composer require geo-io/crs

Usage

def_to_srid

Converts a CRS definition to a Spatial Reference System Identifier (SRID).

echo GeoIO\CRS\def_to_srid('urn:ogc:def:crs:OGC:1.3:CRS84')."\n";
echo GeoIO\CRS\def_to_srid('http://spatialreference.org/ref/epsg/4322')."\n";

The above example will produce the following output.

4326
4322

If the definition can't be converted to a SRID, it throws a GeoIO\CRS\Exception\UnknownDefinitionException.

srid_to_urn

Converts a Spatial Reference System Identifier (SRID) to an URN.

echo GeoIO\CRS\srid_to_urn(4326)."\n";
echo GeoIO\CRS\srid_to_urn(4322)."\n";

The above example will produce the following output.

urn:ogc:def:crs:OGC:1.3:CRS84
urn:ogc:def:crs:EPSG::4322

License

Copyright (c) 2016-2022 Jan Sorgalla. Released under the MIT License.