dynamic point generation with php-mapscript

Jeff Portwine jdport at VERITIME.COM
Fri Apr 15 09:27:24 EDT 2005


I am doing something like this in my code, except I'm using a postgres
database.   My table has the longitudes and latitudes of the points.    I
read in the coordinates from the postgres table, project the point into the
map projection and plot them.   I cannot do map queries as you said, but I
work around that by making the map image a client side image map and make
the points clickable.    This makes navigating the map trickier... I can't
use the same interface that most of the mapserver apps i've looked at use...
but it is working ok.   I'm almost done with the application now on a
funcitionality level and then I'll be working on the interface because right
now it is actually pretty slow to use.

-Jeff

----- Original Message -----
From: "Gavin Simpson" <gavin.simpson at UCL.AC.UK>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Friday, April 15, 2005 7:06 AM
Subject: Re: [UMN_MAPSERVER-USERS] dynamic point generation with
php-mapscript


> Wouter Schaubroeck wrote:
>> Hi,
>>
>> I was wondering if anyone would know some good examples of generating
>> dynamic points with php mapscript? For example: just pulling the points
>> from (in my case: a MySQL db) a database and displaying them without a
>> shape file? And is it possible to do queries on that layer, or
>> displaying the attribute data? I assume not, because there's no
>> associated dbf file.
>>
>> Best regards,
>>
>> Wouter Schaubroeck
>>
>>
>
> See the PHP/Mapscript WIKI - which has such an example:
>
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptAddPoint
>
> Querying that layer is more problematic. You need to create a shapeObj
> and addFeature()'s to that shapeObj etc:
>
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PerlMapScriptExamples42ex1
> shows you how to do this with Perl which is easily translated to PHP (I
> did it yesterday but my code is in a mess of other trial stuff just
> now), with one major exception! PHP/Mapscript is broken at the moment
> and you can't set the index of a shapeObj added to a layer (it needs to
> be numeric, integer, incrementing in steps of 1 - so not a arbitrary
> ordering of ID's from a mysql table index, currently it returns -1
> error), which you need to have queryByPoint do anything useful etc. See:
> http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=806
>
> A patch has been accepted for this bug so you can download a nightly or
> the cvs of mapserver (or replace php_mapscript.c in the tarball of
> mapserver4.4.2 with the one in that bug report) and roll your own
> php_mapscript.so.
>
> After a few errors I have just gotten this compiling as well (a
> nightly), so maybe I can query that layer after all... :-)
>
> Please note - I'm a mapserver virgin so I've been bumbling through this
> for only a day or so - feel free to email me further about this but I
> can't guarantee I'll be able to help much beyond providing some very
> early php code.
>
> G
>
> --
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> Gavin Simpson                     [T] +44 (0)20 7679 5522
> ENSIS Research Fellow             [F] +44 (0)20 7679 7565
> ENSIS Ltd. & ECRC                 [E] gavin.simpsonATNOSPAMucl.ac.uk
> UCL Department of Geography       [W] http://www.ucl.ac.uk/~ucfagls/cv/
> 26 Bedford Way                    [W] http://www.ucl.ac.uk/~ucfagls/
> London.  WC1H 0AP.
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>



More information about the mapserver-users mailing list