Attributes in tile indexes?

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Mon Apr 23 11:53:56 EDT 2007


Jeff,

Make SURE all your tiles have a spatial index *.qix and the tileindex 
also has a spatial index. These can be built with

   shptree file.shp

-Steve W.

Jeff Dege wrote:
> OK - I knew I had to be doming something stupid.
> 
> To tell a layer to draw using a tileindex shapefile, you include the
> commands:
> 
>    TILEINDEX "tileindex"
>    TILEITEM "LOCATION"
> 
> Using:
> 
>    DATA "tileindex"
> 
> won't work.
> 
> Now, after all of that, drawing with the split shapefiles is slower than
> with the original.  So there's still some playing to do.
>  
> 
>> -----Original Message-----
>> From: UMN MapServer Users List 
>> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Jeff Dege
>> Sent: Monday, April 23, 2007 9:53 AM
>> To: MAPSERVER-USERS at LISTS.UMN.EDU
>> Subject: Re: [UMN_MAPSERVER-USERS] Attributes in tile indexes?
>>
>> Well, I've been looking at this in more detail, and finding that the
>> tileindex layer isn't drawing at all.  With all other layers 
>> turned off,
>> when I use shp2img with an extent that causes the tile layer 
>> to draw, I
>> get a blank image.  When I change the layer to use the original
>> shapefile, I get the data displayed.  (And the layer takes 40 
>> seconds to
>> draw, even after I've run shptree on the shapefile, which is why I've
>> been playing around with tiling.)
>>
>> I identified the individual tile shapefile that contains the area I'm
>> trying to draw and used it directly, and it works fine.  So the
>> splitting apart seems to be working.  But the tileindex 
>> shapefile seems
>> to be broken.
>>
>>> -----Original Message-----
>>> From: UMN MapServer Users List 
>>> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Stephen 
>> Woodbridge
>>> Sent: Saturday, April 21, 2007 7:15 AM
>>> To: MAPSERVER-USERS at LISTS.UMN.EDU
>>> Subject: Re: [UMN_MAPSERVER-USERS] Attributes in tile indexes?
>>>
>>> Jeff,
>>>
>>> This should just work. There is nothing special you should 
>>> have to do. I 
>>> do it all the time with my mapfiles. I use shp2tile to break 
>>> mine up but 
>>> that should not make a difference.
>>>
>>> First I would try changing your layer to use just one of 
>> the smaller 
>>> shape files without the tileindex and see if that works and 
>>> that you can 
>>> display the labels.
>>>
>>> You might also want to post info about what OS, version of 
>> mapserver, 
>>> and the LAYER block in question.
>>>
>>> -Steve W
>>>
>>> Jeff Dege wrote:
>>>> I have a shape file that's too big to draw maps with - 
>> takes far too
>>>> long.
>>>>
>>>> In an attempt to speed things up, I split it into 16 
>>> smaller shapefiles,
>>>> using:
>>>>
>>>>    ogr2ogr -f "ESRI Shapefile" -spat xmin ymin xmax ymax newXX.shp
>>>> old.shp
>>>>
>>>> Then did a shptree on each of these new files, then a 
>> shptinidex to
>>>> create a single tile index shapefile on them, and tried to 
>>> build a map.
>>>> It works fine, so long as I don't try to display labels.  
>>> But if I do, I
>>>> get errors:
>>>>
>>>>    msDBFGetItemIndex(): Item 'NAME' not found.
>>>>
>>>> Where "NAME" is the attribute I'm trying to use for the 
>>> label.  It looks
>>>> like the tileindex shapefile doesn't expose the attributes of the
>>>> underlying shape tiles.  I've done an ogrinfo on the 
>>> shapefiles that I'd
>>>> generated, and the attributes are there.
>>>>
>>>> Can I expose the attributes through the tileindex?
>>>>
>>>> How?



More information about the mapserver-users mailing list