[Mapserver-users] mapscript: querying w/o shape files

Lars V. Nielsen LVN at gispro.dk
Wed Feb 5 16:24:35 EST 2003


Hi Eric,

I've done this exercise a couple of times, and I've found that the easiest way to handle it was to:

$mapimage = $map->draw();
foreach ... point you want to render
   ... get the coordinate from MySQL (or whatever source you have)
   ... get a reference to the designated layer, e.g. $layer = $map->getLayerByName("myLayer");
   $pt = ms_newPointObj();
   $pt->setXY($coordX,$coordY);
   $pt->draw($map,$layer,$mapimage,0,"");
   $pt->free();

To receive the points, I'm setting up empty layers in the MAP file, complete with symbol style etc.
But you can make a new layer on-the-fly if it suits your purpose better: $layer = ms_newLayerObj($map);

Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/
http://hjem.get2net.dk/lars-online/
WGS84: 10.20'40"E 55.20'20"N
----- Original Message ----- 
From: "Eric Bridger" <eric at gomoos.org>
To: <mapserver-users at lists.gis.umn.edu>
Sent: Wednesday, February 05, 2003 3:26 PM
Subject: [Mapserver-users] mapscript: querying w/o shape files


> 
> Using mapscript (mapserv 3.6.4) I am populating and drawing a layer with
> point objects.  I'm getting lat,lon and a text label from a mySQL
> database, in other words, from a data source or connection type not
> supported by MS. What are my options for using layer->queryByPoint() on
> this layer, if any? 
> 
> Since I know the order I've added the points I can track the record id
> of the points. Do I need to create a dummy *.dbf file, a real *.dbf
> file?  Is there some way to use MS_INLINE or perhaps layer->addFeature()
> or access the labels for the points created to allow me to query a layer
> created on the fly?
> 
> Eric Bridger
> eric at gomoos.org  Gulf of Maine Ocean Observing System www.gomoos.org
> 
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 



More information about the mapserver-users mailing list