Re: [mapserver-users] MapCahe question -- Caching the first coupleofzoom levels

2013-11-25 Thread Armin Burger
on Unix systems I would use as workaround for this a cron job, e.g. 
running a script every 5 minutes and having something like


find /path/to/zoom/level -name "*.png" -mmin +5 -exec rm {} \;

which deletes all PNG files older than 5 minutes

armin

On 11/25/2013 03:31 PM, James_in_Utah wrote:

That's very helpful.  Somehow that option was left out of:
http://www.mapserver.org/trunk/mapcache/seed.html


Thanks,
James




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/MapCahe-question-Caching-the-first-couple-of-zoom-levels-tp5090882p5091028.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
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 and the GoogleCRS84Quad TileMatrixSet

2013-04-10 Thread Armin Burger

Thomas

thanks for the clarifications.

I tried to define a grid that could fit those OGS specs with the 
following parameters:


 
  
 OGCCRS84Quad 
urn:ogc:def:wkss:OGC:1.0:OGCCRS84Quad

  
  -180 -180 180 180
  EPSG:4326
  dd
  256 256
  1.406250 0.7031250 0.3515625 
0.17578125000 8.7890625000e-2 4.394531
2500e-2 2.1972656250e-2 1.0986328125e-2 5.4931640625e-3 
2.74658203125000e-3 1.37329101562500e-3 6.8664
5507812500e-4 3.43322753906250e-4 1.71661376953125e-4 
8.58306884765625e-5 4.29153442382812e-5 2.14576721191406e-5 1.07

288360595703e-5 5.36441802978516e-6
   

For me the capability output looks correct, and the tile level 0 is the 
whole world in 1 single tile, with upper and lower quarter left blank. I 
guess that's what the specs want it to be and so it should be possible 
to satisfy this strange definition if required.



I guess that the MapCache definition of the "GoogleCRS84Quad" 
corresponds to what the European INSPIRE initiative defines as 
"InspireCRS84Quad" in the document


http://inspire.jrc.ec.europa.eu/documents/Network_Services/TechnicalGuidance_ViewServices_v3.1.pdf

It states:
"The level 0 of InspireCRS84Quad is the level 1 of GoogleCRS84Quad. This 
level has been discarded because Level 0 of GoogleCRS84Quad allows 
representing the whole world in a single 256x256 pixels where the first 
64 and last 64 lines of the tile are left blank. To avoid this situation 
the level 0 of InspireCRS84Quad is composed of two tiles representing 
exactly the whole world."


They do not add the full XML description, however.

Best regards
Armin


On 04/10/2013 05:50 PM, thomas bonfort wrote:

Armin,
I don't have much to add to what you have already found out. I
personally consider the GoogleCRS84Quad grid as defined by the spec to
be broken, and have not implemented its support as it would require some
specific hacks in the code (as the extent for level 0 needs to be
hardcoded for this specific grid, instead of it being derived from grid
properties as is the case with all other grid definitions).

I suppose that support for this could be added if you really need it
badly. The impact is not negligible as all places where an extent is
derived from a tile coordinate and vice-versa would need to be updated
to support this illogical quirk.

FWIW, I believe I had brought this up as a change request to the wmts
working group, but this was ignored as I am not a member.

best regards,

thomas


On 9 April 2013 20:57, Armin Burger mailto:armin.bur...@gmx.net>> wrote:

Dear all

I have a question regarding the GoogleCRS84Quad TileMatrixSet
defined in MapCache. MapCache specifies this in the docs with the
first level [0] as pixel resolution 0.70312500 deg, and an extent of
   -180 -90 180 90

and returns the GoogleCRS84Quad TileMatrixSet in the Capabilities
response like


   WGS84
   GoogleCRS84Quad
   urn:ogc:def:crs:__EPSG:6.3:4326
   
 -180.00 -90.00
 180.00 90.00
   


urn:ogc:__def:wkss:OGC:1.0:__GoogleCRS84Quad
   
 0

279541132.__01435887813568115234
 90.00 -180.00
 256
 256
 2
 1
   
   .


This looks clear and logical, but the OGC specs at
http://portal.opengeospatial.__org/files/?artifact_id=35326
<http://portal.opengeospatial.org/files/?artifact_id=35326>
define this TileMatrixSet differently as

"E.3 GoogleCRS84Quad (urn:ogc:def:wkss:OGC:1.0:__GoogleCRS84Quad)
This well-known scale set has been defined to allow quadtree
pyramids in CRS84. Level 0 allows representing the whole world in a
single 256x256 pixels (where the first 64 and last 64 lines of the
tile are left blank). The next level represents the whole world in 2x2
tiles of 256x256 pixels and so on in powers of 2. Scale denominator
is only accurate near the equator."

The level 0 in the OGC specs uses a resolution of 1.40625000.

The tile 0/0/0 in MapCache is not a single tile as in the OGC specs
but the first out of 2 tiles for this level, correctly defined with
MatrixWidth 2 and MatrixHeight 1 (level 1 has 4x2 tiles). For me the
OGC specs are not logical, because the TopLeft corner would
correspond to 180 -180 degrees which makes no sense for me, but
somehow they are regarded as the default specs...

So the XML definition of the OGC specs should probably result in
something like

   
 0
 559082264.__0287178
 180.00 -180.00
 256
 256
 1
 1
   

Unfortunately the OGC doc does not provide this matrix set's full
definition in XML to check this.


So I'm wondering which is the correct definition? A

[mapserver-users] MapCache and the GoogleCRS84Quad TileMatrixSet

2013-04-09 Thread Armin Burger

Dear all

I have a question regarding the GoogleCRS84Quad TileMatrixSet defined in 
MapCache. MapCache specifies this in the docs with the first level [0] 
as pixel resolution 0.70312500 deg, and an extent of

  -180 -90 180 90

and returns the GoogleCRS84Quad TileMatrixSet in the Capabilities 
response like



  WGS84
  GoogleCRS84Quad
  urn:ogc:def:crs:EPSG:6.3:4326
  
-180.00 -90.00
180.00 90.00
  

urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad
  
0
279541132.01435887813568115234
90.00 -180.00
256
256
2
1
  
  .


This looks clear and logical, but the OGC specs at
  http://portal.opengeospatial.org/files/?artifact_id=35326
define this TileMatrixSet differently as

"E.3 GoogleCRS84Quad (urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad)
This well-known scale set has been defined to allow quadtree pyramids in 
CRS84. Level 0 allows representing the whole world in a single 256x256 
pixels (where the first 64 and last 64 lines of the tile are left 
blank). The next level represents the whole world in 2x2
tiles of 256x256 pixels and so on in powers of 2. Scale denominator is 
only accurate near the equator."


The level 0 in the OGC specs uses a resolution of 1.40625000.

The tile 0/0/0 in MapCache is not a single tile as in the OGC specs but 
the first out of 2 tiles for this level, correctly defined with 
MatrixWidth 2 and MatrixHeight 1 (level 1 has 4x2 tiles). For me the OGC 
specs are not logical, because the TopLeft corner would correspond to 
180 -180 degrees which makes no sense for me, but somehow they are 
regarded as the default specs...


So the XML definition of the OGC specs should probably result in 
something like


  
0
559082264.0287178
180.00 -180.00
256
256
1
1
  

Unfortunately the OGC doc does not provide this matrix set's full 
definition in XML to check this.



So I'm wondering which is the correct definition? And any idea how to 
deal with this discrepancy?


Thanks
Armin






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


Re: [mapserver-users] PHP-Mapscript and PHP Apache DSO - any progress?

2012-11-20 Thread Armin Burger

William

I cannot say anything for Mac OS in this respect. But at least for Linux 
running Apache in the classical pre-fork MPM I did not experience 
problems with PHP-MapScript running as an Apache DSO. Also some stress 
tests with benchmarking using multiple WMS requests with on MapScript 
OWS as server backend did not cause problems.


I sometimes noticed some irregular, strange, and difficult to reproduce 
problems with MS 6.0 and PHP Mapscript (Apache or CGI segfaults), but 
that was independent of PHP with Apache DSO or as CGI, and this never 
ever happened with MS 5.x.


armin



On 15/11/2012 04:52, William Kyngesburye wrote:

It's my understanding that when running PHP-Mapscript with PHP as an Apache 
DSO, under heavy loads it can randomly hiccup/trip/crash or otherwise not 
perform correctly.  So I've been maintaining an OS X PHP-CGI package to go 
along with my MapServer package.

Is this still a problem?  Maybe I missed a fix for this?  Or is it being worked 
on (or not being worked on)?  Or is it an unsolvable problem (maybe due to the 
nature of a DSO)?

I'm thinking about simplifying my OS X GIS/carto stack and dropping my PHP-CGI 
package in favor of the OS X system PHP-DSO (a bit old) or some other 
better-maintained PHP package for OS X (which will likely be a DSO).

