[mapserver-users] Trouble with OGR output and writing to temppath

2011-12-04 Thread Rahkonen Jukka
Hi,

I have troubles with getting the ORG output to work. 

I have configured CVS ouput like this
OUTPUTFORMAT
  NAME CSV
  DRIVER OGR/CSV
  MIMETYPE text/csv
  FORMATOPTION LCO:GEOMETRY=AS_WKT
  FORMATOPTION STORAGE=filesystem
  FORMATOPTION FORM=simple
  FORMATOPTION FILENAME=result.csv
END

I have set TEMPPATH in the MAP/WEB
WEB
   TEMPPATH /usr/temp/

/usr/temp directory has 0777 permissions.  Mapserver can write error.log file 
into that directory without troubles. 
WFS works normally with outputformats GML2 and GML3. However, WFS requests with 
CSV outputformat fails and I am getting error messages like this:

 msOGRWriteFromQuery(): General error message. Failed to open result file 
'/usr/temp/4edb45fd_707c_0/result.csv'.

Error.log file is also listing all the features and all the attributes so the 
query itself is successful. 
I am trying this with Ubuntu server and Mapserver version is 6.0.1.  It is also 
odd that I am sure that I did manage to get valid zipped shapefiles out from 
this same server a couple of days ago but now all that I am getting back is 
empty zipfile. Error.log does not report about any error in this case.

Any suggestions what to try next or what to do for finding the ultimate reason 
for the error?

-Jukka Rahkonen-
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Trouble with OGR output and writing to temppath

2011-12-04 Thread Matt McClelland
Check if you have enough disk space left

 df -alh

Matt :)

Sent from my iPhone

On 04/12/2011, at 9:29 PM, Rahkonen Jukka jukka.rahko...@mmmtike.fi wrote:

 Hi,
 
 I have troubles with getting the ORG output to work. 
 
 I have configured CVS ouput like this
 OUTPUTFORMAT
  NAME CSV
  DRIVER OGR/CSV
  MIMETYPE text/csv
  FORMATOPTION LCO:GEOMETRY=AS_WKT
  FORMATOPTION STORAGE=filesystem
  FORMATOPTION FORM=simple
  FORMATOPTION FILENAME=result.csv
 END
 
 I have set TEMPPATH in the MAP/WEB
 WEB
   TEMPPATH /usr/temp/
 
 /usr/temp directory has 0777 permissions.  Mapserver can write error.log file 
 into that directory without troubles. 
 WFS works normally with outputformats GML2 and GML3. However, WFS requests 
 with CSV outputformat fails and I am getting error messages like this:
 
 msOGRWriteFromQuery(): General error message. Failed to open result file 
 '/usr/temp/4edb45fd_707c_0/result.csv'.
 
 Error.log file is also listing all the features and all the attributes so the 
 query itself is successful. 
 I am trying this with Ubuntu server and Mapserver version is 6.0.1.  It is 
 also odd that I am sure that I did manage to get valid zipped shapefiles out 
 from this same server a couple of days ago but now all that I am getting back 
 is empty zipfile. Error.log does not report about any error in this case.
 
 Any suggestions what to try next or what to do for finding the ultimate 
 reason for the error?
 
 -Jukka Rahkonen-
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Trouble with OGR output and writing to temppath

2011-12-04 Thread Rahkonen Jukka
Hi,

Part of the problem can be solved by setting TEMPPATH at MAP - WEB level.  See 
http://trac.osgeo.org/mapserver/ticket/3354 and recent 
http://trac.osgeo.org/mapserver/ticket/4103.  That makes Mapserver to use the 
desired directory as a target for the temporary stuff.  However, there seems 
still be something that fails at least for me.

Could you try to add TEMPPATH to your mapfile and see if you still get the same 
error?

-Jukka-

