[mapserver-users] Tileindex of DGN files
Rahkonen Jukka
Jukka.Rahkonen at mmmtike.fi
Fri Oct 16 05:01:19 PDT 2009
Hi,
Because tileindex is a normal vector file, it can naturally used as a vector layer for Mapserver.
Your layer settins below are defining a very normal vector layer, and shows you some rectangles as greyish lines. Change type to "polygon" and you will see polygons. You do not see features from your dgn files this way because tileindes do not contain them, it just holds the bounding boxes of dgn files and their filenames. Understood so far? If it is hard to believe, open the tileindex file with MicroStation (you are using that, I believe) and see how it looks.
Layer
Name "tmp"
Status default
type line
connectiontype OGR
connection "/MAP/level.lpn"
#tileitem "level"
class
style
color 199 199 199
END
END
END
In case of using tileindes file as an index, to a reference to the real vector files, you are using keyword "tileindex" in the mapfile as
connectiontype OGR
tileindex "D:/ms4w/LPPIPE/level.lpn"
tileitem "level"
This makes Mapserver to do following:
- it opens tileindex file "D:/ms4w/LPPIPE/level.lpn"
- it selects the features which are intersecting the requested map window
- it looks for the filenames of the selected items from the tileitem field "level" and makes a list of them
- it opens the real files according to this filename list
Is it possible for you to convert, let's say two dgn files to shapefile format, put then in a very easy place in your server, make shapefile tileindex and follow the ogrtindex example from Mapserver document? When you see the result you will, in addition to be happy, understand better how the system works. Then you can change, one bit at a time, the set-up towards your final goal. Now there may be many moving targets at the same time and it is a bit difficult to say what is going wrong. You have for sure checked that one dgn file at a time works with your layer settings? Remember to use the filename that is stored in the "level" field in your tileindex because just that will be passed on.
-Jukka Rahkonen-
-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: TA
Lähetetty: pe 16.10.2009 13:47
Vastaanottaja: mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] Tileindex of DGN files
Hi,
Tileindex is as the name suggests, index of tiles. I guess that in the
beginning of history tiles meant image files which are often devided
side by side to suit mapsheets, but ogrtileindex can utilise the same
mechanism with vector files as well. Tileindex holds the extents of
individual image or vector files which are to be used together. When
Mapserver knows that there is a tileindex it starts its work by throwing
a spatial query against tileindex. Tradionally tileindex itself is a
shapefile, but I have been reading that it can come from database as
well, so I guess it could be some other vector format supported by ogr
also. Anyway, it does not matter if tileindex in using the default
shapefile format because it is only an index that points further to the
real data, in this case .dgn files.
You observed that tileindex has one polygon for each original vector
file it is indexing. That't exactly how it is made to work. When
zoomed to some BBOX Mapserver is first sending a spatial query against
tileindex in order to see which indexed rectangles are intersected. Then
Mapserver reads from the "location" field which real vector files it
must open.
The long error message you attached looks to me like the first step is
going OK. Tileindex is read and Mapserver tries to open one by one the
DGN files whose filenames have captured from the "location" fiels. There
are many trials, so you have obviously zoomed rather far. I do not have
an idea why the next step, actually opening DGN files does not succeed.
The error is "msOGRFileOpen(): OGR error. Open failed for OGR connection
in layer `Trn'". I do not know how Mapserver knows that there is a layer
called "Trn" that it try to open but doesn't this mean that the file is
found but something goes wrong when opening it? I have never played
with DGN files with Mapserver so I won't do more guessing.
-Jukka Rahkonen-
Dear Jukka Rahkonen,
Thanks for your reply.
Actually, I just guess whether tileindex file can be only in .shp
format.
When I use tileindex in DGN format (.lpn) like:
Layer
Name "tmp"
Status default
type line
connectiontype OGR
connection "/MAP/level.lpn"
#tileitem "level"
class
style
color 199 199 199
END
END
END
This renders grid without anything inside though . It may be due to when
generating the DGN tileindex, it comes to Error 6: CreateField<> not
supported by this layer. But I have no idea about this problem. (What is
used to createfield? Why not support?)
If I write it like
connectiontype OGR
tileindex "D:/ms4w/LPPIPE/level.lpn"
tileitem "level"
This gives an error
msDrawMap(): Image handling error. Failed to draw layer named 'tmp'.
msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `tmp'.
File not found or unsupported format. msConnPoolRegister(): General error
message. Missing CONNECTION on layer tmp.
>I do not know how Mapserver knows that there is a layer
>called "Trn" that it try to open but doesn't this mean that the file is
>found but something goes wrong when opening it?
I have changed the name of the layer. It should be DGN instead of Trn. Sorry
about that.
Actually, the file is tileindex shp file but I write it like opening a
single shp file only. But I do not know how to call a DGN tileindex file in
type tileindex layer to another layer.
Regards,
TA
--
View this message in context: http://n2.nabble.com/Tileindex-of-DGN-files-tp3820288p3834842.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list