-
William Kyngesburye 
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect


___
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] MapServer 6.0.1 ignoring WMS options?

2012-03-05 Thread Armin Burger

David

According to the WMS specs, BBOX parameters for getMap requests are 
comma-separated, you are using spaces only (url-encoded as %20). I would 
expect MS to return an exception instead of ignoring this.


armin

On 05/03/2012 21:20, David Miller wrote:

Hi list!

We have MapServer 6.0.1 installed on our Linux system (CentOS 5.7) and
have encountered an issue where the WMS options (i.e. BBOX, HEIGHT,
WIDTH) seem to be ignored for a GetMap request.  I have checked options
for and output from running the configure script for building the
executable.  The --with-proj and --with-wms options are specified
(though one shouldn't need it if --with-proj is there correctly).
Output from running the configure script indicates that the-DUSE_WMS_SVR
compiler switch was on when compiling the mapwms.c code, which is where
that becomes important.  I examined that code and it's here that
MapServer first uses the extents in the mapfile as defaults but then
adjusts that based on the BBOX, HEIGHT, and WIDTH options in the GetMap
request.  Running -v on the resulting executable also indicates
SUPPORTS=WMS_SERVER.

The call to MapServer does produce an image but for the entire EXTENT of
the data that's specified in the mapfile.  Doesn't make any difference
whether it's a raster or point layer.

Example REQUEST:

http://(our main site
address)/cgi-bin/mapserv?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&FORMAT=image%2Fpng&MODE=map&MAP=wxmap%2Fglmpvis.map&LAYERS=mosaic&SRS=EPSG%3A3857&TRANSPARENT=TRUE&STYLES=&BBOX=-13807095.590531%203308267.5857033%20-12241665.251469%204482340.341&WIDTH=640&HEIGHT=480

First part of the mapfile:

MAP
NAME "testgrib"
IMAGETYPE PNG
EXTENT   -1400 300 -700 700

As you can see, the EXTENT in the mapfile are different than the BBOX
values.  When I put the BBOX values in the EXTENT area in the mapfile,
the image lines up with the map background as it should.

So for some reason, it appears that something isn't being set correctly
to allow our MapServer to accept standard WMS options.  Perhaps somehow,
this value of USE_WMS_SVR in mapwms.c isn't getting set correctly?  But,
by all the output we've checked, it looks like MapServer gets built
correctly and to enable it as a WMS server.

Anyone else with a similar issue or somewhere else we should check for a
problem?

Thanks for any help!

Dave M


___
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] RE: WMS for netcdf [SEC=UNCLASSIFIED]

2012-03-05 Thread Armin Burger
Hello everybody

there is a quite flexible and easy to use solution to achieve all these 
requirements with additional (non-standard) request parameters: using MapScript 
bindings for OWS/WxS requests (see e.g. 
http://mapserver.org/ogc/mapscript.html).

I use both PHP and Python bindings and everything works very well. If PHP or 
Python are used via an Apache module I also could not measure real differences 
regarding speed of the responses (max 5% slower than mapserv CGI/FCGI, if at 
all).

A standard WxS handling script has roughly 10-15 lines of code. The great 
advantage is that between handling the request parameters and returning the 
response to the client you have any conceivable possibilities to modify the map 
or layers via MapScript. This can take into account any key-value pairs from 
the request, and you can handle more complicated logic than with pure variable 
substitution. 

If there is interest I can provide some more code samples, could also be via 
the MapServer wiki.

Regards
Armin

 

 Original-Nachricht 
> Datum: Mon, 5 Mar 2012 08:07:11 +
> Von: Rahkonen Jukka 
> An: \'teknocreator\' , 
> "\'mapserver-users@lists.osgeo.org\'" 
> Betreff: Re: [mapserver-users] RE: WMS for netcdf [SEC=UNCLASSIFIED]

> Hi,
> 
> It would be nice to be able to change some processing directives through
> variable substitution. Multichannel satellite images are one obvious use
> case. I have predefined a few most common settings for 7-channel Landsat
> images as separate mapfiles but it would more convenient and flexible to let
> users select the BANDS, SCALE and LUT they want. It would be useful also when
> some other settings would suit better for printing than those adjusted for
> on-screen use.
> 
> Would others find it reasonable to add PROCESSING to the items which
> support variable substitution?
> 
> -Jukka Rahkonen-
> 
> teknocreator wrote:
> 
> Kathleen,
> 
> I've searched through the lists and on the web for an answer to your issue
> as I have it too only with GRIB data.  The MapServer docs seem to indicate
> that variable substitution won't work for the PROCESSING directive.
> Therefore I tried several variations "Changing map file parameters via a
> form or a URL".  What should've worked here considering that part of the
> documentation is to add this to the GetMap request string:
> 
> map[layer].processing[0]="BANDS=01"
> 
> because it was the first PROCESSING directive for my layer and it needs a
> string for the directive.  But, I received an msloadLayer error.  I tried
> a
> few variations but all ended up with the same error.  I've seen folks have
> a
> similar issue with this in the MS Users list with no solution at present.
> 
> While what Puneet wrote may be a solution for you and possibly our GRIB
> data
> as well, it seems like a much more complicated way just to get at a
> particular band in the file.  I do see why this has been done as NetCDF
> does
> come in many flavors and there's the possibility of 4 dimensions in the
> file.  There are many links on using WCS with NetCDF, a good number coming
> from UCAR.
> 
> Still, this looks like a possible code problem where the ability to change
> map file parameter via a URL does not work in this case or else the
> ability
> to change BANDS needs to be added to variable substitution.
> 
> Hopefully, someone from MapServer can help here.  Looks like I'm going to
> be
> investigating WCS, though.  I'll definitely be checking back on this one.
> 
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/WMS-for-netcdf-SEC-UNCLASSIFIED-tp4519496p4545262.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> ___
> 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
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!  

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] WFS version and axis order

2012-03-01 Thread Armin Burger


On 01/03/2012 18:34, Rahkonen Jukka wrote:

Hi,

Unfortunately axis order in WFS 1.1.0 (or in GML3) is complicated.



I need a second option so I can respond to a customer regarding their concerns of 
using our>  WFS services.  Their concern is mainly confidence and the ability of 
moving forward.  As you>  know in the WFS version 1.1 the axis order switched.


Too genaralised to say so. There are systems which have officially 
easting-northing axis order, like WGS84 UTM zones, and for them WFS 1.0.0 and 
1.1.0 must behave similarly.


just in case anybody needs a list of EPSG codes with the swapped axis 
orders: the Mapserver source code has a file named 'mapaxisorder.csv' 
with all codes that are supposed to have x/y axes inverted. I guess this 
is the same for WMS 1.3.0 and WFS 1.1.0


You can directly get the single file via
http://trac.osgeo.org/mapserver/export/13191/trunk/mapserver/mapaxisorder.csv

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


Re: [mapserver-users] PHP-Mapscript, Posgresql, Postgis, dynamic query without a map file

2012-01-15 Thread Armin Burger
I think setting the layer template to an *empty* string does not make 
the layer queryable. Set it to whatever non-empty string and try again, like


$layer->set("template", "pippo");

PHP MapScript (or maybe PHP in general) seems to treat empty strings 
typically equivalent to null or false.


armin


On 05/01/2012 10:26, Andrea D' Aversa wrote:

Hi,
I'm creatingan applicationin php language.
I'm usingPHP-MapScript,PostGISforqueryfor aqueryByPointthat Imustreturn
informationformattedtext/html butthe query resultis 0.
Thisis the code:

extent->minx;
 $miny = $map->extent->miny;
 $maxx = $map->extent->maxx;
 $maxy = $map->extent->maxy;

 $dx = $maxx - $minx;
 $dy = $maxy - $miny;

 $width = $map->width;
 $height = $map->height;

 $dxpp = (double)$dx/$width;
 $dypp = (double)$dy/$height;

 $geox = $minx + $dxpp*$x;
 $geoy = $maxy - $dypp*$y;

 $pointObj = ms_newPointObj();
 $pointObj->setXY($geox,$geoy);

 return $pointObj;
}
function FindPoint($point,$map,$radius, $layerName) {
 $qlayer = $map->getLayerByName($layerName);
 $check=$qlayer->queryByPoint($point, MS_MULTIPLE, $radius);
 $image=$map->drawQuery();
 if($check == MS_FAILURE){
 echo "There were no results";
 }else {
 $qlayer->open();
 $numResults = $qlayer->getNumResults();
 echo "Result Query= ".$numResults."";
 if ($numResults != 0) {
 for ($i = 0; $i < $numResults; $i++) {
 $query_result = $qlayer->getResult($i);
 $shape = $qlayer->getShape($query_result->tileindex,
$query_result->shapeindex);
 $Lista_ele[]=$shape->values;
 }
 } else {
 $valido =0;
 $Lista_ele = "";
 }
 $qlayer->close();
 return $Lista_ele;
 }
} // end FindPoint