John Cartwright wrote:

 This sounds like the same trouble I had and filed a ticket 
 (http://trac.osgeo.org/mapserver/ticket/4085).  I haven't yet found a 
 workaround.

--john

On Dec 4, 2011, at 3:29 AM, Rahkonen Jukka wrote:

 Hi,

 I have troubles with getting the ORG output to work.

 I have configured CVS ouput like this
 OUTPUTFORMAT
  NAME CSV
  DRIVER OGR/CSV
  MIMETYPE text/csv
  FORMATOPTION LCO:GEOMETRY=AS_WKT
  FORMATOPTION STORAGE=filesystem
  FORMATOPTION FORM=simple
  FORMATOPTION FILENAME=result.csv
 END

 I have set TEMPPATH in the MAP/WEB
 WEB
   TEMPPATH /usr/temp/

 /usr/temp directory has 0777 permissions.  Mapserver can write error.log file 
 into that directory without troubles.
 WFS works normally with outputformats GML2 and GML3. However, WFS requests 
 with CSV outputformat fails and I am getting error messages like this:

 msOGRWriteFromQuery(): General error message. Failed to open result file 
 '/usr/temp/4edb45fd_707c_0/result.csv'.

 Error.log file is also listing all the features and all the attributes so the 
 query itself is successful.
 I am trying this with Ubuntu server and Mapserver version is 6.0.1.  It is 
 also odd that I am sure that I did manage to get valid zipped shapefiles out 
 from this same server a couple of days ago but now all that I am getting back 
 is empty zipfile. Error.log does not report about any error in this case.

 Any suggestions what to try next or what to do for finding the ultimate 
 reason for the error?

 -Jukka Rahkonen-
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Trouble with OGR output and writing to temppath

2011-12-04 Thread Rahkonen Jukka
Hi,

I could repeat the error on Windows (MS4W and Mapserver 6.0.0).  This time data 
come from shapefile while previously they came from PostGIS.  However, your 
error is not exactly the same than mine. You have OGR CreateDataSource failed 
while I am getting Failed to open result file.

ServiceException code=NoApplicableCode locator=mapserv
msOGRWriteFromQuery(): General error message. Failed to open result file 
#39;/ms4w/wfstemp/4edbae34_126c_0/result.csv#39;.
  /ServiceException
/ServiceExceptionReport

-Jukka Rahkonen-

Smith, Michael wrote:

 Jukka,

 I've started having this issue on Windows mapserver just recently. I have
 not had this problem on unix. Not sure if this is a mapserver issue or a
 gdal one.

 I get similar errors to yours:

 msOGRWriteFromQuery(): General error message. OGR CreateDataSource failed
for 'C:/cm2_files/tmp/4edb808b_178_0/ship_locations.gdb.zip' with driver
'FileGDB'.

It appears to only happen with FORMATOPTION STORAGE=filesystem.


Mike

--
Michael Smith

US Army Corps
Remote Sensing GIS/Center



On 12/4/11 6:22 AM, Rahkonen Jukka jukka.rahko...@mmmtike.fi wrote:

Hi,

Thanks, natural thing that I had not checked. Fortunately or
unfortunately, none of the mounts seem to have more than 2% used.  I
guess that writing the request output to error.log located in the same
mount would also fail in that case.

-Jukka-
 Matt McClelland wrote:


 Check if you have enough disk space left

 df -alh

 Matt :)

 Sent from my iPhone

On 04/12/2011, at 9:29 PM, Rahkonen Jukka jukka.rahko...@mmmtike.fi
wrote:

 Hi,

 I have troubles with getting the ORG output to work.

 I have configured CVS ouput like this
 OUTPUTFORMAT
  NAME CSV
  DRIVER OGR/CSV
  MIMETYPE text/csv
  FORMATOPTION LCO:GEOMETRY=AS_WKT
  FORMATOPTION STORAGE=filesystem
  FORMATOPTION FORM=simple
  FORMATOPTION FILENAME=result.csv
 END

 I have set TEMPPATH in the MAP/WEB
 WEB
   TEMPPATH /usr/temp/

 /usr/temp directory has 0777 permissions.  Mapserver can write
error.log file into that directory without troubles.
 WFS works normally with outputformats GML2 and GML3. However, WFS
requests with CSV outputformat fails and I am getting error messages
like this:

 msOGRWriteFromQuery(): General error message. Failed to open result
file '/usr/temp/4edb45fd_707c_0/result.csv'.

 Error.log file is also listing all the features and all the attributes
so the query itself is successful.
 I am trying this with Ubuntu server and Mapserver version is 6.0.1.  It
is also odd that I am sure that I did manage to get valid zipped
shapefiles out from this same server a couple of days ago but now all
that I am getting back is empty zipfile. Error.log does not report about
any error in this case.

 Any suggestions what to try next or what to do for finding the ultimate
reason for the error?

 -Jukka Rahkonen-
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Mapcache question.

2011-12-04 Thread forums
Hi:

I hope this is the proper place to ask questions about Mapcache since it's
been moved into the trunk of Mapserver.

I'm wondering if Mapcache can help with a particular setup, and if so maybe
some advice or direction on where to start?

Here's the setup.  Every 5 minutes a new set of GeoTiffs are created in a
new directory.  I create a tileindex for the GeoTiffs and use those in the
map layer.  Every hour, anything more than 5hours old gets deleted.
I have a single mapfile setup.

The general layer is setup like:

