7

I want to map the geographic extents / bounding boxes of a lot of EPSG CRSes. At least, those with a rectangular geographic extent.

For example, take epsg:2004, visiting that page shows the extent (both projected and geographic).

enter image description here

There are several sites with this info, which make it trivial to find the extent for a single CRS at a time

Is there an easy way to extract this information off-line using QGIS, proj4 or other FOSS tools? Preferably without needing to parse the WKT/proj4 strings (which are easy enough to find, they're sitting in any postgis-enabled database)

Online queries (to an API or web service) would be good too.

Other things I've looked at:-

  • I don't see anything in the QgsCoordinateReferenceSystem class for this, so I assume that qgis doesn't do any bounds checking and throws all the points at proj4, which will complain (with a "forward projection failure") if any points fall outside the valid bounds.

  • Also, pyproj (the python wrapper for proj4) doesn't seem to be able to extract this info, it's really just for transforming between CRSes.

EDIT

Following BradHard's suggestion, I registered on epsg.org and built the postgres database using the scripts provided.

Then it was simple matter to join the CRS to the area...

SELECT 
  epsg_area.area_name, 
  epsg_area.area_of_use, 
  epsg_area.area_south_bound_lat, 
  epsg_area.area_north_bound_lat, 
  epsg_area.area_west_bound_lon, 
  epsg_area.area_east_bound_lon, 
  epsg_area.area_polygon_file_ref, 
  epsg_coordinatereferencesystem.coord_ref_sys_code, 
  epsg_coordinatereferencesystem.coord_ref_sys_name
FROM 
  public.epsg_area, 
  public.epsg_coordinatereferencesystem
WHERE 
  epsg_coordinatereferencesystem.area_of_use_code = epsg_area.area_code
  and epsg_coordinatereferencesystem.coord_ref_sys_code = 27700;

4 Answers 4

8

You can download the EPSG data from http://www.epsg.org/DownloadDataset after you register. No cost to register, and no delay between registration and download.

There are two formats that might be useful - a set of PostgreSQL scripts (also other databases, but PostgreSQL is the one I checked) that insert data, so you can do a query of the epsg_area table. The data going in looks like:

INSERT INTO epsg_area VALUES ( 1027, 
'American Samoa', 
'American Samoa - onshore and offshore.', 
-17.56, 
-10.02, 
-173.75, 
-165.2, 
'urn:ogc:def:extent-polygon:EPSG::1027', 
'AS', 
'ASM', 
16, 
'', 
'ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso', 
'OGP', 
'2011-07-27', 
'2002.341 2005.890 2011.068', 
0 );

So you can see what you'd be able to get out.

There is also a set of Area polygons in shapefile format (i.e. they're all in one shapefile). That might not be so useful if you want to do some finer grained filtering (because of the relative ease of SQL), but if you're just planning to drop them into a GIS application anyway, it might be an easier option.

1
  • thank you! I built out the postgres database and it looks like it'll do what I was after. I've confirmed by querying a few familiar CRSes, joining them to areas, and extracting the extent fields. After testing with several CRSes it gives the same results as epsg.io, so I suspect that's how they do it.
    – Steven Kay
    Commented Aug 22, 2015 at 15:45
4

Download the MS Access database and/or the polygon shapefiles from the EPSG Geodetic Dataset Registry (upper right, "export registry"). You do have to register, but we don't spam or sell the list of registered users.

The MS Access database contains the rectangular extent areas of use only.

Or you can download the files from the OGP website, same login requirement.

Disclosure: I'm on the subcommittee that maintains the registry.

1
  • thank you - have tried both sites. Found problems opening the gml files in QGIS, but that's for another question. I'll have a look at the access db next time I'm at a Windows machine (support for Access can be patchy on Ubuntu)
    – Steven Kay
    Commented Aug 22, 2015 at 15:56
2

You can pull this out of the DBs that ship with GeoTools as well. There is a method on CRS for it whose name escapes me but should be obvious.

0

I want to comment on the recommendation to use the EPSG dataset and use the epsg_area table to look up the bounds of the area of use. I used to do the same in version v9 of the EPSG dataset. My desire was to find out where a certain map projcetion (identified by epsg_coordinatereferencesystem:coord_ref_sys_code) should be applied or where a particular transformation to WGS84 (identified by epsg_coordoperation:coord_op_code) could/should be used.

In version v10 of the EPSG dataset this no longer works. They moved the bounds to the table epsg_extent (which is fine), and collected references to the right rows in epsg_usage (which is also fine). BUT, the rows "area_of_use_code" in both, epsg_coodinatereferencesystem and epsg_coordoperation are empty as far as I can tell - and unless I misunderstand the whole concept, this is where things are broken for me. I am building tools that use no other input than the EPSG dataset, but for what I want to do, it appears the database does not contain the right information anymore.

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Oct 6, 2022 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.