[postgis-users] Need help to load data in PostGIS

Brent Wood pcreso at pcreso.com
Wed Feb 14 19:03:10 PST 2007


--- Khalid <kmsaif at gmail.com> wrote:

> Hi,
> 
> I am a student and is working on a project which will use MapServer
> and PostGIS. I have data in vector format as ESRI compatible shapefiles. My
> task is to load data into PostGIS as raster and then to perform overlay
> analysis and display map  in web browser through mapserver (on windows
> platform).

PostGIS does not store raster data, only vector data. Mapserver can display
vector data from both shapefiles and PostGIS tables. Shapefiles are generally a
bit faster, although you can do more in the way of data querying/management
with PostGIS. 

So to display the vector data with mapserver, you do not need to load them into
PostGIS.

Note, my experience is that on the same hardware, Linux is 10-15x faster than
Windows as a mapserver/postgis box.


> I am newbie to PostGIS and is trying to load data into PostGIS. I am
> wondering if anybody can give me idea/guideline about
> 
> a) how should I load data into PostGIS

You can use the program shp2pgsql.exe which comes with PostGIS. This will
create a file containing all the SQL statements to load the data into a PostGIS
table.

Once you have a PostGIS database set up, you can run the file to create the
table & load the the data into it, typically:
 psql <database name> -f <shp2pgsql file>

> b) how vector to raster transformation will happen

It won't. To generate raster data from vector data you'll need to use a package
like R, GMT or GRASS. The process generally involves interpolating a grid from
the vector data (usually points). This is non-trivial & can be as much an art
as a science, depending on just what sort of interpolated model you want from
the data.

> c) how I will perform overlay analysis using raster data.

Use R, GRASS or GMT. PostGIS is simply a database add-on to support vector
spatial datatypes, with functions to query, manipulate & analyse them.



Cheers,

  Brent Wood



More information about the postgis-users mailing list