3. Loading Geospatial Data : Load Data with GDAL/OGR Tools : • OGC WKT
 
Share this page                  
OGC WKT
For example:
'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"]]'
Details of spatial reference systems, including the OGC WKT syntax shown previously, can be found at http://spatialreference.org/.
For example, the following command converts the data and creates a table in the canada database with the same name as the input dataset (on_geoname):
ogr2ogr -f ingres -a_srs http://spatialreference.org/ref/epsg/4326/ @driver=ingres,dbname=canada on_geoname.shp
Other ogr2ogr Command Options
Other ogr2ogr command options applicable to loading data are as follows. For complete options, see http://gdal.org/ogr2ogr.html.
-select [fieldname],[fieldname]...
Lets you provide a comma separated list of field names that you want to load. All other fields are ignored and will not appear in the resulting table. This option is useful if you have an extreme number of fields in your input data.
Depending on the default page size setting (in config.dat) used for your Ingres instance, you may get notices while running ogr2ogr. In such a case, you can specify only the most important fields instead:
ogr2ogr -select roadclass,nbrlanes,pavstatus ...
-skipfailures
Continues to load after encountering a record that gives a failure. Default behavior is to stop processing entirely, which means you have to start again from the beginning after you have fixed the problem. If you do not want to use the -select option workaround, then try ‑skipfailures.
-overwrite
Gives permission to drop and recreate the table during data loading. If your process stopped due to errors and you want to try loading again, this is the easiest way to force it to clean up from the past process and start fresh.