Geography Reference
In-Depth Information
$ ogrinfo "PG:dbname=gis_data host=madison"
INFO: Open of `PG:dbname=gis_data host=madison'
using driver `PostgreSQL' successful.
1: edit_test (Point)
2: country (Multi Polygon)
3: air_intl_buffer_500k12 (Polygon)
4: bug_test (Polygon)
5: air_intl_buffer_500k14 (Polygon)
6: 64districts (Multi Polygon)
7: 94election (Multi Polygon)
8: admin_nps (Multi Polygon)
9: admin_nra (Multi Polygon)
10: admin_nwr (Multi Polygon)
...
An important part of using ogrinfo with PostGIS is the connection string,
specified with “PG:” and followed by the appropriate parameters. In
our case, we needed only to specify the database name and the host.
Depending on how your database authentication is set up, you may
need to include “user=” and “password=” (with the appropriate values)
in your connection string.
This database contains more than 100 layers, so we truncated the
listing—but you get the idea. We didn't have to connect to the database,
log in, and issue some SQL to determine what layers were available. We
didn't even have to be on the same host as the database in order to
get the information—of course this assumes you have a properly set
up database with appropriate permissions. Let's get the details for the
country layer, remembering to use the -so switch so we don't dump the
whole world to our command shell:
$ ogrinfo -so -al "PG:dbname=gis_data host=madison" country
INFO: Open of `PG:dbname=gis_data host=madison'
using driver `PostgreSQL' successful.
Layer name: country
Geometry: Multi Polygon
Feature Count: 251
Extent: (-180.000000, -90.000000) - (180.000000, 83.623596)
Layer SRS WKT:
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"]]
 
 
Search WWH ::




Custom Search