$mapfile_image_width=$_GET["WIDTH"];
$mapfile_image_height=$_GET["HEIGHT"];
$folderCache=$_GET["idf"];
$layerName=$_GET["layer"];
$SRID=$_GET["SRS"];

$x=$_GET["X"];
$y=$_GET["Y"];
$BBOX=explode(",",$_GET["BBOX"]);
$ms_imagepath=DIR_FOLDER;
$ms_imageurl=URL_FOLDER;

$map = ms_newMapObj('');

$map->outputformat->set('driver','imagemap');
$map->outputformat->set('mimetype','text/html; driver=imagemap');

$map->set('width',$mapfile_image_width);
$map->set('height',$mapfile_image_height);
$map->web->set('imagepath',$ms_imagepath);
$map->web->set('imageurl',$ms_imageurl);

$latlongProj = ms_newProjectionObj("EPSG:".$SRID);
$utmProj = ms_newProjectionObj("EPSG:900913");
$poPoint = ms_newpointobj();
$poPoint->setXY($BBOX[0], $BBOX[1]);
$poPoint->project($utmProj, $latlongProj);
$xmin=$poPoint->x;
$ymin=$poPoint->y;
$poPoint = ms_newpointobj();
$poPoint->setXY($BBOX[2], $BBOX[3]);
$poPoint->project($utmProj, $latlongProj);
$xmax=$poPoint->x;
$ymax=$poPoint->y;
$map->setextent($xmin, $ymin, $xmax, $ymax);

echo "BBOX = ".$xmin.", ".$ymin.", ".$xmax.", ".$ymax."";

// Add the only one layer.
$layer = ms_newLayerObj($map);
$layer->setConnectionType(MS_POSTGIS);
$layer->set('name',$layerName);
$layer->set('type',MS_LAYER_POLYGON);
$layer->set('status', MS_ON);
$layer->set('connection', "host=xxx port=xxx dbname=xxx user=xxx
password=xxx");
$layer->set('data','the_geom from (select * from '.$layerName.') as foo
using unique gid using SRID='.$SRID);
$layer->set("template", "");
$layer->set("dump", "true");

// Add some colors.
$class = ms_newClassObj($layer);
$style = ms_newStyleObj($class);
$style->color->setRGB(0, 255, 255);
$style->outlinecolor->setRGB(255, 255, 0);

$image = $map->draw();
$map->preparequery();
$point = ms_newpointobj();
$point->setXY($x,$y);
$geo_point = pixelToGeo($map,$point->x,$point->y);

echo "POINT TO CLICK = ".$geo_point->x. " , ".$geo_point->y;

print_r( FindPoint($geo_point,$map,-1, $layerName));
?>
My result is:
BBOX = 2395177.6101675, 4571367.7734744, 2612958.1665649, 4679392.0513538
POINT TO CLICK = 2470361.0341494 , 4612710.2888501
There were no results


What's wrong?
Allthe examplesIfound onlineusinga mapfile,but Idon't have amap file.

Thanks
_
*Andrea D'Aversa*


___
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 compilation error; ld cannot find libraries

2012-01-02 Thread Armin Burger

thanks again Thomas,

with this setting for the apsx2 it compiled and installed fine.

Armin

On 02/01/2012 15:18, thomas bonfort wrote:

hmm, the apxs2 command does seem to need the -Wl flag passed to it

--
thomas

On Mon, Jan 2, 2012 at 14:41, Armin Burger  wrote:

Thomas

thanks a lot for the quick help.

OS is Ubuntu 10.04 64bit, libtool version is 2.2.6b.

I made the changes as you suggested and compilation continued. But then
another error appeared:

/usr/bin/apxs2 -Wc," -DUSE_MEMCACHE -DUSE_PCRE -DUSE_OGR -DUSE_GEOS
-DUSE_SQLITE -DUSE_PIXMAN-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread
-O2 -Wall -fPIC -DHAVE_SYMLINK -DNDEBUG  -I../include -I/usr/include/apr-1.0
  -I/usr/include/apr-1.0 -I/usr/include/pixman-1  " -lcurl -lpng -ljpeg
/usr/lib/libapr-1.la /usr/lib/libaprutil-1.la -lpcre -lsqlite3 -lpixman-1
-c mod_mapcache.c libmapcache.la
Usage: apxs -g [-S=] -n
   apxs -q [-S=]  ...
   apxs -c [-S=] [-o] [-D[=]]
   [-I] [-L] [-l] [-Wc,]
   [-Wl,] [-p]  ...
   apxs -i [-S=] [-a] [-A] [-n]  ...
   apxs -e [-S=] [-a] [-A] [-n]  ...
make[1]: *** [mod_mapcache.o] Error 1


Armin




On 02/01/2012 14:22, thomas bonfort wrote:


There have been some extensive changes in the build process over the
holidays. Please try editing src/Makefile, and replace the two
occurences of -Wl,"$(LIBS)" by $(LIBS).

If that fixes it, can you post the output of
/usr/share/apr-1.0/build/libtool --version, and your OS distribution
and version

--
thomas






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


Re: [mapserver-users] MapCache compilation error; ld cannot find libraries

2012-01-02 Thread Armin Burger

Thomas

thanks a lot for the quick help.

OS is Ubuntu 10.04 64bit, libtool version is 2.2.6b.

I made the changes as you suggested and compilation continued. But then 
another error appeared:


/usr/bin/apxs2 -Wc," -DUSE_MEMCACHE -DUSE_PCRE -DUSE_OGR -DUSE_GEOS 
-DUSE_SQLITE -DUSE_PIXMAN-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE 
-pthread -O2 -Wall -fPIC -DHAVE_SYMLINK -DNDEBUG  -I../include 
-I/usr/include/apr-1.0  -I/usr/include/apr-1.0 
-I/usr/include/pixman-1  " -lcurl -lpng -ljpeg /usr/lib/libapr-1.la 
/usr/lib/libaprutil-1.la -lpcre -lsqlite3 -lpixman-1  -c 
mod_mapcache.c libmapcache.la

Usage: apxs -g [-S =] -n 
   apxs -q [-S =]  ...
   apxs -c [-S =] [-o ] [-D [=]]
   [-I ] [-L ] [-l ] [-Wc,]
   [-Wl,] [-p]  ...
   apxs -i [-S =] [-a] [-A] [-n ]  ...
   apxs -e [-S =] [-a] [-A] [-n ]  ...
make[1]: *** [mod_mapcache.o] Error 1


Armin



On 02/01/2012 14:22, thomas bonfort wrote:

There have been some extensive changes in the build process over the
holidays. Please try editing src/Makefile, and replace the two
occurences of -Wl,"$(LIBS)" by $(LIBS).

If that fixes it, can you post the output of
/usr/share/apr-1.0/build/libtool --version, and your OS distribution
and version

--
thomas


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


[mapserver-users] MapCache compilation error; ld cannot find libraries

2012-01-02 Thread Armin Burger

Hi all

I tried to compile MapCache from Mapserver trunk and get the error

/usr/share/apr-1.0/build/libtool --mode=link --tag CC gcc -rpath 
/usr/local/lib ./lock.lo ./service_ve.lo ./source.lo ./tileset.lo 
./core.lo ./image.lo ./imageio_jpeg.lo ./http.lo ./imageio_png.lo 
./service_wms.lo ./grid.lo ./source_mapserver.lo ./service_wmts.lo 
./ezxml.lo ./cache_memcache.lo ./configuration.lo ./source_gdal.lo 
./dimension.lo ./service_kml.lo ./cache_disk.lo ./imageio.lo ./util.lo 
./services.lo ./axisorder.lo ./service_tms.lo ./strptime.lo 
./service_demo.lo ./configuration_xml.lo ./source_wms.lo ./cache_tiff.lo 
./cache_sqlite.lo ./image_error.lo ./buffer.lo ./imageio_mixed.lo 
-Wl,"-lcurl -lpng -ljpeg /usr/lib/libapr-1.la /usr/lib/libaprutil-1.la 
-lpcre -lsqlite3 -lpixman-1 "  -o libmapcache.la
libtool: link: x86_64-linux-gnu-gcc -shared  ./.libs/lock.o 
./.libs/service_ve.o ./.libs/source.o ./.libs/tileset.o ./.libs/core.o 
./.libs/image.o ./.libs/imageio_jpeg.o ./.libs/http.o 
./.libs/imageio_png.o ./.libs/service_wms.o ./.libs/grid.o 
./.libs/source_mapserver.o ./.libs/service_wmts.o ./.libs/ezxml.o 
./.libs/cache_memcache.o ./.libs/configuration.o ./.libs/source_gdal.o 
./.libs/dimension.o ./.libs/service_kml.o ./.libs/cache_disk.o 
./.libs/imageio.o ./.libs/util.o ./.libs/services.o ./.libs/axisorder.o 
./.libs/service_tms.o ./.libs/strptime.o ./.libs/service_demo.o 
./.libs/configuration_xml.o ./.libs/source_wms.o ./.libs/cache_tiff.o 
./.libs/cache_sqlite.o ./.libs/image_error.o ./.libs/buffer.o 
./.libs/imageio_mixed.o-Wl,"-lcurl -lpng -ljpeg /usr/lib/libapr-1.la 
/usr/lib/libaprutil-1.la -lpcre -lsqlite3 -lpixman-1 "   -Wl,-soname 
-Wl,libmapcache.so.0 -o .libs/libmapcache.so.0.0.0
/usr/bin/ld: cannot find -lcurl -lpng -ljpeg /usr/lib/libapr-1.la 
/usr/lib/libaprutil-1.la -lpcre -lsqlite3 -lpixman-1

collect2: ld returned 1 exit status
make[1]: *** [libmapcache.la] Error 1


all the libraries mentioned after "/usr/bin/ld: cannot find..." are 
installed and also found from the "configure" script of MapCache, see

  http://dpaste.com/680244/

They are also listed in the ldconfig cache, so I don't have a clue 
what's going wrong.


Any ideas?

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


Re: [mapserver-users] Get MAP file CLASSes with no data - empty

2011-12-19 Thread Armin Burger

Michal

I hope I understood your question correctly...:

the following code returns all class indexes for the provided layer and 
full map extent that appear in the data.


$me = $map->extent;
$layer->open();
$status = $layer->whichShapes($me);
$classWithData = array();
while ($shape = $layer->nextShape()) {
$shpIdx = $shape->index;
$clsIdx = $layer->getClassIndex($shape);
if (!in_array($clsIdx, $classWithData) && $clsIdx >= 0) {
$classWithData[] = $clsIdx;
}
}
$layer->close();

You could use this to get first all classes *with* data and then 
calculate the difference of this array with the array of total classes. 
The resulting array should contain the classes that are *not represented 
in the data* , like


$allClasses = range(0, $layer->numclasses-1);
$noDataList = array_diff($allClasses, $classWithData);
print_r($noDataList);


Note however that this works like listed above only for layers that have 
the same projection as the map. If both projections are different then 
the call of "$layer->nextShape()" causes a segmentation fault (in both 
MS 5.6 and 6). In this case you need to re-project the layer beforehand 
to the projection of the map, then it should work.


Armin


On 17/12/2011 22:35, Michal Seidl wrote:

I would like to get in PHP/Python environment the list of CLASSes which do
not target any data. The situation is like this.

1) I am interested only in vector data
2) I have mapfile and running mapserver
3) There is LAYER with many CLASSes which are defined by EXPRESSION in
mapfile

