[mapserver-users] Tileindex of DGN files

TA useintowngas at gmail.com
Thu Oct 15 19:09:15 PDT 2009


Dear Frank Warmerdam,

> type line 
> connectiontype OGR 
> tileindex "/MAP/dgnindex.shp" 
> data "elements" 
> filter "where level = 1,2,3" 

   The error caused by this code is long:

msDrawMap(): Image handling error. Failed to draw layer named 'Trn'.
msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `Trn'.
File not found or unsupported format. msConnPoolRegister(): General error
message. Missing CONNECTION on layer DGN. msConnPoolRegister(): General
error message. Missing CONNECTION on layer DGN. msConnPoolRegister():
General error message. Missing CONNECTION on layer DGN.
msConnPoolRegister(): General error message. Missing CONNECTION on layer
DGN. msConnPoolRegister(): General error message. Missing CONNECTION on
layer DGN. msConnPoolRegister(): General error message. Missing CONNECTION
on layer DGN. msConnPoolRegister(): General error message. Missing
CONNECTION on layer DGN. msConnPoolRegister(): General error message.
Missing CONNECTION on layer DGN. msConnPoolRegister(): General error
message. Missing CONNECTION on layer DGN. msConnPoolRegister(): General
error message. Missing CONNECTION on layer DGN. 


>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. 

  I think so. I found that the .dbf of the tileindex shape file has only a
field "location" which stores the paths of the datafiles. Since 'data' and
'filter' work with a single DGN file, so I try to convert the tileindex
shape file to DGN and test whether filter function can be used with
tileindex DGN. I think this makes the attributes would match between
tileindex file and DGN files.

>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. 

Here are the commandlines:
c:\ms4w\Apache\cgi-bin\ogrtindex -f "DGN" D:\ms4w\DGN\index.DGN
D:\ms4w\DGN\*.lpn

This gives an error of
> Error 6: CreateField<> not supported by this layer 
> Can't find LOCATION field in tile index dataset.

Since it cannot find LOCATION Field, I try:
c:\ms4w\Apache\cgi-bin\ogrtindex -f "DGN" -tileindex "level"
D:\ms4w\DGN\index1.DGN D:\ms4w\DGN\*.lpn
This gives an error of 
Error 6: CreateField<> not supported by this layer 

The DGN created shows blank squares, which each square should render 1 DGN
map. That means the squares are right in coordinates but it is empty. I also
try replace "level" with DGN attributes like type, grapchicgroup and
colorindex but same result comes out. 
If replacing with "elements",  this would show > Can't find elements field
in tile index dataset.> 

>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. 

You mean one layer specfies type tileindex and another specfies type line
with tileindex "layername"?
I have tried the following code:

Layer
	Name "index"
	Type tileindex
	#Connectiontype OGR
	data "/MAP/dgnindex.shp"
END

Layer
	Name "DGN"
	status default
	Type line
	#connectiontype OGR
	tileindex "index"
	styleitem "auto"
	class
		style
			color 255 0 0
		end
	end
END

This gives msTiledSHPOpenFile(): Shapefile error. Unable to open a single
tile to use as a template in layer LPpipe. msShapefileOpen(): Unable to
access file.(/MAP/xxx.lpn)....
If I use connectiontype OGR, the error would be like the top long
error(msDrawMap(): Image handling error.....). For this method, I have no
idea about how to connect to and render a index shp file containing DGN.

>The approach at the top should have worked.
You mean the part > tileindex "/MAP/dgnindex.shp" > data "elements"  ?

Best Regards,
TA

-- 
View this message in context: http://n2.nabble.com/Tileindex-of-DGN-files-tp3820288p3833208.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the MapServer-users mailing list