Stay Connected with the Boundless Blog

Open Source Prj2EPSG By OpenGeo And SkyGone With Same GEOTools

Once upon a time, a group of smart people got together to define a common standards base for geographic map services, a “Web Map Service” specification, if you will.

They wanted their map services to be interoperable, but different maps can be rendered using different projections, and in order to overlay one map onto another, they needed to know (and advertise) the projections of both.

There was an existing standard for representing map projections, called “well-known text” (which is also, confusingly, the name that describes a standard for representing geometries) but it was quite verbose. Who, after all, could remember this:

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.01745329251994328,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]

More importantly, how would this fit cleanly into a URL?

Fortunately, there already existed a large database of commonly used map projections: the EPSG database. This provided a single numeric ID for each common map projection. So it was decided that all map services must advertise their projection using a unique number defined by an authority, and set EPSG as the first authority. And so ESPG:4326 came into the world (WGS84 geographic coordinates) along with ESPG:26910 (NAD83 UTM Zone 10 North), and many others.

But, unlike me, most GIS practitioners haven’t memorized the EPSG database. So they frequently ask questions like “what is the EPSG number for Oregon State-Plane South?” and “how do I find the EPSG number for this shapefile?” One could search spatialreference.org, a site for understanding spatial reference systems. My own answer used to be a fairly unhelpful set of directions for doing a text search of the PostGIS SPATIAL_REF_SYS table:

SELECT srid, srtext FROM spatial_ref_sys WHERE srtext ILIKE '%oregon%';

But today, I can provide a much simpler answer: Use prj2epsg.org. With prj2epsg.org, you can paste in full well-known text descriptions, you can type in shorter keyword searches, and you can even read a .prj file directly.

This free public service is provided by OpenGeo and our cloud services provider SkyGone. The code is naturally all open source and the service is built on top of the same GeoTools library that is at the heart of our OpenGeo Suite.

And now we’re all hopefully one step closer to living happily ever after.