Any suggestion how get classes with no data?

Thanks Michal

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Get-MAP-file-CLASSes-with-no-data-empty-tp7104765p7104765.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
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] Problem with PHP MapScript $layer->nextShape()

2011-12-09 Thread Armin Burger

Hi all

I tried to use with PHP MapScript the function for the LAYER class 
"nextShape()" as described in the documentation with a small script 
example.


The short version is
  $extentMap = $map->extent;
  $status = $layer->whichShapes($extentMap);
  $shape = $layer->nextShape();

This works fine when layer and map are in the same projection. If the 
projections of layer and map differ (e.g. EPSG 4326 for map and 3035 for 
layer) then I get a segmentation fault. This happens for both MapServer 
6.0.1 and 5.6.6, PHP version is 5.3, OS is Linux.


If before the call of whichShapes() I re-project the extent object 
"$extentMap" to the projection of the layer then everything works fine. 
So the following workaround seems to work:


  $extentMap = $map->extent;
  $mapProjObj = ms_newProjectionObj($map->getProjection());
  $layerProjObj = ms_newProjectionObj($layer->getProjection());
  $extentMap->project($mapProjObj, $layerProjObj);
  $status = $layer->whichShapes($extentMap);
  $shape = $layer->nextShape();


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


Re: [mapserver-users] Re: MapScript WMS request

2011-09-08 Thread Armin Burger

Puneet

if you're interested in general in some sample code using PHP or Python 
MapScript for OWS request handling, please find some classes here:


http://p-ows.pmapper.net/trac/browser/p-ows/trunk

armin

On 08/09/2011 20:05, Mr. Puneet Kishor wrote:


On Sep 8, 2011, at 1:03 PM, thomas bonfort wrote:


it goes in map->web->metadata



I guessed as much, but I can't fathom the syntax. The webObj doesn't seem to 
have any constructor, and I don't see any documentation. Could you please point 
me to an example?





On Thu, Sep 8, 2011 at 19:48, Mr. Puneet Kishor  wrote:

a bit more investigation on producing a WMS response via Perl MapScript reveals 
the following error

  
  http://schemas.opengis.net/wms/1.1.0/exception_1_1_0.dtd";>
  
  
  msWMSDispatch(): WMS server error. WMS request not enabled. Check 
wms/ows_enable_request settings.
  
  

So, it seems I have to somehow, somewhere enable 'ows_enable_request'. Looking 
at the documentation, seems like if I had a map file, I could add the following 
line to do so

  ows_enable_request '*'

However, I am not using a map file at all. Not finding any documentation on 
this setting, I tried the following to no avail

  $map->{ows_enable_request} = '*';


Suggestions, anyone?


On Sep 7, 2011, at 10:18 PM, Mr. Puneet Kishor wrote:


