[Mapserver-users] Mapserver + PostGIS for dummies.
Jason M. Nielsen
jnielsen at aero-graphics.com
Thu Jan 15 12:31:03 PST 2004
Quoting Tyler Mitchell <TMitchell at lignum.com>:
>
>
>
>
>
> > Is there any holding your hand walk throughs on implementing a Mapserver
> +
> > PostGIS system? Looking for something where we can dump SHP files
> > into the db as
> > well as rasters then view them.
>
> Hi Jason, glad to hear you're taking the next step.
> It would be helpful for us if you could post a couple more bits of info:
> - contents of your map file
> - describe structure of the postgis table in question (ie in psql: >\d
> <tablename> )
> - complete listing of your geometry_columns table
>
> That should help us track with your problem a bit more.
>
> Tyler
>
> p.s. "Mapserver + PostGIS for dummies" is a bit of an oxymoron ;)
>
This is fairly chopped up version of the demo.map. I figured if I start with a
working setup Id have better luck moving to PostGIS as the backend.
---------------------
MAP
IMAGETYPE PNG
UNITS feet
EXTENT 1788886.749859 472006.998403 2135529.501670 833751.562963
SIZE 600 600
PROJECTION
"proj=latlong"
END #end projection
LAYER
CONNECTIONTYPE postgis
NAME "Utah Geological Study"
CONNECTION "user=gis_user dbname=pg00 host=localhost"
DATA "the_geom from s81"
STATUS default
TYPE POLYGON
LABELITEM "name"
CLASS
COLOR 255 255 255
OUTLINECOLOR 255 0 0
LABEL
FORCE TRUE
POSITION CC
SIZE tiny
OUTLINECOLOR 255 255 255
BACKGROUNDCOLOR 255 255 204
BACKGROUNDSHADOWCOLOR 221 221 221
BACKGROUNDSHADOWSIZE 1 1
MINDISTANCE 2
COLOR 0 0 0
END #end label
END #end class
END #end layer
SCALEBAR
BACKGROUNDCOLOR 255 255 255
COLOR 0 0 0
IMAGECOLOR 0 0 0
POSITION lr
SIZE 200 50
STATUS on
STYLE 1
TRANSPARENT on
UNITS miles
END #end scalebar
WEB
HEADER demo_header.html
TEMPLATE demo.html
FOOTER demo_footer.html
MINSCALE 1000
MAXSCALE 1550000
IMAGEPATH "set in demo_init.html"
IMAGEURL "set in demo_init.html"
END #end web
END
END #end map
---------------------
pg00=# \d s81
Table "public.s81"
Column | Type | Modifiers
----------+-------------------+------------------------------------------------------
gid | integer | not null default nextval('public.s81_gid_seq'::text)
length | numeric(38,8) |
symbol | integer |
source | character varying |
the_geom | geometry |
Indexes: s81_pkey primary key btree (gid),
Check constraints: "$1" (srid(the_geom) = -1)
"$2" ((geometrytype(the_geom) = 'MULTILINESTRING'::text) OR
(the_geom IS NULL))
---------------------
pg00=# select * from geometry_columns;
f_table_catalog | f_table_schema | f_table_name | f_geometry_column |
coord_dimension | srid | type | attrelid | varattnum | stats
-----------------+----------------+--------------+-------------------+-----------------+------+-----------------+----------+-----------+-------
| pg00 | s81 | the_geom |
2 | -1 | MULTILINESTRING | 687809 | 5 |
(1 row)
Thanks,
Jason.
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
More information about the MapServer-users
mailing list