LAYER
NAME 'IMG1'
METADATA
'wms_title'   'IMG 1'
'wms_srs' 'EPSG:4326'
'wms_extent'  'MINX MINY MAXX MAXY'
'default_targetdate' ''
'targetdate_validation_pattern' '^[0-9]{12}$'
END
STATUS ON
TILEINDEX '/PATH/TO/IMG/DIR/%targetdate%/TILEINDEX.shp'
TILEITEM 'Location'
TYPE RASTER
END


I'm currently loading these images as overlays for Googlemaps. using the
mode=tiletilemode=gmaps...targetdate=2011...etc.
Problem is it's too slow. I end up loading hundreds of images, as I
basically create an animation using sequential times.

I'd like to be able to have a single mapcache config file, that will pass
the date through to pull the proper shapefile, and have the result cached
so next time it's loading off the disk.  MOST of the images end up being
blank/transparent tiles.

Is Mapcache a good choice for this?
The front end for this is just a simple GoogleMaps viewport, but ends up
loading multiple timeslots for display.  It generates the request URL (not
currently in WMS fashion but could be).

Thanks for any help I can get.

Jerl
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapcache question.

2011-12-04 Thread Stephen Woodbridge

Hi Jerl,

Maybe! is the short answer. The analysis of the problem is:

1. What is the primary purpose of mapcache?

Will it is a flexible tools that can do a lot of things, like on-the-fly 
cache building, compositing images from tiles in the cache, etc. It's 
primary purpose is to provide tile generation and tile serving for 
environments that need tiles instead of draw on demand images.


2. So to some extent this depends on your usage model, ie: tile requests 
per unit time.


3. it sounds like from your description below, that you are serving draw 
on demand images and not using a tile cache at the moment.


To use a tile cache given your current scenario, you would still have to 
do everything the same as before, but you would also have to figure out 
what tiles at the various zoom levels needed to be removed when any of 
the GeoTiffs changed, either replace some existing GeoTiff or got 
removed because of age.


I'm not sure I see anyway that it will magically simplify your process. 
And on the contrary, it will add some complexity to the whole process. 
That said, if your demand is increasing and your server(s) are having 
trouble keeping up with the image demand, then adding mapcache could be 
a solution.


-Steve W

On 12/4/2011 2:13 PM, forums wrote:

Hi:

I hope this is the proper place to ask questions about Mapcache since
it's been moved into the trunk of Mapserver.

I'm wondering if Mapcache can help with a particular setup, and if so
maybe some advice or direction on where to start?

Here's the setup.  Every 5 minutes a new set of GeoTiffs are created in
a new directory.  I create a tileindex for the GeoTiffs and use those in
the map layer.  Every hour, anything more than 5hours old gets deleted.
I have a single mapfile setup.

The general layer is setup like:

 LAYER
 NAME 'IMG1'
 METADATA
'wms_title' 'IMG 1'
'wms_srs' 'EPSG:4326'
'wms_extent' 'MINX MINY MAXX MAXY'
'default_targetdate' ''
'targetdate_validation_pattern' '^[0-9]{12}$'
 END
 STATUS ON
 TILEINDEX '/PATH/TO/IMG/DIR/%targetdate%/TILEINDEX.shp'
 TILEITEM 'Location'
 TYPE RASTER
 END


I'm currently loading these images as overlays for Googlemaps. using the
mode=tiletilemode=gmaps...targetdate=2011...etc.
Problem is it's too slow. I end up loading hundreds of images, as I
basically create an animation using sequential times.

I'd like to be able to have a single mapcache config file, that will
pass the date through to pull the proper shapefile, and have the result
cached so next time it's loading off the disk.  MOST of the images end
up being blank/transparent tiles.

Is Mapcache a good choice for this?
The front end for this is just a simple GoogleMaps viewport, but ends up
loading multiple timeslots for display.  It generates the request URL
(not currently in WMS fashion but could be).

Thanks for any help I can get.

Jerl




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapcache question.

2011-12-04 Thread thomas bonfort
Jerl,
mapcache itself does not do any pruning of the caches it has created,
but you can get the same effect by using a cache backend that supports
expiration (i.e. memcache).
Mapcache can fit your need, provided:
- you configure your tileset with a targetdate dimension- you use
a memcache backend to store the created tiles, and set an expires
value in mapcache to 5 hours
If the memory requirement for storing 5 hours worth of tiles is too
important for a memcache server instance, you can have a look at
membase which will also store less frequently used data to disk. The
membase protocol is compatible with memcache, so you can use either
memcache or membase with the same mapcache configuration.

