shapes to MySQL

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Fri Mar 3 17:25:47 EST 2006


Brent Wood wrote:
>>To answer your question, NO, you can not put your shapefiles in MySQL 
>>and render then via mapserver. You can put them in postGIS, but they 
>>will be slower than shapefiles.
> 

Brent,

Right you are, I should not have been so authoritative in my statement. 
There are always exceptions to the rules. But I believe in this case, 
the right thing to do for this user is to use shptree on his shapefiles 
because his problem is rendering and he does not have spatial indexes. 
If he still has a performance problem, then make a stab at using a 
database, but I believe that using MySQL will not help his problem in 
anyway. I love Postgres and use it a lot, but I have not found it to be 
faster in MOST general rendering cases, but it is the only GOOD solution 
for doing thematic maps. Yes, Postgres generally out performance 
shapefiles for queries if you have to query any large amount of data 
because it has more options for indexes.

-Steve

> 
> Umm... by my (totally subjective & unauthoritative) benchmarks, if you have a
> spatial & aspatial query applied to a properly indexed dataset in PostGIS, it
> can be faster than a shapefile. A shapefile was faster for plotting the entire
> dataset, but, for example, a national elevation contour dataset (20m intervals)
> is faster than the same data as shapefiles when zooming & the zoom layers have
> different sets of contours (from all at 20m when zoomed in to 100, to 200, to
> 500m when zoomed right out).
> 
> I haven't tried as much with query layers, but when working with a dataset of
> millions of records, the PostGIS data seems more responsive, quite
> significantly in some cases.
> 
> Generally I find that the larger the dataset & the more complex the
> query/filter you apply, the more PostGIS is likely to be faster. Conversely,
> for smaller & simpler datasets/filters, shapefiles are indeed faster.
> 
> Given the nature of databases & their overhead this is about what I'd expect. 
> 
> 
> So just to check that my impressions are not colored too much by my
> expectations, do others agree with this or not?
> 
> 
> 
>    Brent Wood
> 



More information about the mapserver-users mailing list