dashish
asked on
How to configure POSTGIS?
I want to use POSTGIS database to use the GEOMETRY data type column.
I installed PostGre database, Installed PostGis database.
I want to know how to configure PostGis database, help is provided but I did not understand from it.
Thanks in advance.
Thanks,
dAshish
I installed PostGre database, Installed PostGis database.
I want to know how to configure PostGis database, help is provided but I did not understand from it.
Thanks in advance.
Thanks,
dAshish
ASKER
I run this table script on PostGre window it gives me following error.
ERROR: type "geometry" does not exist
LINE 4: geom_col geometry,
Thanks
dAshish
ERROR: type "geometry" does not exist
LINE 4: geom_col geometry,
Thanks
dAshish
Ok, so that means that the database you are trying to create the table in is not spatially enabled.
Make sure the database is either created from the postgis template, or alternatively you could run the following scripts to generate all necessary functions and types:
<PGHOME>\share\contrib\lwp ostgis.sql
<PGHOME>\share\contrib\spa tial_ref_s ys.sql
If the database is spatially enabled, you should see spatial_ref_sys and geometry_columns tables in your public schema. You should also have a few hundred functions having to do with geometries.
Make sure the database is either created from the postgis template, or alternatively you could run the following scripts to generate all necessary functions and types:
<PGHOME>\share\contrib\lwp
<PGHOME>\share\contrib\spa
If the database is spatially enabled, you should see spatial_ref_sys and geometry_columns tables in your public schema. You should also have a few hundred functions having to do with geometries.
ASKER
I have installed PostGre on linux machine, and working on the same machine
Now could you please advice me how to make the database spatiall enabled.
I tried to run this
<PGHOME>\share\contrib\lwp ostgis.sql
<PGHOME>\share\contrib\spa tial_ref_s ys.sql
It gives me error "Could not save history to file "hare": Permission denied"
Thanks,
dAshish
Now could you please advice me how to make the database spatiall enabled.
I tried to run this
<PGHOME>\share\contrib\lwp
<PGHOME>\share\contrib\spa
It gives me error "Could not save history to file "hare": Permission denied"
Thanks,
dAshish
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Postgis installation provides you a set of functions and types you can use to store spatial data. There is no configuration necessary. All you need to do is use the functions and types to process and store your data.
So once you have a spatially enabled database (aka database that contains all the objects added by postgis), which you can create by using postgis template database, you can create tables as shown below.
As you can see I have a geometry column (geom_col) and several check constraints that ensure correct geometry is stored. These check constraints use some of the postgis functions (ndims, geometrytype, srid).
Open in new window