Of course, by running a script every hour to delete expired tiles as
you are doing now, you can then use the classic disk based cache
backend.
regards,
thomas
On Sun, Dec 4, 2011 at 20:13, forums for...@craniumjuice.com wrote:
 Hi:

 I hope this is the proper place to ask questions about Mapcache since it's
 been moved into the trunk of Mapserver.

 I'm wondering if Mapcache can help with a particular setup, and if so maybe
 some advice or direction on where to start?

 Here's the setup.  Every 5 minutes a new set of GeoTiffs are created in a
 new directory.  I create a tileindex for the GeoTiffs and use those in the
 map layer.  Every hour, anything more than 5hours old gets deleted.
 I have a single mapfile setup.

 The general layer is setup like:

     LAYER
         NAME 'IMG1'
         METADATA
             'wms_title'           'IMG 1'
             'wms_srs'             'EPSG:4326'
             'wms_extent'          'MINX MINY MAXX MAXY'
             'default_targetdate' ''
             'targetdate_validation_pattern' '^[0-9]{12}$'
         END
         STATUS ON
         TILEINDEX '/PATH/TO/IMG/DIR/%targetdate%/TILEINDEX.shp'
         TILEITEM 'Location'
         TYPE RASTER
     END


 I'm currently loading these images as overlays for Googlemaps. using the
 mode=tiletilemode=gmaps...targetdate=2011...etc.
 Problem is it's too slow. I end up loading hundreds of images, as I
 basically create an animation using sequential times.

 I'd like to be able to have a single mapcache config file, that will pass
 the date through to pull the proper shapefile, and have the result cached so
 next time it's loading off the disk.  MOST of the images end up being
 blank/transparent tiles.

 Is Mapcache a good choice for this?
 The front end for this is just a simple GoogleMaps viewport, but ends up
 loading multiple timeslots for display.  It generates the request URL (not
 currently in WMS fashion but could be).

 Thanks for any help I can get.

 Jerl



 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Trouble with OGR output and writing to temppath

2011-12-04 Thread John Cartwright
Thanks for the suggestion, but I ran across that ticket earlier and setting 
TEMPPATH didn't address my problem. It does direct the temporary files to the 
desired location I still see:

  ServiceException code=NoApplicableCode locator=mapserv
msOGRWriteFromQuery(): General error message. Failed to open result file 
#39;/Library/WebServer/Documents/output/4edbd893_e3b_0/result.csv#39;.
  /ServiceException
/ServiceExceptionReport

in my output file.

--john


On Dec 4, 2011, at 10:06 AM, Rahkonen Jukka wrote:

 Hi,
 
 Part of the problem can be solved by setting TEMPPATH at MAP - WEB level.  
 See http://trac.osgeo.org/mapserver/ticket/3354 and recent 
 http://trac.osgeo.org/mapserver/ticket/4103.  That makes Mapserver to use the 
 desired directory as a target for the temporary stuff.  However, there seems 
 still be something that fails at least for me.
 
 Could you try to add TEMPPATH to your mapfile and see if you still get the 
 same error?
 
 -Jukka-
 
 John Cartwright wrote:
 
 This sounds like the same trouble I had and filed a ticket 
 (http://trac.osgeo.org/mapserver/ticket/4085).  I haven't yet found a 
 workaround.
 
 --john
 
 On Dec 4, 2011, at 3:29 AM, Rahkonen Jukka wrote:
 
 Hi,
 
 I have troubles with getting the ORG output to work.
 
 I have configured CVS ouput like this
 OUTPUTFORMAT
 NAME CSV
 DRIVER OGR/CSV
 MIMETYPE text/csv
 FORMATOPTION LCO:GEOMETRY=AS_WKT
 FORMATOPTION STORAGE=filesystem
 FORMATOPTION FORM=simple
 FORMATOPTION FILENAME=result.csv
 END
 
 I have set TEMPPATH in the MAP/WEB
 WEB
  TEMPPATH /usr/temp/
 
 /usr/temp directory has 0777 permissions.  Mapserver can write error.log 
 file into that directory without troubles.
 WFS works normally with outputformats GML2 and GML3. However, WFS requests 
 with CSV outputformat fails and I am getting error messages like this:
 
 msOGRWriteFromQuery(): General error message. Failed to open result file 
 '/usr/temp/4edb45fd_707c_0/result.csv'.
 
 Error.log file is also listing all the features and all the attributes so 
 the query itself is successful.
 I am trying this with Ubuntu server and Mapserver version is 6.0.1.  It is 
 also odd that I am sure that I did manage to get valid zipped shapefiles out 
 from this same server a couple of days ago but now all that I am getting 
 back is empty zipfile. Error.log does not report about any error in this 
 case.
 
 Any suggestions what to try next or what to do for finding the ultimate 
 reason for the error?
 
 -Jukka Rahkonen-
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapcache question.

2011-12-04 Thread forums
Thanks Stephen and Thomas.

I think I'll be good with the dimension and the disk cache.  Unfortunately,
the apache we have doesn't have memcache built into it (too much hassle to
upgrade it right now) and the version of SQLite is too old...also a hassle
to upgrade.

