[ka-Map-users] precache2 problem

Tim Schaub tim at commenspace.org
Tue May 16 13:25:33 EDT 2006


Hi Jesse-
 
It sounds like you could solve this problem by creating a tileindex that
only refers to existing data.  I'm guessing you're familiar with it, but
you can use tile4ms to create a tileindex (one for each layer) based on
the data in your directory structure.
 
If I'm still misunderstanding your setup*, I'm sure you can add in the
appropriate condition to ignore mapscript errors.
 
Tim
 
* My understanding is that you are using the same tileindex for multiple
layers/datasets - despite different coverage for each dataset.  I don't
know whether this is common practice or not.
 


________________________________

	From: ka-map-users-bounces at lists.maptools.org
[mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of Jesse
Lovelace
	Sent: Tuesday, May 16, 2006 10:30 AM
	To: ka-Map-users at lists.maptools.org
	Subject: Re: [ka-Map-users] precache2 problem
	
	
	Hi Tim,
	
	There is looping through directories going on--in
mapserver/mapscript. Mapserver is looking at the tileindex and going
through the areas in it, each area pointing to a directory.  Looking at
the tileindex shapefile in ogrinfo:
	
	OGRFeature(tgrindex):509
	  LOCATION (String) = ../48/48501/
	  POLYGON ((-103.064678999999998 32.958548,-103.064678999999998
33.388489,-102.594234 33.388489,-102.594234
32.958548,-103.064678999999998 32.958548))
	
	OGRFeature(tgrindex):510
	  LOCATION (String) = ../48/48503/
	  POLYGON ((-98.954097000000004 32.9523,-98.954097000000004
33.397534,-98.420435999999995 33.397534,-98.420435999999995
32.9523,-98.954097000000004 32.9523))
	
	OGRFeature(tgrindex):511
	  LOCATION (String) = ../48/48505/
	  POLYGON ((-99.453794000000002
26.571681999999999,-99.453794000000002
27.319154999999999,-98.954176000000004
27.319154999999999,-98.954176000000004
26.571681999999999,-99.453794000000002 26.571681999999999))
	
	When the layer defs are passed to the mapscript object it always
tries to open all layers in each directory referenced by the tile
index--mapserver fails to load those layer shapefiles that do not exists
in the tiger data and gives a warning.  Unfortunately, the script (or
mapscript itself rather) returns nothing from $oMap->draw(); (~line 237)
and so the script dies when it tries to call a method on a non-object.
>From the errors reported from precache2 when I run it, it seems clear
that not finding a certain layer file in a dir is killing it:
	
	Warning: [MapServer Error]: msSHPOpenFile():
(/var/www/http/tl-map/../48/48391//water)
	 in /var/www/http/tl-map/precache2.php on line 237
	
	Warning: [MapServer Error]: msSHPOpenFile():
(/home/data/../48/48391//water)
	 in /var/www/http/tl-map/precache2.php on line 237
	
	Warning: [MapServer Error]: msSHPOpenFile():
(/var/www/http/tl-map/../48/48389//water)
	 in /var/www/http/tl-map/precache2.php on line 237
	
	Warning: [MapServer Error]: msSHPOpenFile():
(/home/data/../48/48389//water)
	 in /var/www/http/tl-map/precache2.php on line 237
	...
	
	jesse
	
	
	On 5/16/06, Tim Schaub <tim at commenspace.org> wrote: 

		Hey Jesse-
		 
		I don't fully understand your setup.  If mapserver can
render your mapfile, then precache2 should work on it as well.  There is
no looping through directories going on, so I can't make an exception
for directories that don't have certain data.  It could be that your
mapfile has an error that you don't know about because you can't tell
that the images aren't being returned in ka-Map.
		 
		If you send your mapfile (just to me) - I'll see if I
can help figure out what is going on.
		 
		Tim
		 


________________________________

			From: ka-map-users-bounces at lists.maptools.org
[mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of Jesse
Lovelace
			Sent: Monday, May 15, 2006 8:21 AM
			To: ka-Map-users at lists.maptools.org
			Subject: [ka-Map-users] precache2 problem
			
			

		
		Precache2 seems to have a problem when processing some
directories for data:
		
		Warning: [MapServer Error]: msSHPOpenFile():
		(/var/www/http/tiger2005fe/37/37053//place)
		 in /var/www/http/tl-map/precache2.php on line 238
		
		
		
		Warning: [MapServer Error]: msSHPOpenFile():
		(/home/data/tiger2005fe/37/37053//place)
		 in /var/www/http/tl-map/precache2.php on line 238
		
		Fatal error: Call to a member function on a non-object
in
		
		/var/www/http/tl-map/precache2.php on line 239
		
		
		The 37/37053 directory doesn't have a 'place'
shapefile--I think precache should
		continue gracefully if it comes to a directory that is
missing a layer--it could
		
		be that not all areas have all layers.
		
		
		This should be an easy fix, but I'm not sure what all is
going on in precache2 so I hesitate to make to many changes.
		
		Many thanks.
		
		jesse
		

		_______________________________________________
		ka-Map-users mailing list
		ka-Map-users at lists.maptools.org 
		http://lists.maptools.org/mailman/listinfo/ka-map-users
		
		
		




	-- 
	Jesse Lovelace
	NCSU Mathematics & Computer Science 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060516/ace0643a/attachment-0001.html


More information about the ka-Map-users mailing list