[MAPSERVER-USERS] mapserver connection database
Rahkonen Jukka
Jukka.Rahkonen at mmmtike.fi
Mon Mar 31 23:07:40 PDT 2008
mapserver-users-bounces at lists.osgeo.org puolesta: nickthegreek-
> hello to everyone ... what i wanna is a help and tell me what exactly to do
...
> what i wanna is to put all these files in a database and to connect to the
> database and as a result to be shown
> first.., what database to use, the easiest
Use PostGIS.
> second, how i can add these files... shp,shx.dbf ..how i can create these
> tables with the fields ,cause the shp and shx files cannot see what they
> have inside..
PostGIS comes with a tool called shp2pgsql. Ogr2ogr is another possibility.
Both can upload shapefiles into PostGIS and there is no need to care about
the individual files in a shapefile package. They are general purpose tools
and they may not automatically do exactly what you need for your application.
I fear you need to read some documentation.
> i wanna a big help, cause i can't understand how to indert all these files
> in a database and then to be shown... many thanks to everyone
> from a try i did.. i insert in the postgresql the file country.shp..
> then i try to connect to it from the mapfile and in this layer i write
Looks like you know the tools already?
.....................
> CONNECTIONTYPE postgis
> CONNECTION "host=localhost dbname=postgis user=postgres
> password=d3klw7 port=5432"
> STATUS ON
> DATA "the_geom FROM province"
....................
> the result i take is
> 'ERROR: column "oid" does not exist LINE 1:
Error probably means what it says. For Mapserver there must be an unique colunm in the database. If you don't tell what is the name of the unique column then OID is the default. Now it is obviously lacking. If you have some other column that is unique you can use it by addind "using unique". Otherwise you need to create one.
> can u understand wht is the problem??pls ..it is my diploma and i have to do
> it until the end of the week
Problem? Perhaps that you have quite a little time to do both the learning and writing.
-Jukka-
More information about the MapServer-users
mailing list