3. Loading Geospatial Data : Load Data with GDAL/OGR Tools
 
Share this page                  
Load Data with GDAL/OGR Tools
In this example, we load into an Ingres database the on_geoname dataset from the Canadian GeoBase project. This dataset contains geographic names and point locations in Ontario. It is downloaded as a 3 MB zip file from the Canadian GeoBase project (http://geobase.ca).
To load data with GDAL/OGR tools
1. Create a database that will hold the data.
For example, this command creates a database named canada:
createdb canada
2. Convert and load the data into the database.
Use a command with a format like the following:
ogr2ogr -f [format] -a_srs [srs_info] [destination database] [source_shapefile]
where:
-a_srs [srs info]
Assigns an output Spatial Reference System (SRS). Some ways of specifying the SRS are:
EPSG number
For example:
"epsg:4326"
SRS web lookup
For example:
http://spatialreference.org/ref/epsg/4326/