MapScript Shapefile Object

Daniel Morissette danmo at videotron.ca
Tue May 9 11:31:46 PDT 2000


Stephen Lime wrote:
> 
> The numshapes property is read only and is not kept up-to-date,
> neither is the bounding box. Some internal parts of shapelib maintain
> that information. The shapefile is not actually complete until the
> mapscript object referencing it is dereferenced. At that point the
> shapefile header is written to disk. Re-reading it now populates the
> bounds and numshapes properties properly. That's how it works for
> now and it could change.
> 
> You don't have to actually create shapefiles to render shapes gathered
> from external databases. It's actually more work. Instead you can use
> the pointObj and shapeObj draw methods to do that. Works pretty good
> and no disk access is necessary so it's faster.
> 

How about querying?  If I select a set of records from an SQL database
that contain LAT/LON coordinates and only want to map those points, this
can probably be done the way you suggest above.

However, is there any way to query the same set of points in memory
without creating a shape file on disk?  My main concern is that I don't
think shapes in memory carry any kind of attribute information (or maybe
I overlooked that?), so even if I could query them in memory, how could
I keep the link between the shapes in memory and the SQL records in
order to display info from the database in response to the query?

Any ideas about that?  Or maybe it's just some parts of the shape object
handling in MapScript that I have overlooked?

Thanks,
-- 
------------------------------------------------------------
 Daniel Morissette                       danmo at videotron.ca
              http://pages.infinit.net/danmo/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the MapServer-users mailing list