I would really appreciate insight from someone well-versed in the ins and outs 
of WMS via MapScript. Looking at the discussion at 
[http://trac.osgeo.org/mapserver/ticket/670], the `img = wms_map.draw()` step 
seems to be a crucial part of drawing the image.

So, I added `my $img = $map->draw();` to my code below, and indeed, the image 
was drawn and sent back to the browser.

Is this something that should be added to the examples in the documentation? Is 
this the right way to do things? In any case, I am not write to STDOUT, and 
sending the buffer directly. Instead, my code is very much like a regular 
request (and it works) --

my $new_extent = $map->{extent};

my $req = new mapscript::OWSRequest();
$req->setParameter( "SERVICE", "WMS" );
$req->setParameter( "VERSION", "1.1.0" );
$req->setParameter( "REQUEST", "GetMap" );
$req->setParameter( "BBOX", "-180,-90,180,90" );
$req->setParameter( "LAYERS", "layer_name");
$req->setParameter( "SRS", "-1");
$req->setParameter( "WIDTH", "1200");
$req->setParameter( "HEIGHT", "600");

my $dispatch_out = $map->OWSDispatch( $req );
my $img = $map->draw();
my $map_img = 'test_' . sprintf("%0.10d", rand(10)) . '.png';
$img->save("/path/to/$map_img");
return send_file("/path/to/$map_img");


Comments? Corrections?


On Sep 7, 2011, at 6:12 PM, Mr. Puneet Kishor wrote:



On Sep 7, 2011, at 5:49 PM, Mr. Puneet Kishor wrote:


I am trying to convert my MapScript program to a WMS responder. I create my 
$map where I set all the layers and classes and colors, etc, just like for a 
normal, non-WMS request that works perfectly correctly.

my $map = undef;
$map = mapObj(name =>  'mymap') unless defined $map;

my $req = new mapscript::OWSRequest();
$req->setParameter( "SERVICE", "WMS" );
$req->setParameter( "VERSION", "1.1.0" );
$req->setParameter( "REQUEST", "GetCapabilities" );


I changed the above line to

  $req->setParameter( "REQUEST", "GetMap");

but, still no improvement.




mapscript::msIO_installStdoutToBuffer();
my $dispatch_out = $map->OWSDispatch( $req );
printf "%s\n", mapscript::msIO_getStdoutBufferString();

Except, the above doesn't really do anything for me. I get nothing in my 
browser. Suggestions?


--
Puneet Kishor






___
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


Re: [mapserver-users] Re: MapScript WMS request

2011-09-08 Thread Armin Burger

in PHP MapScript should be something like
  $map->setMetaData("ows_enable_request", "*");

in Python:
  map.setMetaData("ows_enable_request", "*")

armin


On 08/09/2011 20:05, Mr. Puneet Kishor wrote:


On Sep 8, 2011, at 1:03 PM, thomas bonfort wrote:


it goes in map->web->metadata



I guessed as much, but I can't fathom the syntax. The webObj doesn't seem to 
have any constructor, and I don't see any documentation. Could you please point 
me to an example?





On Thu, Sep 8, 2011 at 19:48, Mr. Puneet Kishor  wrote:

a bit more investigation on producing a WMS response via Perl MapScript reveals 
the following error

  
  http://schemas.opengis.net/wms/1.1.0/exception_1_1_0.dtd";>
  
  
  msWMSDispatch(): WMS server error. WMS request not enabled. Check 
wms/ows_enable_request settings.
  
  

So, it seems I have to somehow, somewhere enable 'ows_enable_request'. Looking 
at the documentation, seems like if I had a map file, I could add the following 
line to do so

  ows_enable_request '*'

However, I am not using a map file at all. Not finding any documentation on 
this setting, I tried the following to no avail

  $map->{ows_enable_request} = '*';


Suggestions, anyone?


On Sep 7, 2011, at 10:18 PM, Mr. Puneet Kishor wrote:


I would really appreciate insight from someone well-versed in the ins and outs 
of WMS via MapScript. Looking at the discussion at 
[http://trac.osgeo.org/mapserver/ticket/670], the `img = wms_map.draw()` step 
seems to be a crucial part of drawing the image.

So, I added `my $img = $map->draw();` to my code below, and indeed, the image 
was drawn and sent back to the browser.

Is this something that should be added to the examples in the documentation? Is 
this the right way to do things? In any case, I am not write to STDOUT, and 
sending the buffer directly. Instead, my code is very much like a regular 
request (and it works) --

my $new_extent = $map->{extent};

my $req = new mapscript::OWSRequest();
$req->setParameter( "SERVICE", "WMS" );
$req->setParameter( "VERSION", "1.1.0" );
$req->setParameter( "REQUEST", "GetMap" );
$req->setParameter( "BBOX", "-180,-90,180,90" );
$req->setParameter( "LAYERS", "layer_name");
$req->setParameter( "SRS", "-1");
$req->setParameter( "WIDTH", "1200");
$req->setParameter( "HEIGHT", "600");

my $dispatch_out = $map->OWSDispatch( $req );
my $img = $map->draw();
my $map_img = 'test_' . sprintf("%0.10d", rand(10)) . '.png';
$img->save("/path/to/$map_img");
return send_file("/path/to/$map_img");


Comments? Corrections?


On Sep 7, 2011, at 6:12 PM, Mr. Puneet Kishor wrote:



On Sep 7, 2011, at 5:49 PM, Mr. Puneet Kishor wrote:


I am trying to convert my MapScript program to a WMS responder. I create my 
$map where I set all the layers and classes and colors, etc, just like for a 
normal, non-WMS request that works perfectly correctly.

my $map = undef;
$map = mapObj(name =>  'mymap') unless defined $map;

my $req = new mapscript::OWSRequest();
$req->setParameter( "SERVICE", "WMS" );
$req->setParameter( "VERSION", "1.1.0" );
$req->setParameter( "REQUEST", "GetCapabilities" );


I changed the above line to

  $req->setParameter( "REQUEST", "GetMap");

but, still no improvement.




mapscript::msIO_installStdoutToBuffer();
my $dispatch_out = $map->OWSDispatch( $req );
printf "%s\n", mapscript::msIO_getStdoutBufferString();

Except, the above doesn't really do anything for me. I get nothing in my 
browser. Suggestions?


--
Puneet Kishor






___
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


Re: [mapserver-users] character encoding

2011-09-07 Thread Armin Burger
QGIS has quite nice possibilities to select the encoding when opening 
and writing the various supported vector data formats (including e.g. 
shape and KML).


armin

On 07/09/2011 17:59, Chris Jackson wrote:

Hi all

I am having some issues with special characters in my application (sure
I am not the first!) and wondered what the best way is to 'clean up' the
data so I know it is specifically in a given format say UTF-8 or ISO. My
source data was from KML -> shp using ArcGIS 10 (though who knows what
the kml format was!).  One would assume if using ArcMap on a UK machine
would give you an ISO output  Should I copy the characters back into
the attribute table via ArcGIS (but what program should I use to copy
the characters from - Word...).  I did use the ArcGIS export registry
setting to export my supposed ISO shapfile to UTF-8 format (but the
label rendering is wrong).  Any ideas would be much appreciated!

Many thanks

Chris



___
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] Mapscript and wms client

2011-09-05 Thread Armin Burger

Chris

Is it just this specific WMS or any other as well? I think the NASA JPL 
is very often not working or responding (it currently returns HTTP error 
403 for getCapalities). It's even more like I cannot remember anymore 
when it was working... Maybe the URL has just changed...


Armin

On 05/09/2011 23:53, Chris Jackson wrote:

Hi

I am trying to use a remote WMS service in my mapfile and am not having
any luck.  I resorted to the MapServer tutorial example and still had no
luck:

   LAYER # MODIS WMS map from JPL
 NAME modis_jpl
 TYPE RASTER
 OFFSITE  0 0 0
 STATUS   On
 CONNECTIONTYPE WMS
 CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?";

 METADATA
"wms_srs" "EPSG:4326"
"wms_name" "modis"
"wms_server_version" "1.1.1"
"wms_format" "image/jpeg"
 END

 PROJECTION
"init=epsg:4326"
 END
   END # Modis WMS image ends here

Mapscript has wms client enabled so am I missing another setting
required in the mapfile?

Thanks
Chris



___
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] Raster parameter PROCESSING "BANDS=..." and ECW files

2011-09-04 Thread Armin Burger



On 04/09/2011 19:07, Frank Warmerdam wrote:

On 11-09-04 09:33 AM, Armin Burger wrote:

Hi all

I noticed a strange behaviour of MapServer (5.6.7 and 6.0.1) when
defining for
a raster layer based on an ECW file a processing parameter for the
bands order
like

PROCESSING "BANDS=3,2,1"

The order of the bands does not have any effect. The image is always
displayed
in the original band order 1,2,3, whatever I define for the BANDS
value. If I
just define a single band, like
"BANDS=3" or "BANDS=1"
then it's displaying it correctly using the right band.

This problem seems just to appear for ECW files, not e.g. for Tiff
files. If I
wrap a VRT image around the ECW and use this VRT in the DATA tag of
the map
file then the BANDS order is taken into account, just not when
defining the
DATA using the pure ECW file.

Any ideas what's going wrong?


Armin,

I suspect that the special interleaved read method in the GDAL ECW driver
is not properly honouring the list of bands passed in to it. If this is
the problem then it might not have come up with earlier mapserver versions
that didn't do such reads in one interleaved request.

If this is the issue then please test with GDAL "trunk" and if the problem
persists file a ticket against GDAL.

Best regards,



Frank,

thanks for the quick reply. I tested the same configuration using the 
GDAL trunk from today and the problem persists. I filed a ticket for it 
on GDAL Trac (#4234).


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


[mapserver-users] Raster parameter PROCESSING "BANDS=..." and ECW files

2011-09-04 Thread Armin Burger

Hi all

I noticed a strange behaviour of MapServer (5.6.7 and 6.0.1) when 
defining for a raster layer based on an ECW file a processing parameter 
for the bands order like


PROCESSING "BANDS=3,2,1"

The order of the bands does not have any effect. The image is always 
displayed in the original band order 1,2,3, whatever I define for the 
BANDS value. If I just define a single band, like

"BANDS=3" or "BANDS=1"
then it's displaying it correctly using the right band.

This problem seems just to appear for ECW files, not e.g. for Tiff 
files. If I wrap a VRT image around the ECW and use this VRT in the DATA 
tag of the map file then the BANDS order is taken into account, just not 
when defining the DATA using the pure ECW file.


Any ideas what's going wrong?

Thanks for any hints

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


Re: [mapserver-users] Google tile schema to coordinates conversion

2011-06-10 Thread Armin Burger
I discovered now the conversion method in the Mapserver source code in 
maptile.c => msTileSetExtent().


armin


On 10/06/2011 17:43, Armin Burger wrote:

Hi all

I would like to set up a scripting solution based on MapScript that
replies correctly to requests using the Google tile schema x+y+z. Does
anybody know a formula how to transform the XYZ request values to
bounding box coordinates in the Google Spherical Mercator projection?

I know that Mapserver CGI offers the tile mode for this. It works very
well, but I would need a Mapscript solution for more flexibility of the
request handling.

Any hint appreciated

Armin
___
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] Google tile schema to coordinates conversion

2011-06-10 Thread Armin Burger

Hi all

I would like to set up a scripting solution based on MapScript that 
replies correctly to requests using the Google tile schema x+y+z. Does 
anybody know a formula how to transform the XYZ request values to 
bounding box coordinates in the Google Spherical Mercator projection?


I know that Mapserver CGI offers the tile mode for this. It works very 
well, but I would need a Mapscript solution for more flexibility of the 
request handling.


Any hint appreciated

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


Re: [mapserver-users] free() methods in MapScript, compatibility MS 5.x and 6

2011-04-29 Thread Armin Burger

