Wednesday 31 October 2012

PostGis

PostGis

  PostGIS is spatial database extension for PostgreSQL.PostGIS adds support for geographic objects to the PostgreSQL object-relational database. In effect, PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend spatial database for geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS follows the OpenGIS "Simple Features Specification for SQL" and has been certified as compliant with the "Types and Functions" profile.


*****Installation of postgis on a windows machine ******

1. go to the following website http://postgis.refractions.net/download/windows/
 and download the installer according to 32 bit /64 bit operating systems.

                                       

2 install postgis by using postgis installer .

3. we can get more information about how to us postgis by reading the manual given at the http://postgis.refractions.net/documentation/


4.we need to be very careful about the comaptibility of the version of postgis and postgresql ,
example  we need to install the version of post gis 2.0.1 comaptible with postgresql 9.2 .
as most of tend to get such kind of errors while loading the shapefiles..the error is shown below.

Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown,
unknown, unknown, unknown, unknown, integer) does not exist
>
>LINE 9: SELECT AddGeometryColumn('public','postgrestest','the_geom',...

>HINT:  No function matches the given name and argument types. You might
>need to add explicit type casts.


PostGresql

Installation of Postgresql

 Installation of Postgresql on windows operating systems :  go to the following link  http://www.postgresql.org/download/windows/   and click on  the Donwload tab  as shown below




 select the version according to the operating system and download the archive file .

2. extract the .exe file from the archive and then install the postgresql software.
3. I t would ask for username and password , its better to give username as postgres and the password as postgres.
4. it would prompt for port no , by default it would come up as 5432 , you can accept this.
5.click on next and it would install automatically.
6.once you open up the console it would look something like this















7.You find your „!PostgresSQL Database Server 9.x“ in the upper left corner of the window. Right click on the „!PostgresSQL Database Server x.x“ and choose „Connect“ in the pop up menu. Type in the name and password of the superuser you have chosen in the installation steps, that would be as mentioned in step no 3 username = postgres  and password = postgres . Now the red cross over the icon of the server disappears and you are connected to the server.