[mapserver-users] Tileindex of DGN files

Frank Warmerdam warmerdam at pobox.com
Thu Oct 15 11:48:32 EDT 2009


TA wrote:
> Dear all,
>    I have another problem. Can I filter the layers of the tileindex using
> "filter" in the mapfile? I write the code like this:
> 
> type line
> connectiontype OGR
> tileindex "/MAP/dgnindex.shp"
> data "elements"
> filter "where level = 1,2,3"
> 
>   But it comes to an error.

TA,

What error?

> It may be because the functions "data" &
> "filter" should not use under the "tileindex".

The above should work to select only features from the DGN files with
the desired attribute.  Note that this filter will be applied to the
files pointed to by dgnindex.shp, not to the tileindex itself.

>   My tileindex file is generated with the DGN files. So I try to use
> ogrtindex tool to create a tileindex file with ".DGN" at the end. But it
> said:
> Error 6: CreateField<> not supported by this layer
> Can't find LOCATION field in tile index dataset.

I'm not clear what you actually did here to get this error.  If you
provide an exact commandline I might be able to look into it.

>    I also try this:
> type tileindex
> data "/MAP/dgnindex.shp"
> filter "where level = 1,2,3" 
>    This code cause no error but nothing displays on the screen.

you would use 'TYPE TILEINDEX' if you want to manage the tileindex itself
as a distinct layer.  To the best of my knowledge type tileindex layers
do not draw.  You would need another TYPE LINE layer that references the
tileindex layer as it's tileindex instead of pointing directly to a shapefile.
This would allow you to apply a filter to the tileindex instead of the
underlying files if that is your objective.

The approach at the top should have worked.  I would suggest you isolate
this and possibly communicate with me by email on the error.

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