I was able to get it to load the proper map when just using the entire
bounding box, the whole world.  Now to make it work with the the tilemode
for google...which looks like that should be straight forward??


Thanks guys!!

Jerl

On Sun, Dec 4, 2011 at 2:00 PM, thomas bonfort thomas.bonf...@gmail.comwrote:

 Jerl,
 mapcache itself does not do any pruning of the caches it has created,
 but you can get the same effect by using a cache backend that supports
 expiration (i.e. memcache).
 Mapcache can fit your need, provided:
 - you configure your tileset with a targetdate dimension- you use
 a memcache backend to store the created tiles, and set an expires
 value in mapcache to 5 hours
 If the memory requirement for storing 5 hours worth of tiles is too
 important for a memcache server instance, you can have a look at
 membase which will also store less frequently used data to disk. The
 membase protocol is compatible with memcache, so you can use either
 memcache or membase with the same mapcache configuration.

 Of course, by running a script every hour to delete expired tiles as
 you are doing now, you can then use the classic disk based cache
 backend.
 regards,
 thomas
 On Sun, Dec 4, 2011 at 20:13, forums for...@craniumjuice.com wrote:
  Hi:
 
  I hope this is the proper place to ask questions about Mapcache since
 it's
  been moved into the trunk of Mapserver.
 
  I'm wondering if Mapcache can help with a particular setup, and if so
 maybe
  some advice or direction on where to start?
 
  Here's the setup.  Every 5 minutes a new set of GeoTiffs are created in a
  new directory.  I create a tileindex for the GeoTiffs and use those in
 the
  map layer.  Every hour, anything more than 5hours old gets deleted.
  I have a single mapfile setup.
 
  The general layer is setup like:
 
  LAYER
  NAME 'IMG1'
  METADATA
  'wms_title'   'IMG 1'
  'wms_srs' 'EPSG:4326'
  'wms_extent'  'MINX MINY MAXX MAXY'
  'default_targetdate' ''
  'targetdate_validation_pattern' '^[0-9]{12}$'
  END
  STATUS ON
  TILEINDEX '/PATH/TO/IMG/DIR/%targetdate%/TILEINDEX.shp'
  TILEITEM 'Location'
  TYPE RASTER
  END
 
 
  I'm currently loading these images as overlays for Googlemaps. using the
  mode=tiletilemode=gmaps...targetdate=2011...etc.
  Problem is it's too slow. I end up loading hundreds of images, as I
  basically create an animation using sequential times.
 
  I'd like to be able to have a single mapcache config file, that will pass
  the date through to pull the proper shapefile, and have the result
 cached so
  next time it's loading off the disk.  MOST of the images end up being
  blank/transparent tiles.
 
  Is Mapcache a good choice for this?
  The front end for this is just a simple GoogleMaps viewport, but ends up
  loading multiple timeslots for display.  It generates the request URL
 (not
  currently in WMS fashion but could be).
 
  Thanks for any help I can get.
 
  Jerl
 
 
 
  ___
  mapserver-users mailing list
  mapserver-users@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/mapserver-users
 




-- 
A computer without Windows is like chocolate cake without mustard.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapcache question.

2011-12-04 Thread forums
I almost have it, I just can't seem to get the targetdate dimension to
populate.

/mapcache/gmaps/country@WGS84/1/1/0.png works fine if I don't have the
layers that require the targetdate parameter.  I get a parameter pattern
failed validation error returned from Mapserver when I have the necessary
layers defined in the mapcache config file.

The obvious thing for me to try was:
/mapcache/gmaps/country@WGS84/1/1/0.png?targetdate=201112042105

But that failed.  Is there a way to get the targetdate to fill in? I've
moved it around a bit, but still can't get it to fill in.

Thanks again!!

Jerl


