php mapscript example for multipoint shapefile

Tyler Mitchell tylermitchell at SHAW.CA
Tue Nov 2 01:54:48 EST 2004


> I would also be interested in how to
> insert this data into a postgis table, but that's OT here I suppose.

Can't help you on the PHP front, but don't mind diverting in postgis for a
moment.

Assuming you already have a point shapefile loaded into PostGIS, a single
INSERT statement should do the trick. (but let me know if you don't know how
to get to an SQL command window)  Also assuming that you have a table and it
has a single column (not likely) with just point geometry.

Something like this is a start:

insert into mytable values ('SRID=-1;POINT(' || 47.414467 || ' ' || 9.556133
|| ')');

This probably looks more complicated than it needs to be but basically you can
use 'normal' insert statements to hack together a text string that looks like
the same format you see what you query the table.
I haven't tried the exact above statement, but gleaned it from a view I create
from a table holding x,y data in straight numeric (non-geo) columns.

Hope that helps.
Tyler



More information about the mapserver-users mailing list