[mapserver-users] Tileindex of DGN files

TA useintowngas at gmail.com
Fri Oct 16 03:47:48 PDT 2009




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.



More information about the MapServer-users mailing list