Alan

I used a script creating 3 different type of objects without applying 
the "free" method, put it in a loop with 1M cycles and opened it in a 
browser. Checking the memory usage of the Apache process while running 
the script showed no increase of memory at all. So I would guess the 
free() is not needed any more. Test was made with MS 5.6


Armin

On 29/04/2011 15:13, Alan Boudreault wrote:

Hi Armin,

Although I'm not sure if the free call was useful... since it was only
removing the php object from a global list but the object was not really freed
until the end of the script... I would suggest to simply add a such condition
"if ms_version<  6 ... obj->free()" rather than removing them to be compatible
5.6/6.0 and avoid any issue. You can also do a quick test in your script with
some echo of the memory used before the end of the script and see if the
free() removal has any effect.

Alan

On April 27, 2011 01:25:54 pm Armin Burger wrote:

Hi everybody

in MapServer/MapScript 6 the various class methods "free()" have been
removed. If I want to have PHP/MapScript code compatible with both
MapServer 5.x and 6, the easiest would be to completely remove these
method calls from the code.

My question is just if these free() methods are still somehow required
or recommended for MapServer/MapScript 5.x or if I can silently drop
them without any drawbacks.

Cheers
Armin
___
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] free() methods in MapScript, compatibility MS 5.x and 6

2011-04-27 Thread Armin Burger

Hi everybody

in MapServer/MapScript 6 the various class methods "free()" have been 
removed. If I want to have PHP/MapScript code compatible with both 
MapServer 5.x and 6, the easiest would be to completely remove these 
method calls from the code.


My question is just if these free() methods are still somehow required 
or recommended for MapServer/MapScript 5.x or if I can silently drop 
them without any drawbacks.


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


Re: [mapserver-users] Mapserver 6.0.0 beta4 mapscript layer.getFeature missing?

2011-04-02 Thread Armin Burger

Francesco

getShape() has been deprecated in MS <=5.6 and has been re-introduced 
(with modifications) in MS 6, and getFeature() that replaced getShape() 
in MS <=5.6 has been removed in MS 6, quite clear, isn't it? ;-)


There's a migration guide Mapscript 5.6->6 and an RFC hat describe 
Mapscript changes, though I don't know if that reflects the final status 
or if there have been additional changes in the meantime:

http://www.mapserver.org/trunk/mapscript/php/migration_guide.html
http://www.mapserver.org/trunk/development/rfc/ms-rfc-65.html

armin


On 02/04/2011 10:52, francesco wrote:

Hello everyone,
Thanks to mapserver developers/users for their time to help out on this
list.
I am trying out the new Mapserver 6.0.0, compiled it for windows and now
I am testing it.
Came across the following problem:
on mapscript I cannot call the "getFeature($i)" function; I get the
following message
/Call to undefined method layerObj::getFeature() /

The migration guide reads:
/layer.getShape(int tileindex, int shapeindex)) has been deprecated and
renamed to layer.getFeature(int shapeindex [, int tileindex = -1]) to
match the SWIG MapScript equivalent./

But it seems that function does not exist! :-)

Am I missing out on something?

Cheers,
--
**
*Francesco Pirotti*
Dep. TESAF
CIRGEO – Interdepartmental Research Center on Cartography Photogrammetry
Remote Sensing and G.I.S.
University of Padova
Web: http://www.cirgeo.unipd.it/cirgeo/francescopirotti.htm
Email: francesco.piro...@unipd.it 
Phone: +39 049 827 2710
Phone: +39 349 55 39 261
**



___
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] MapServer 6 and KML outputformat

2011-03-10 Thread Armin Burger

Hi all

the outputformat KML in the new MS 6 is quite nice and it allows easy 
and flexible data export to KML especially via Mapscript. But the 
implementation of the export of data attributes could be improved IMHO.


Currently the fields/items of the layers (defined under map file 
METADATA KML_INCLUDE_ITEMS) are exported to a KML tag "" 
and inserted as HTML table. While this is of course possible, a cleander 
way would be how GDAL/OGR exports the attributes:


GDAL/OGR uses the tag  and places the attribute values in 
 tags, like


   ...  
   
Berlin
3899412
DE
   

This leads to a much better display in Google Earth.

In addition to the KML_INCLUDE_ITEMS, another possibility to define a 
field/item used in KML for the  tag would be useful, like OGR 
allows this via the NameField option. So maybe a METADATA definition 
like KML_NAME_FIELD could do this.


Best regards
Armin


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


Re: [mapserver-users] MapServer 6.0.0-beta1 release - Error with $point->setXY()

2011-03-10 Thread Armin Burger

I tried the MS 6beta1 from SVN (the osgeo download site is not responding).

The first error I found in PHP Mapscript was related to the function 
setXY() for point objects, the following code causes a segmentation 
fault (something like "child pid 16057 exit signal Segmentation fault 
(11)" in the Apache error log):


$pnt = new PointObj();
$pnt->setXY(250,200);

Same problem appears when creating the point with the old syntax
$pnt = ms_newPointObj();

The environment is Ubuntu 10.04, PHP 5.3.5 and Apache2 prefork (PHP as DSO).

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


Re: [mapserver-users] Does Mapserver WCS 1.0.0 respect OFFSITE of tileindex layer?

2010-04-19 Thread Armin Burger

Hello Jukka

your assumption how the the OFFSITE tag is applied for the WCS output is 
also what I would have expected it to do. I probably did not notice this 
strange behaviour since my set ups of WCS only used non-overlapping 
tiles (for WMS I use overlapping tiles and the OFFSITE works fine).


Just an idea (I never tried it): maybe you could try to use a VRT image 
instead of the tileindex. At least since Gdal 1.7 there is the tool 
"gdalbuildvrt" that has the options "-srcnodata" and "-vrtnodata" which 
might do what you want.


All tests I made so far with VRT images worked quite fine, they were 
exactly treated as a single image. I don't know if the speed might be a 
bit slower, but WCS is typically slow anyway, so it should not cause 
problems.


Greetings
Armin

On 19/04/2010 16:10, Rahkonen Jukka wrote:

Frank Warmerdam wrote:


Jukka,

Generally WCS generated geotiffs will not have a way to
represent nodata
in a way that a client application is likely to recognise
them as nodata.
By default pixels which are assigned no value from the source
dataset are
set to zero.



I am not sure if I could tell clearly what was my problem. I will try
again. I have layers like this:

LAYER
 NAME "M138"
 METADATA
   "wcs_label""M138"
   "OWS_EXTENT" "86000 6636000 65 7518000"
  "WCS_RESOLUTION" "0.5 0.5"
  "WCS_SIZE" "5 5"
  "WCS_BANDCOUNT" "1"
 END
 STATUS ON
 TILEINDEX "d:/dataM138"
 TYPE RASTER
 UNITS METERS
 SIZEUNITS PIXELS
 OFFSITE 0 0 0
 TOLERANCE 3
 TOLERANCEUNITS PIXELS
 PROJECTION
   "init=epsg:3067"
 END
 DUMP TRUE
   END

Tiles combined by M138_WMS.shp overlap because they are reprojected.
When I use this layer through WMS, having OFFSITE 0 0 0 makes the black
nodata triagles transparent and warped images make a seamless mosaic.
Somehow I was awaiting that WCS behaves in a similar way, but it does
not. Black nodata triangles are burned into the output image and the
mosaic is useless. I can get my job done by hand editing WMS calls so
that the BBOX and WIDTH and HEIGHT give me the desired pixel size, but
it would be a bit more simple through WCS GetCoverage and ResX, ResY.

-Jukka-
___
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] How to avoid warning messages for WFS and optional metadata

2009-12-04 Thread Armin Burger

Hi all

when defining a WFS with MapServer the GetCapabilities request returns 
several warnings of the type:


WARNING: Optional metadata ... was missing for ...

if the version is set to 1.1.0 (it does not appear for requested version 
1.0.0). I do not really understand why missing *optional* metadata 
parameters create a warning output. Therefore my question is if there is 
a configuration setting that allows suppressing warnings for missing 
optional elements.


Thanks for any hints

Armin

PS: When I remember well this behaviour is the same for WCS in version 1.1.0
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapServer 5.4 Beta 2 Available

2009-02-26 Thread Armin Burger

Hello

just a more marginal remark regarding WCS and time support: is there a 
chance that the small patches for WCS-T (tickets #2487 and #1856) will 
make it into the 5.4?


Greetings, Armin



On 26/02/2009 06:44, Steve Lime wrote:

Greetings all: MapServer 5.4 Beta 2 is now available for download at 
http://mapserver.org/download. A number of bugs uncovered during testing of the 
first beta have been fixed. As a result a 3rd beta is planned for next Wed., 
March 4th. As always any help in testing the software is greatly appreciated. 
Findings should be sent to the mapserver-dev (or even just mapserver-users) 
mailing list.

The updated 5.4 release plan can be found at:

  http://trac.osgeo.org/mapserver/wiki/54ReleasePlan

Steve
___
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] Regarding Apache