On Sun, Dec 4, 2011 at 2:59 PM, forums for...@craniumjuice.com wrote:

 Thanks Stephen and Thomas.

 I think I'll be good with the dimension and the disk cache.
  Unfortunately, the apache we have doesn't have memcache built into it (too
 much hassle to upgrade it right now) and the version of SQLite is too
 old...also a hassle to upgrade.

 I was able to get it to load the proper map when just using the entire
 bounding box, the whole world.  Now to make it work with the the tilemode
 for google...which looks like that should be straight forward??


 Thanks guys!!

 Jerl


 On Sun, Dec 4, 2011 at 2:00 PM, thomas bonfort 
 thomas.bonf...@gmail.comwrote:

 Jerl,
 mapcache itself does not do any pruning of the caches it has created,
 but you can get the same effect by using a cache backend that supports
 expiration (i.e. memcache).
 Mapcache can fit your need, provided:
 - you configure your tileset with a targetdate dimension- you use
 a memcache backend to store the created tiles, and set an expires
 value in mapcache to 5 hours
 If the memory requirement for storing 5 hours worth of tiles is too
 important for a memcache server instance, you can have a look at
 membase which will also store less frequently used data to disk. The
 membase protocol is compatible with memcache, so you can use either
 memcache or membase with the same mapcache configuration.

 Of course, by running a script every hour to delete expired tiles as
 you are doing now, you can then use the classic disk based cache
 backend.
 regards,
 thomas
 On Sun, Dec 4, 2011 at 20:13, forums for...@craniumjuice.com wrote:
  Hi:
 
  I hope this is the proper place to ask questions about Mapcache since
 it's
  been moved into the trunk of Mapserver.
 
  I'm wondering if Mapcache can help with a particular setup, and if so
 maybe
  some advice or direction on where to start?
 
  Here's the setup.  Every 5 minutes a new set of GeoTiffs are created in
 a
  new directory.  I create a tileindex for the GeoTiffs and use those in
 the
  map layer.  Every hour, anything more than 5hours old gets deleted.
  I have a single mapfile setup.
 
  The general layer is setup like:
 
  LAYER
  NAME 'IMG1'
  METADATA
  'wms_title'   'IMG 1'
  'wms_srs' 'EPSG:4326'
  'wms_extent'  'MINX MINY MAXX MAXY'
  'default_targetdate' ''
  'targetdate_validation_pattern' '^[0-9]{12}$'
  END
  STATUS ON
  TILEINDEX '/PATH/TO/IMG/DIR/%targetdate%/TILEINDEX.shp'
  TILEITEM 'Location'
  TYPE RASTER
  END
 
 
  I'm currently loading these images as overlays for Googlemaps. using the
  mode=tiletilemode=gmaps...targetdate=2011...etc.
  Problem is it's too slow. I end up loading hundreds of images, as I
  basically create an animation using sequential times.
 
  I'd like to be able to have a single mapcache config file, that will
 pass
  the date through to pull the proper shapefile, and have the result
 cached so
  next time it's loading off the disk.  MOST of the images end up being
  blank/transparent tiles.
 
  Is Mapcache a good choice for this?
  The front end for this is just a simple GoogleMaps viewport, but ends up
  loading multiple timeslots for display.  It generates the request URL
 (not
  currently in WMS fashion but could be).
 
  Thanks for any help I can get.
 
  Jerl
 
 
 
  ___
  mapserver-users mailing list
  mapserver-users@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/mapserver-users
 




 --
 A computer without Windows is like chocolate cake without mustard.




-- 
A computer without Windows is like chocolate cake without mustard.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Post body is short

2011-12-04 Thread Hawk AA
Hi there,

 

We are running a service where the access to mapfiles needs to be password
protected. I’m using PHP Session for that, and until recently I’ve used a
wrapper which looked like this:

 

session_start();

$oParams = new HawkSoftware\URL\REQUESTParameters();

try {

$oParams-RemoveKey(MAP, false);



  } catch (Exception $e) {



  }

  $oParams-Items['map'] = $_SESSION['MAPFILE'];

 

$strURL = C:/ms4w/Apache/cgi-bin-hidden/mapserv.exe QUERY_STRING=\ .
$oParams-GetUTF8DecodedString() . \;

 

if ($oParams-Items['encode'] == 'true') {

  echo utf8_encode(HawkSoftware\Execution\Util::GetOutput($strURL));

} else {

  echo HawkSoftware\Execution\Util::GetOutput($strURL);

}

 

The GetOutput-function uses passthru(). The only problem with that one is
the command line restriction (of somewhat 8k characters) in windows, which
sometimes becomes a limitation for requesting over 70 ID’s on a WFS request
(those Filter strings become very long!!). Also, I don’t think it’s the most
efficient way to fetch data from mapserv.exe .

 

So I saw the http://mapserver.org/ogc/mapscript.html and made a script like
this:

 

$oMap = new \mapObj($_SESSION['MAPFILE']);

  $oRequest = new OWSRequestObj();

  $oRequest-loadparams();

  ms_ioinstallstdouttobuffer();

  $oMap-owsdispatch($oRequest);

  

  $strContType = ms_iostripstdoutbuffercontenttype();

  if ($strContType == 'image/png') {

header('Content-type: image/png');

  }

  

  if($_REQUEST['encode']) {

echo utf8_encode(ms_iogetstdoutbufferstring());

  } else {

ms_iogetStdoutBufferBytes();

  }

  ms_ioresethandlers();

 

