making efficient map layers

Ed McNierney ed at TOPOZONE.COM
Wed Mar 23 10:11:31 PST 2005


Jeff et al. -

I'd generally agree here, with the caveat that having lots of little
shapefiles with a tileindex isn't *necessarily* a bad thing.  I don't
know how many roads fit your filter criteria, but if you end up with
30,000 shapefiles each with one feature each, you didn't win <g>.

The main goal of an index is to discard all the features that can't
possibly be needed for the requested map.  Creating a tileindex for a
group of shapefiles and/or a quadtree index for a single shapefile will
do you no good if your requested map requires you to draw all the
features anyway.

So there's a balance between the data organization and the nature of
your display.  Here's a good paradigm:

1. Any map request should open as few shapefiles as possible.
2. Any map request should use as many features as possible from each
shapefile.

Part 2 doesn't mean you should modify your map design to draw
unnecessary features.  It just means that you should organize your data
so all your eggs are in the same basket for rendering a given map, and
that you should be able to quickly ignore all the data you don't need.
There's overhead in opening a shapefile, so there's a benefit in
batching things into a few shapefiles, but only if you don't then have
to ignore most of the stuff in any given shapefile.

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242 

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Frank Warmerdam
Sent: Tuesday, March 22, 2005 11:30 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] making efficient map layers

On Tue, 22 Mar 2005 10:52:32 -0500, Jeff Portwine <jdport at veritime.com>
wrote:
>
> Thanks for the information...
> I can write a script I'm sure, but I have never used the ogr2ogr 
> utility and I'm not sure how it works... is there documentation for
that?

Jeff,

OGR utility documentation is available off the OGR web page at:

  http://www.gdal.org/ogr

>  Or if Mapscript could be used that might be even better, though I 
> really don't know how I could create new shapefiles from old ones but 
> I'll look into it.

I don't know how to do that off hand in mapscript, but I think it has
the ability to create shapefiles.  You might have to create all the
fields manually.

> Is it possible using ogr2ogr to output (as in your example) CFCC=A13 
> from every county shapefile into a single shapefile, or would I have 
> to create separate output shapefiles for every county and then tile
them?

As Stephen Woodbridge mentions, having lots of little shapefiles with a
tileindex isn't a bad thing.  However, you can use the ogr2ogr -append
and -update to open an existing shapefile in update mode, and append to
the end of it if you really want to merge things.

Best regards,
--
---------------------------------------+--------------------------------
---------------------------------------+------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the MapServer-users mailing list