2009-02-08 Thread Armin Burger
My experience is the following: I'm using PHP MapScript since ~ 2 years 
as Apache DSO without noticing problems. Important is to use the Apache 
'prefork MPM' version of Apache 2.+ (or Apache 1.3 which seems always 
'prefork'). Using the threaded MPM ('worker') of Apache seems not to 
work correctly with Mapscript. And the PHP docs recommend the prefork 
MPM anyway. Apache on Windows seems always to be threaded, therefore PHP 
should be used only as CGI when Mapscript is required.


Regards, Armin

On 06/02/2009 09:58, Gregor at HostGIS wrote:

Amiya Patra wrote:
*PHP/MapScript and PHP has a habit of causing Apache to effectively 
freeze*

But how to solve that one...


If you suspect that that's the problem with your server, do what 
everyone else does: compile and run PHP as a CGI program, not as a DSO.


It is unfortunate. By using PHP as a CGI, you fix that problem, but lose 
a lot of the benefits of PHP as DSO, such as database connection pooling 
and being able to use Zend Optimizer. But if you're using PHP/MapScript 
that's just how it is.




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


Re: [mapserver-users] WCS time support bugs

2008-11-10 Thread Armin Burger

Alex

during the tests I noticed 2 shortcomings of the patch for the 
'wcs_timeposition', both are a bit correlated with each other:


If a request contains a timestamp not available in the Postgis table 
then an empty image will be sent back to the requesting client. A better 
solution would be to check the available dates in the PG table and 
return a service exception in case the requested date is not there.


Another problem is that clients will have no possibility to know which 
dates are really available when supplied with a range. The only WCS 
client I found so far that supports WCS-T is gvSIG. But this client just 
offers the time range definition for selection, so it will not work. A 
solution could be that the DescribeCoverage response reads all available 
timestamps from the tileindex layer and returns a single entry for all 
of them in the returned XML.


Both modifications would require to dive somewhat deeper into the code 
and understand where and how the link between WCS layer and tileindex 
layer is made and how the info from the PG tileindex layer is retrieved 
from PG. I unfortunately doubt that this will be of high priority to the 
main developers.


Greetings, Armin



On 10/11/2008 17:33, Alexander Petkov wrote:

On Wed, Nov 5, 2008 at 11:39 AM, Alexander Petkov <[EMAIL PROTECTED]> wrote:

On Wed, Nov 5, 2008 at 10:13 AM, Armin Burger <[EMAIL PROTECTED]> wrote:

Alex

I had a look at the code and tried the suggested fix. I uploaded a patch at
the wiki, see this link
http://trac.osgeo.org/mapserver/attachment/ticket/2487/mapwcs.c.patch

With these modifications the PostGIS problem disappeared and it was also
possible to specify 'wcs_timeposition' as a range of dates instead of single
dates for the full timeseries.

Armin

Awesome, thanks Armin!!

I will patch and use,

Alex



The patch is very useful indeed :) GetCoverage requests now work for
Postgis-backed time indexed layers with this patch. Also, now I don't
need to specify explicit time positions for the wcs service--just
start and end.

Hopefully it'll make it into the source tree.
Thanks again,
Alex


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


Re: [mapserver-users] WCS time support bugs

2008-11-05 Thread Armin Burger

Alex

I had a look at the code and tried the suggested fix. I uploaded a patch 
at the wiki, see this link

http://trac.osgeo.org/mapserver/attachment/ticket/2487/mapwcs.c.patch

With these modifications the PostGIS problem disappeared and it was also 
possible to specify 'wcs_timeposition' as a range of dates instead of 
single dates for the full timeseries.


Armin


On 05/11/2008 17:46, Alexander Petkov wrote:

On Mon, Nov 3, 2008 at 4:10 PM, Armin Burger <[EMAIL PROTECTED]> wrote:

Hi everybody

I wanted to test the time support functionality of WCS but this seems not to
be working. There is an older bug report at
 http://trac.osgeo.org/mapserver/ticket/1856
but it seems this has not been fixed yet.

I use a PostGIS table to store the tileindex for the time series and as
mentioned in the bug report there is still a wrong filter applied to the
tileindex. Did anybody already try if the fix suggested in the ticket will
work?


In addition, the time support of WCS does not have a time *range* similar to
WMS-T "ows_timeextent" like
 "ows_timeextent" "2006-01-01/2006-06-01"

WCS requires to list every single date of the available coverages under
"wcs_timeposition" which is not very feasible for longer time series. The
bug report at Ticket #2487
  http://trac.osgeo.org/mapserver/ticket/2487

lists this problem as fixed, but when I use
  "wcs_timeposition" "2006-01-01/2006-06-01"

and request a coverage with a parameter '&TIME=2006-05-11', with MapServer
v5.2 I still get the exception
 ...
 WCS server error. The coverage does not have a time position of
 2006-05-11.
 ...
Any idea if the definition has to be set in another way?

Best regards
Armin




Hello Armin:

I experienced the same problems some time ago. Here are the relevant
posts to the ML that I wrote:

http://www.nabble.com/wcs_timeposition%3A-explicit-listing-or-start-end-range--td19001008.html

And the problem with using PostGIS connector:
http://www.nabble.com/GetCoverage-request-and-time-idexed-coverage-using-postgis-td18743297.html

I've been told to file a bug, (which I have yet to do), I hope to get
some time soon to look into the code myself and see what's going on...

Alex


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


[mapserver-users] WCS time support bugs

2008-11-03 Thread Armin Burger

Hi everybody

I wanted to test the time support functionality of WCS but this seems 
not to be working. There is an older bug report at

  http://trac.osgeo.org/mapserver/ticket/1856
but it seems this has not been fixed yet.

I use a PostGIS table to store the tileindex for the time series and as 
mentioned in the bug report there is still a wrong filter applied to the 
tileindex. Did anybody already try if the fix suggested in the ticket 
will work?



In addition, the time support of WCS does not have a time *range* 
similar to WMS-T "ows_timeextent" like

  "ows_timeextent" "2006-01-01/2006-06-01"

WCS requires to list every single date of the available coverages under 
"wcs_timeposition" which is not very feasible for longer time series. 
The bug report at Ticket #2487

   http://trac.osgeo.org/mapserver/ticket/2487

lists this problem as fixed, but when I use
   "wcs_timeposition" "2006-01-01/2006-06-01"

and request a coverage with a parameter '&TIME=2006-05-11', with 
MapServer v5.2 I still get the exception

  ...
  WCS server error. The coverage does not have a time position of
  2006-05-11.
  ...
Any idea if the definition has to be set in another way?

Best regards
Armin



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


Re: [mapserver-users] High resolution printing

2008-10-01 Thread Armin Burger

Milo

Depending on the purpose, you could check if Mapyrus is useful for you. 
Disadvantage is that you need to define the map layout a second time and 
make it look similar to Mapserver layout. But the PDF output quality is 
far better than the one of Mapserver, and you do not need to bother with 
PDFLib licenses. And it's also working well for large print formats 
(vector based rendering of vector data).


Armin

On 30/09/2008 18:26, Milo van der Linden wrote:

Hello list!

I have been searching the web for tips and tricks, but basically what I 
need is a method or procedure or (commercial) tool that can enhance my 
mapserver installation to enable high resolution printing.


What I am looking for is the best practice to:

- Add a button to our website
- Let the button start a script or program that processes the active 
layers in the map view based upon the current extent
- Generate a mixture of high-res images and optionally svg or alike for 
linework

- combine the works in a pdf
- present the pdf for download to the user

I would also like to know if there are any commercial, mapserver based, 
solutions for this. I am also willing to hire an expert to achieve this.


Any ideas?

Kind regards,

Milo van der Linden
___
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] php/mapscipt getExtent

2008-04-23 Thread Armin Burger

Alim

The extent returned for a layer seems to be working only for 'standard' 
layers (e.g. based on shapefiles), but neither for Postgis nor raster 
layers, god knows why I use the code below for zooming to the extent 
of a Postgis layer:


$data = trim($layer->data);
$dataList1 = preg_split("/\s/", $data);
$dataList2 = preg_split("/using/i", $data);
$geomFld = array_shift($dataList1);
$sql = "select xmin(extent) as minx, ymin(extent) as miny, xmax(extent)
as maxx, ymax(extent) as maxy
from (SELECT extent($geomFld) "
. substr($dataList2[0], strlen($geomFld)) . ") as bar";

// load DLL on Win if required
if (PHP_OS == "WINNT" || PHP_OS == "WIN32") {
if (! extension_loaded('pgsql')) {
dl('php_pgsql.dll');
}
}

$connString = $layer->connection;
if (!($connection = pg_Connect($connString))){
   error_log ("Could not connect to database");
   error_log ("PG Connection error: " . pg_last_error($connection));
   exit();
}

$qresult = pg_query ($connection, $sql);
if (!$qresult) error_log("PG Query error for : $query" . 
pg_result_error($qresult));


$pgE = pg_fetch_object($qresult);
$layerExt = ms_newRectObj();
$layerExt->setextent($pgE->minx, $pgE->miny, $pgE->maxx, $pgE->maxy);


There might be easier solutions but this worked for me.

armin

On 22/04/2008 23:52, alim karim wrote:

hello all.

i have a PostGIS layer (without its extents specified) in a mapfile.

i am trying to use getExtent on this layer, but the coordinates i get 
back 
(["minx":-2500,"miny":-2500,"maxx":2500,"maxy":2500]) 
are not the correct extents([1180204.375000, 
809428.75,1222443.00, 857276.187500)]).


is there a way to get the proper extents of a layer even though they 
might not be specified in the mapfile?






___
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] GetCapabilities for a specific layer, not the entire mapfile?

2008-04-17 Thread Armin Burger


On 17/04/2008 14:20, Daniel Morissette wrote:

Armin Burger wrote:


[...] Or using the main map file and deleting all layers but the 
requested one with 'removeLayer()'. This does not work with PHP 
Mapscript since this method does not exist there.


The removeLayer() method does not exist in PHP MapScript, but you can 
achieve the same result by using the DELETED status on the layers to 
hide from the GetCapabilities:


  $layer->set("status", MS_DELETE);

Daniel


This never worked for me. The only effect I noticed so far when setting 
a layer's status to MS_DELETE was that it was not included in the map 
when I write it out to a file with $map->save().


But these layers are still listed in the getCapabilities response, they 
are still existing for the $map->getAllLayerNames() method and in the 
indexes of existing layers. In Python Mapscript the removeLayer function 
exists and works.


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


Re: [mapserver-users] GetCapabilities for a specific layer, not the entire mapfile?

2008-04-17 Thread Armin Burger
John
I don't know if it is an option for you, but it would be quite easy doing this 
with Mapscript, using the functionality of OWSrequest. Either using an 'empty' 
map file and adding to it the desired layer from the main map file with 
Mapscript 'addLayer()' method. This works with all types of Mapscript. Or using 
the main map file and deleting all layers but the requested one with 
'removeLayer()'. This does not work with PHP Mapscript since this method does 
not exist there. 

Using Apache rewrite rules one can also create nicer URLS, like

http://host/wms/layer1 or
http://host/wms/layer2

I have not noticed so far big differences in speed between Mapscript and CGI, 
maybe under higher load this could change slightly. 

Armin

 Original-Nachricht 
> Datum: Wed, 16 Apr 2008 23:10:48 +0100
> Von: John Maurer <[EMAIL PROTECTED]>
> An: mapserver-users@lists.osgeo.org
> Betreff: [mapserver-users] GetCapabilities for a specific layer,  not the 
> entire mapfile?

> Hi mapserver-users,
> What is the best way to provide a generic/flexible WMS-related URL for a 
> specific layer within my MapServer mapfile? I want to include this kind 
> of thing in our DIF & FGDC metadata so that users know about a WMS for a 
> given data set. If I provide a GetCapabilities request, this advertises 
> *all* of the layers in my mapfile, which represent a collection of 
> multiple data sets, most of which will be unrelated to the data set in 
> the metadata. On the other hand, if I provide a GetMap request this 
> allows me to specify the layer intended for a particular data set, but 
> it limits the output possibilities to a specific srs, format, width, 
> height, and bbox. A GetCapabilities for a specific layer would be akin 
> to what I need, but I don't think that's how it works. This is my 
> quandary and I'm hoping somebody has a solution to this kind of thing??
> Thanks!
> Cheers,
> John Maurer
> 
> -- 
> John Maurer
> Web/Database Applications Engineer
> National Snow and Ice Data Center (NSIDC)
> University of Colorado at Boulder
> http://cires.colorado.edu/~maurerj
> 
> "Without geography, you're nowhere!"
> 
> 
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] buffer bounds (PHP Mapscript)

2008-04-11 Thread Armin Burger

Carlo

I don't know if this behaviour is a feature or a bug of PHP Mapscript (I 
have not tested it with SWIG versions of Mapscript). A workaround is to 
project the buffer in the same projection as the layer. Then the extent 
is returned correctly. Something like


$prj =  ms_newprojectionobj($queryLayer->getProjection());
$buffer_polygon=$selected_shape->buffer($buffer_width);
$buffer_polygon->project($prj, $prj);
$shapebounds=$buffer_polygon->bounds;

Armin

On 11/04/2008 14:20, Carlo Pelliconi wrote:

Hi.
I'm trying to obtain automatic zoom on a buffer (which I want to see in 
map - and I do that) created around a selected feature.

I use

$selected_shape=$queryLayer->getShape(...);
$buffer_polygon=$selected_shape->buffer($buffer_width);
$shapebounds=$buffer_polygon->bounds;

This doesn't work: $buffer_shapebounds (which is a rectobj) is set to -1 
-1 -1 -1 and used in setExtent it doesn't work.
If I apply the same code to a "real" shapefile (eg. the result of a 
getShape, without the buffer around), it works:


$selected_shape=$queryLayer->getShape(...);
$shapebounds=$selected_shape->bounds;

In this case $shapebounds is well defined and used in setExtent it works.

Any idea or suggestion?
Thanks in advance


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


Re: [mapserver-users] Tileindex and drawing order of tiles

2008-04-10 Thread Armin Burger

Jukka

if you have a column you can use for sorting you could rewrite the 
shapefile using the sortshp tool provided with mapserver. The problem 
might be how to add this field if you create the shapefile with 
gdaltindex. One could use a Perl/PHP/Python script to update a sort 
column in the shape dbf based on an information in another file (dbase, 
txt) or database.


Or if you anyway use Postgis you could put the tileindex in a Postgis 
table and define the DATA tag in the map file with an ORDER BY at the 
end. Also here you'd need to find a way to set the sort order in a column.


Armin


On 10/04/2008 21:32, Rahkonen Jukka wrote:
Hi, 


I started to wonder if it is be possible to define the drawing order of image 
tiles by tweaking with tileindex.  It might be of some use if, for example, 
there are recent overlapping images which would be fine to have always on top 
of older images.  Perhaps the tileindex shapefile could be sorted in some 
clever way?

-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] Re: Hiding overviews

2008-03-21 Thread Armin Burger

Jukka

I was working a bit on this issue since we face the same problem. If you 
don't mind using Python MapScript instead of the Mapserver CGI then you 
could try to use this Python class that uses the OWSRequest 
functionality of Mapserver/Mapscript:


http://svn.pmapper.net/repos/owspy/trunk/

It modifies the map object before the output of the GetCapabilities 
response. For a group of layers always the first one in the map file is 
used as the one visible to the clients for the capabilities. In 
addition, only the layers that have a 'ows_title' metadata tag are 
included in the response. And with an Apache rewrite rule the URL's can 
be set to look a bit nicer. Some more details are in the README file.


Armin



On 06/03/2008 09:31, Rahkonen Jukka wrote:

Hi,

I would say that if it is not possible at the moment to make a logical WMS 
layer that automatically swithes between several external overviews and the 
original imagery through tileindex according to scale settings, then it would 
be very useful to have.  However, it feels so obvious demand that I would be a 
bit surprised if there is not such an option. Anyway, if it is missing then I 
will give +1 for feature request.

There seems to be an option called wms_layer_group in the layer metadata 
section of mapfile, but I must admid  that I do not understand what it stands 
for.

-Jukka Rahkonen-




-Alkuperäinen viesti-
Lähettäjä: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] Puolesta 
Eichner, Andreas - SID-NLK

Lähetetty: 6. maaliskuuta 2008 9:26
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] Re: Hiding overviews


Hello Jacob,

thanks for your try but this didn't help, sorry. IMHO the 
problem is that there seems to be no way to declare multiple, 
scale dependend data sources for one layer (in a WMS sense). 
Since the only reason of using of overviews for me is the 
(nearly) scale-independent performance. But optimization is 
_really_ a private thing of the service. It is not of the 
client's interest that MapServer internally organizes 
overviews as multiple layers... 


___
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] removeLayer() in PHP MapScript

2008-03-07 Thread Armin Burger

Hello

I'd have a question for the PHP Mapscript developers: are there any 
plans to implement the removeLayer() method (that exists for SWIG 
Mapscript versions) also in PHP Mapscript? Setting the layer status to 
MS_DELETE is in most cases not an alternative since it seems to have 
effects only for writing the map object to a map file.


Best regards

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