This one works great on GET requests. However, it does not work on POST
requests, it will print “Post body is short” (I really need the post
requests, as GET does not carry enough data). This is a known issue, but I
can’t say I know what to do about it. Some say it’s problem with the fastcgi
module, and it will run fine on cgi. But how do I get mapscript to run on
CGI? Or is this the wrong approach?

 

I am running ms4w on Windows Server 2008 .

 

Best regards,

Håkon

 

 

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapcache question.

2011-12-04 Thread Stephen Woodbridge

Jerl,

http://mapserver.org/cgi/runsub.html

Sounds like you do not have a validation_pattern for the data parameter.

-Steve W

On 12/4/2011 4:23 PM, forums wrote:

I almost have it, I just can't seem to get the targetdate dimension to
populate.

/mapcache/gmaps/country@WGS84/1/1/0.png works fine if I don't have the
layers that require the targetdate parameter.  I get a parameter
pattern failed validation error returned from Mapserver when I have the
necessary layers defined in the mapcache config file.

The obvious thing for me to try was:
/mapcache/gmaps/country@WGS84/1/1/0.png?targetdate=201112042105

But that failed.  Is there a way to get the targetdate to fill in? I've
moved it around a bit, but still can't get it to fill in.

Thanks again!!

Jerl


On Sun, Dec 4, 2011 at 2:59 PM, forums for...@craniumjuice.com
mailto:for...@craniumjuice.com wrote:

Thanks Stephen and Thomas.

I think I'll be good with the dimension and the disk cache.
  Unfortunately, the apache we have doesn't have memcache built into
it (too much hassle to upgrade it right now) and the version of
SQLite is too old...also a hassle to upgrade.

I was able to get it to load the proper map when just using the
entire bounding box, the whole world.  Now to make it work with the
the tilemode for google...which looks like that should be straight
forward??


Thanks guys!!

Jerl


On Sun, Dec 4, 2011 at 2:00 PM, thomas bonfort
thomas.bonf...@gmail.com mailto:thomas.bonf...@gmail.com wrote:

Jerl,
mapcache itself does not do any pruning of the caches it has
created,
but you can get the same effect by using a cache backend that
supports
expiration (i.e. memcache).
Mapcache can fit your need, provided:
- you configure your tileset with a targetdate dimension-
you use
a memcache backend to store the created tiles, and set an expires
value in mapcache to 5 hours
If the memory requirement for storing 5 hours worth of tiles is too
important for a memcache server instance, you can have a look at
membase which will also store less frequently used data to disk. The
membase protocol is compatible with memcache, so you can use either
memcache or membase with the same mapcache configuration.

Of course, by running a script every hour to delete expired tiles as
you are doing now, you can then use the classic disk based cache
backend.
regards,
thomas
On Sun, Dec 4, 2011 at 20:13, forums for...@craniumjuice.com
mailto:for...@craniumjuice.com wrote:
  Hi:
 
  I hope this is the proper place to ask questions about
Mapcache since it's
  been moved into the trunk of Mapserver.
 
  I'm wondering if Mapcache can help with a particular setup,
and if so maybe
  some advice or direction on where to start?
 
  Here's the setup.  Every 5 minutes a new set of GeoTiffs are
created in a
  new directory.  I create a tileindex for the GeoTiffs and use
those in the
  map layer.  Every hour, anything more than 5hours old gets
deleted.
  I have a single mapfile setup.
 
  The general layer is setup like:
 
  LAYER
  NAME 'IMG1'
  METADATA
  'wms_title' 'IMG 1'
  'wms_srs' 'EPSG:4326'
  'wms_extent' 'MINX MINY MAXX MAXY'
  'default_targetdate' ''
  'targetdate_validation_pattern' '^[0-9]{12}$'
  END
  STATUS ON
  TILEINDEX '/PATH/TO/IMG/DIR/%targetdate%/TILEINDEX.shp'
  TILEITEM 'Location'
  TYPE RASTER
  END
 
 
  I'm currently loading these images as overlays for
Googlemaps. using the
  mode=tiletilemode=gmaps...targetdate=2011...etc.
  Problem is it's too slow. I end up loading hundreds of
images, as I
  basically create an animation using sequential times.
 
  I'd like to be able to have a single mapcache config file,
that will pass
  the date through to pull the proper shapefile, and have the
result cached so
  next time it's loading off the disk.  MOST of the images end
up being
  blank/transparent tiles.
 
  Is Mapcache a good choice for this?
  The front end for this is just a simple GoogleMaps viewport,
but ends up
  loading multiple timeslots for display.  It generates the
request URL (not
  currently in WMS fashion but could be).
 
  Thanks for any help I can get.
 
  Jerl
 
 
 
  ___
  mapserver-users 

