shp2tile producing shp's with 1 object

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Sat Apr 22 20:25:52 EDT 2006


Mark Dieterich wrote:
> I'm running shp2tile to break up the tiger shapefiles and consistently
> getting one (or more, I'm not sure yet) tiled shapefiles that have only
> a single feature in them.  As a result, this is generating a bounding
> box with either x or y coordinates that are the exact same value.  I've
> tried retiling with a variety of quadtree values and I always end up
> with one particular shapefile that has a single feature in it.  Bottom
> line, this is killing some other code that currently checks for a "real"
> bounding box.
> 
> So I'm curious whether:
> 
> a) This likely to be something with my underlying source data that's
> causing this
> b) Whether it's legit to end up with, basically a line, in one of the
> tiled shapefiles or is this a bug
> 
> If the general consensus is this is not unexpected, then we can just
> work around in the other code.

Hi Mark,

This is not UN expected, but it might also be a bug. I am happy to look 
at the file if you want to zip it up and email it to me or put it 
somewhere I can download it.

If you are using the quadtree tiling option and set the max object count 
to say 5000 and you have 5001 objects it will split the file into two 
files with 5000 and 1 respectively. I hindsight it might make more 
create two tiles it 2500 and 2501 respectively.

If you tile it using a grid, objects the will not fit in the grid bbox 
will get placed in a super tile that might be the original extents. 
because all object must fit into the grid cell or be placed somewhere 
else. If you have a bunch of little segments that are easy to place in 
the grid cells and some bigger objects that would fit in any single cell 
those get bumped up to the super tile.

Hope this makes sense,
   -Steve W.



More information about the mapserver-users mailing list