[Mapserver-users] Re: Mapserver/Mapscript and MySQL 4
pkishor_98
pkishor at geoanalytics.com
Mon Aug 4 19:10:36 PDT 2003
--- In mapserver-users at yahoogroups.com, Matthew Smith <matt at k...> wrote:
> Hi All
>
> I have an application where I need to:
> * Create a layer from a shapefile
> * Create an overlying layer of data from a database query.
>
> I am using MySQL 4.0.x, so MyGIS mentioned in the Wiki is out, although
> it would have been the preferred solution.
why would it have been the preferred solution? The reason I ask -- is there
something to be achieved by putting your spatial data into a database? is there
something you can do with it in the db that you can't do with it as shapefiles?
Essentially, I ask this of myself -- is there any advantage to a specific way, or am I
going to do it that way only because it is available...
That said...
>
> I guess that means that I'll have to generate everything with Mapscript
> instead - no real hardship since I do just about everything else in Perl.
yup, that is how I would do it.
>
> Can anyone point me at an example similar to what I'm trying to achieve
> (one layer from a shapefile, one from DBI)?
>
> Is using two layer sources like this a reasonable approach, or should I
> just dump all my shapefiles into MySQL? I've considered this but feel
> that it could be a little awkward as this version of MySQL does not
> appear to have native GIS support - my current data structures can
> already hold point data, but my "bottom layer" is all polygons.
>
two layer sources sounds very reasonable... let the polys be a shapefile, and let the
points be in MySQL. Grab the required points using DBI/DBD, generate a layer with
those points as the features...
in fact, does your point data change? does it need to be stored in a database?
depending on the size of the dataset (number of points), and "stability" of those
points, converting them all to a shapefile before doing anything might make the
operation even faster... you avoid the DBI/DBD overhead.
Anyway, your proposed solution seems perfectly reasonable.
More information about the MapServer-users
mailing list