Re: [mapserver-users] Mapcache question.

2011-12-04 Thread thomas bonfort
only the wms and wmts services support dimensions (there is no spec
defining this support for the others).

you can either adapt your gmaps/js code to build a wmts url, or hack
into the mapcache code to add dimension support to the tms / gmaps
service.

--
thomas

On Sun, Dec 4, 2011 at 22:23, forums for...@craniumjuice.com wrote:
 I almost have it, I just can't seem to get the targetdate dimension to
 populate.

 /mapcache/gmaps/country@WGS84/1/1/0.png works fine if I don't have the
 layers that require the targetdate parameter.  I get a parameter pattern
 failed validation error returned from Mapserver when I have the necessary
 layers defined in the mapcache config file.

 The obvious thing for me to try was:
 /mapcache/gmaps/country@WGS84/1/1/0.png?targetdate=201112042105

 But that failed.  Is there a way to get the targetdate to fill in? I've
 moved it around a bit, but still can't get it to fill in.

 Thanks again!!

 Jerl


 On Sun, Dec 4, 2011 at 2:59 PM, forums for...@craniumjuice.com wrote:

 Thanks Stephen and Thomas.

 I think I'll be good with the dimension and the disk cache.
  Unfortunately, the apache we have doesn't have memcache built into it (too
 much hassle to upgrade it right now) and the version of SQLite is too
 old...also a hassle to upgrade.

 I was able to get it to load the proper map when just using the entire
 bounding box, the whole world.  Now to make it work with the the tilemode
 for google...which looks like that should be straight forward??


 Thanks guys!!

 Jerl


 On Sun, Dec 4, 2011 at 2:00 PM, thomas bonfort thomas.bonf...@gmail.com
 wrote:

 Jerl,
 mapcache itself does not do any pruning of the caches it has created,
 but you can get the same effect by using a cache backend that supports
 expiration (i.e. memcache).
 Mapcache can fit your need, provided:
 - you configure your tileset with a targetdate dimension- you use
 a memcache backend to store the created tiles, and set an expires
 value in mapcache to 5 hours
 If the memory requirement for storing 5 hours worth of tiles is too
 important for a memcache server instance, you can have a look at
 membase which will also store less frequently used data to disk. The
 membase protocol is compatible with memcache, so you can use either
 memcache or membase with the same mapcache configuration.

 Of course, by running a script every hour to delete expired tiles as
 you are doing now, you can then use the classic disk based cache
 backend.
 regards,
 thomas
 On Sun, Dec 4, 2011 at 20:13, forums for...@craniumjuice.com wrote:
  Hi:
 
  I hope this is the proper place to ask questions about Mapcache since
  it's
  been moved into the trunk of Mapserver.
 
  I'm wondering if Mapcache can help with a particular setup, and if so
  maybe
  some advice or direction on where to start?
 
  Here's the setup.  Every 5 minutes a new set of GeoTiffs are created in
  a
  new directory.  I create a tileindex for the GeoTiffs and use those in
  the
  map layer.  Every hour, anything more than 5hours old gets deleted.
  I have a single mapfile setup.
 
  The general layer is setup like:
 
      LAYER
          NAME 'IMG1'
          METADATA
              'wms_title'           'IMG 1'
              'wms_srs'             'EPSG:4326'
              'wms_extent'          'MINX MINY MAXX MAXY'
              'default_targetdate' ''
              'targetdate_validation_pattern' '^[0-9]{12}$'
          END
          STATUS ON
          TILEINDEX '/PATH/TO/IMG/DIR/%targetdate%/TILEINDEX.shp'
          TILEITEM 'Location'
          TYPE RASTER
      END
 
 
  I'm currently loading these images as overlays for Googlemaps. using
  the
  mode=tiletilemode=gmaps...targetdate=2011...etc.
  Problem is it's too slow. I end up loading hundreds of images, as I
  basically create an animation using sequential times.
 
  I'd like to be able to have a single mapcache config file, that will
  pass
  the date through to pull the proper shapefile, and have the result
  cached so
  next time it's loading off the disk.  MOST of the images end up being
  blank/transparent tiles.
 
  Is Mapcache a good choice for this?
  The front end for this is just a simple GoogleMaps viewport, but ends
  up
  loading multiple timeslots for display.  It generates the request URL
  (not
  currently in WMS fashion but could be).
 
  Thanks for any help I can get.
 
  Jerl
 
 
 
  ___
  mapserver-users mailing list
  mapserver-users@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/mapserver-users
 




 --
 A computer without Windows is like chocolate cake without mustard.




 --
 A computer without Windows is like chocolate cake without mustard.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users