[mapserver-users] How to use/offer multiple projections in mapfile for WMS

2014-01-21 Thread Stefan Schwarzer
Hi there,

I'd like to offer multiple projections for my WMS layers. But it doesn't work 
the way I want. 

The EPSG:4326 works well. But when I change it to, for example, EPSG: 3395, I 
get an empty image (the legend shows).

I have to define the projection at various places - already a bit confusing for 
me. And I have a projection in the SQL query: …. USING srid= 4326. Tried to 
replace that one too, but didn't change anything.

Thanks for any suggestions!

Stefan

 
MAP

# Map definition -

NAME wms_test.map
STATUS ON
SIZE 600 300
EXTENT -180 -90 180 90
UNITS DD
IMAGECOLOR 255 255 255
SHAPEPATH 'xx' 
FONTSET 'xx' 
SYMBOLSET 'xx' 
IMAGETYPE png
DATAPATTERN '^[0-9]'


PROJECTION
'init=epsg:4326'
END



WEB
IMAGEPATH '/www/geodataportal/temp/'
IMAGEURL 'http://129.194.231.185/temp/'
METADATA
'wms_title' 'Environmental Data 
Explorer WMS Server'
'wms_service_onlineresource'
'http://129.194.231.185/cgi-bin.main?map=/www/geodataportal/htdocs/mod_map/wms_test.map;'
'wms_getfeatureinfo'
'http://129.194.231.185/cgi-bin.main?map=/www/geodataportal/htdocs/mod_map/wms_test.map;'
'wms_featureinfoformat' 'text/plain'
'wms_abstract'  '...'
'wms_accessconstraints' '...'
'wms_country'   'Switzerland'
'wms_city'  'Geneva'
'wms_postcode'  '1211'
'wms_address'   '11, Chemin des 
Anémones'
'wms_contactperson' '-'
'wms_addresstype'   '-'
'wms_stateorprovince'   'Geneva'
'wms_contactelectronicmaliaddress' 'geo_team ---at--- 
grid.unep.ch'
'wms_contactorganization'   'UNEP/DEWA/GRID-Europe'
'wms_keywordlist'   'download, environment, 
geo, data, water, map, graph, world, population, unep, emission, temperature, 
biodiversity, forest, consumption, vegetation, land, statistics, energy, soil'
'ows_enable_request''*' 
'wms_srs'   'EPSG:4326 EPSG:3395'
'ows_srs'   'EPSG:4326 EPSG:3395'
END
END




LAYER
NAME agri_area  
METADATA 
'wms_title' 'Agricultural Area'
'wms_abstract'   'Units: Square Kilometers'
'wms_timeextent''2011'
'wms_extent''-180 -90 180 90' 
'wms_srs'   'EPSG:4326 EPSG:3395' 
'wms_include_items' 'name,value' 
END # METADATA
#PROJECTION
#'init=epsg:4326'
#END
STATUS OFF
CONNECTIONTYPE postgis
CONNECTION 'user=xx password=xx dbname=xx'   
TYPE POLYGON
DATA geom FROM (query-here) AS foo USING UNIQUE uid USING srid= 
4326 
TEMPLATE 'dummy'
DUMP TRUE
CLASSITEM 'value'
CLASS
NAME 'Agricultural Area [2011]'
EXPRESSION ([value]=-10001)
TEMPLATE 'empty space'
END  # CLASS 
CLASS
NAME 'Square Kilometers' 
EXPRESSION ([value]=-110003)
TEMPLATE 'units as title in legend'
END  # CLASS
CLASS
NAME 'no data'
EXPRESSION ([value]=-)
COLOR 230 230 230
OUTLINECOLOR 150 150 150
TEMPLATE 'dummy'
END  # CLASS
CLASS 
NAME '4 to 1038299'
EXPRESSION ([value]=1038299)
COLOR 255 255 178
OUTLINECOLOR 150 150 150
TEMPLATE 'dummy'
LABEL
FONT arial
TYPE truetype
ANTIALIAS false
SIZE 8
COLOR 0 0 0
POSITION AUTO
PARTIALS FALSE
FORCE true
OFFSET 0 5
#OUTLINECOLOR 150 150 150
END
END  # CLASS 
CLASS 
NAME '1038299 to 2076594'
EXPRESSION ([value]=2076594)
COLOR 

[mapserver-users] /usr/lib/cgi-bin/mapserv: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/cgi-bin/mapserv)

2014-01-13 Thread Stefan Schwarzer
Hi there,

what can I do about that message which appears regularly in my error_log? It 
seems like a minor thing (just version information); nevertheless, I'd like to 
clean that.

Thanks for any hints.

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


Re: [mapserver-users] How to deal with (visible) CONNECTION information in .MAP file for WMS purposes

2014-01-07 Thread Stefan Schwarzer
Thanks for all the valuable help!

If I place the .MAP file somewhere where only the system can read it, the 
request looks a bit awkward: ….map=/home/include/mapfiles/my_map.map….

Would there a possibility to juste use …map=my_map… and have the path then get 
added/understood by some internal configuration (mod_rewrite perhaps?)?

For the Wrapper, I don't really understand how that one would work. I have 
multiple .MAP files. And they need to by WMS-compliant. If I understand 
correctly, the URL would call the script: http://my_url.org/my_script, right? 
H...

It says:

#!/bin/sh
MAPSERV=/path/to/my/mapserv
MS_MAPFILE=/path/to/my/mapfile.map exec ${MAPSERV}

Thanks for any help!

Stefan



On 06.01.2014, at 11:03, Siki Zoltan wrote:

 Hi Stefan,
 
 you should hide your map file using a wrapper script on the server side.
 See http://mapserver.org/cgi/wrapper.html
 You can find some other methods at http://mapserver.org/ogc/wms_server.html
 look for Changing the Online Resource URL
 
 Regards,
 Zoltan
 
 On Mon, 6 Jan 2014, Stefan Schwarzer wrote:
 
 Hi there,
 
 I am wondering how to deal with the CONNECTION information in the .MAP which 
 is used for WMS requests. As the .MAP file must be visible and is readable, 
 the CONNECTION information for my database is readable too.
 
  # Layers definition -
  LAYER
  NAME wilderness_areas_po
  METADATA
  'wcs_label'   'Wilderness Areas'
  'wcs_rangeset_name'   'test'
  'wcs_rangeset_label'  'test label'
  END
  TYPE RASTER
  STATUS OFF
  DATA wilderness_areas_po
  CONNECTIONTYPE postgis
  CONNECTION 'user=my_username password=my_password 
 dbname=my_database'
  PROJECTION
  'init=epsg:4326'
  END
  END
 
 
 Either I would then need to create a very simple user for that case which 
 really only can read the data, or I should hide the file in a directory 
 which is not readable by a webuser. But I guess that Mapserver wouldn't like 
 that.
 
 What are your recommendations?
 
 Thanks for any hints.
 
 Stefan
 ___
 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 deal with (visible) CONNECTION information in .MAP file for WMS purposes

2014-01-06 Thread Stefan Schwarzer
Hi there,

I am wondering how to deal with the CONNECTION information in the .MAP which is 
used for WMS requests. As the .MAP file must be visible and is readable, the 
CONNECTION information for my database is readable too.

# Layers definition -
LAYER
NAME wilderness_areas_po 
METADATA
'wcs_label'   'Wilderness Areas'
'wcs_rangeset_name'   'test'
'wcs_rangeset_label'  'test label'
END
TYPE RASTER
STATUS OFF
DATA wilderness_areas_po
CONNECTIONTYPE postgis
CONNECTION 'user=my_username password=my_password 
dbname=my_database'   
PROJECTION
'init=epsg:4326'
END
END 


Either I would then need to create a very simple user for that case which 
really only can read the data, or I should hide the file in a directory which 
is not readable by a webuser. But I guess that Mapserver wouldn't like that.

What are your recommendations?

Thanks for any hints.

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


[mapserver-users] Legend gets cut off at the bottom

2013-10-23 Thread Stefan Schwarzer
Hi there,

I am wondering why, as I would have said I haven't touched the script in a 
while. But suddenly, the legend gets cut off at the bottom. 

Here is an example: 
https://www.evernote.com/shard/s341/sh/e239dc6e-17da-4b72-aa5d-207461cfeb5d/02da84ac188af5236ecd639498bd20dc

Does anyone have an idea? Thanks for any hints!

Stefan

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

[mapserver-users] Passing an additional parameter via URL for WMS request - doesn't work anymore with new mapserver?

2012-08-21 Thread Stefan Schwarzer
Hi there,

I used to pass a parameter in a WMS request in order to specify which country 
should be highlighted. The MAPFILE would read that and, via an EXPRESSION, set 
all country but the selected one to a bit of opacity:

DATA the_geom FROM (SELECT xxx FROM capitals WHERE capitals.id_country 
 %id_country%) AS foo USING UNIQUE gid USING srid=4326

That doesn't work anymore after upgrading our machine. So, I am not 100% sure 
if this comes from mapserver, or if there is anything else involved. But it 
seems more like a mapserver problem, as the error-message is

ServiceException
msDrawMap(): Image handling error. Failed to draw layer named 
#39;capitals_selected#39;.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  syntax 
error at or near quot;%quot;
LINE 1: ...als.gid FROM capitals WHERE capitals.id_country = %id_countr...
 ^
 
msValidateParameter(): Regular expression error. Parameter pattern validation 
failed.
msValidateParameter(): Regular expression error. Parameter pattern validation 
failed.
msValidateParameter(): Regular expression error. Parameter pattern validation 
failed.
msValidateParameter(): Regular expression error. Parameter pattern validation 
failed.
/ServiceException


Thanks for any hints/clarification.

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


Re: [mapserver-users] Passing an additional parameter via URL for WMS request - doesn't work anymore with new mapserver?

2012-08-21 Thread Stefan Schwarzer
Thanks so much for the quick responses!

If I understand it correctly, I need to specify DATAPATTERN in the MAP part, 
in order to use the parameter in the DATA request:

Doc is saying: LAYER: DATA (must validate against DATAPATTERN)


which would look like this:

SHAPEPATH '/www/xxx/data' 
FONTSET '/www/xxx/htdocs/mod_map/etc/fonts.txt' 
SYMBOLSET '/www/xxx/htdocs/mod_map/etc/symbols.sym' 
DATAPATTERN '^[0-9]'


with the DATA request like:

DATA the_geom FROM (SELECT xxx FROM capitals WHERE capitals.id_country 
 %id_country%) AS foo USING UNIQUE gid USING srid=4326


Hmmm…. But that doesn't work.

msDrawMap(): Image handling error. Failed to draw layer named 
#39;capitals_mask#39;.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  syntax 
error at or near quot;)quot;
LINE 1: ...capitals WHERE capitals.id_country lt;gt; %id_country%) AS foo w…


Can you shed some light on it? I am not really familiar with the regular 
expressions. I am just passing an integer.

Thanks for any hints!

Stef




On Aug 21, 2012, at 4:10 PM, Till Adams wrote:

 Stefan,
 
 from mapserver 6 on you must define the default values for the
 parameters in your metadata-tag and also provide a validation-pattern.
 
 You'll find more here:
 http://mapserver.org/cgi/runsub.html
 
 Regards, Till
 
 
 
 On 21.08.2012 16:07, Stefan Schwarzer wrote:
 Hi there,
 
 I used to pass a parameter in a WMS request in order to specify which 
 country should be highlighted. The MAPFILE would read that and, via an 
 EXPRESSION, set all country but the selected one to a bit of opacity:
 
  DATA the_geom FROM (SELECT xxx FROM capitals WHERE capitals.id_country 
  %id_country%) AS foo USING UNIQUE gid USING srid=4326
 
 That doesn't work anymore after upgrading our machine. So, I am not 100% 
 sure if this comes from mapserver, or if there is anything else involved. 
 But it seems more like a mapserver problem, as the error-message is
 
 ServiceException
 msDrawMap(): Image handling error. Failed to draw layer named 
 #39;capitals_selected#39;.
 msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  
 syntax error at or near quot;%quot;
 LINE 1: ...als.gid FROM capitals WHERE capitals.id_country = %id_countr...
 ^
 
 msValidateParameter(): Regular expression error. Parameter pattern 
 validation failed.
 msValidateParameter(): Regular expression error. Parameter pattern 
 validation failed.
 msValidateParameter(): Regular expression error. Parameter pattern 
 validation failed.
 msValidateParameter(): Regular expression error. Parameter pattern 
 validation failed.
 /ServiceException
 
 
 Thanks for any hints/clarification.
 
 Stefan
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 
 
 -- 
 
 NEWS:
 - GO Mobile - jetzt WebGIS auch auf Smartphones
 - Bald OpenSource! SHOGun - das JavaBackend für WebGIS Anwendungen
 
 
 
 terrestris GmbH  Co. KG
 Puetzchens Chaussee 56
 53227 Bonn
 Germany
 
 Till Adams
 Geschaeftsfuehrung
 
 Tel:  +49 (0)228 / 962 899-52
 Mobile:   +49 (0)151 / 25394429
 Fax:  +49 (0)228 / 962 899-57
 
 ad...@terrestris.de
 http://www.terrestris.de
 Amtsgericht Bonn, HRA 6835
 
 
 Komplementaerin:
 
 terrestris Verwaltungs GmbH
 
 vertreten durch:
 Hinrich Paulsen, Till Adams
 ___
 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] getShape failing; changes from mapserver 5.6 to 6.0

2012-08-06 Thread Stefan Schwarzer
Thanks a lot, Steve.

However, I had tried this out before, but getResult($)? I think this is Perl, 
no? In PHP this would be different? 

Sorry for a dumb question…

Stefan

 The query code underwent major changes between 5.6 and 6.0 and one casualty 
 was query processing like you're doing. On the bright side it's much more 
 straight forward now. The general steps for a layer-based query is now just:
 
 $layer-queryByRect($map, $rect); # layer is left open after a query operation
 
 for($i=0; $i$layer-getNumResults(); $i++) {
   $shape = $layer-getShape($layer-getResult($)); # much simpler
   # do something with the shape
 }
 
 I see the MapScript/Swig query docs are woefully out of date. I'll file a 
 ticket on that...
 
 Steve
 
 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Stefan Schwarzer
 Sent: Friday, August 03, 2012 6:37 AM
 To: mapserver-users@lists.osgeo.org
 Subject: [mapserver-users] getShape failing; changes from mapserver 5.6 to 6.0
 
 Hi there,
 
 I am struggling with a few changes I need to go through in order to make my 
 code working now with mapserver 6.x. This one concerns the query part, when a 
 user clicks on the map and a window with some metadata is being displayed.
 
 An error message occurred:
 
   Catchable fatal error: Argument 1 passed to layerObj::getShape() must 
 be an instance of resultObj, integer given
 
 When I changed the getShape command as indicated here [1], it says:
 
   Fatal error: Call to a member function getShape() on a non-object
 
 
 This is the code:
 
   //Query the Map at the point clicked
   if (!$imgbox)
   @$a = $map - queryByPoint($click_pt, MS_MULTIPLE, -1);
   else
   $a = $map - queryByRect($click_rt);
 
   if ($a == MS_SUCCESS)
   {
 
   $numResults = $Layer - getNumResults();
   $oLayer = $map - getLayer($Layer - index);
 
   // Open layer's table... take the list of fields to display 
 from 
   // the HEADERRESULT_FIELDS metadata in the layer object.
   $oLayer - open();
 
   $oRes = $oLayer - getResult(0);
   //$oShape = $oLayer - 
 getShape($oRes-tileindex,$oRes-shapeindex);// before
   $oShape = $layer - getShape($oLayer - getResult(0));  
 // now ??
   
   
   while(list($key, $val) = each($oShape - values))
   {
   //echo br /x - .count($selFields). - .$key .  =  . 
 $val;
   if (($key  META_DATA) AND ($key  oid) AND ($key 
  id) AND ($key  uid))
   $selFields[count($selFields)] = $key;
   }
 
 
 
 Not sure what I should put there...
 
 Thanks for any hints,
 
 Stefan
 
 
 [1] http://mapserver.org/MIGRATION_GUIDE.html
 ___
 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] getShape failing; changes from mapserver 5.6 to 6.0

2012-08-03 Thread Stefan Schwarzer
Hi there,

I am struggling with a few changes I need to go through in order to make my 
code working now with mapserver 6.x. This one concerns the query part, when a 
user clicks on the map and a window with some metadata is being displayed.

An error message occurred:

Catchable fatal error: Argument 1 passed to layerObj::getShape() must 
be an instance of resultObj, integer given

When I changed the getShape command as indicated here [1], it says:

Fatal error: Call to a member function getShape() on a non-object


This is the code:

//Query the Map at the point clicked
if (!$imgbox)
@$a = $map - queryByPoint($click_pt, MS_MULTIPLE, -1);
else
$a = $map - queryByRect($click_rt);

if ($a == MS_SUCCESS)
{

$numResults = $Layer - getNumResults();
$oLayer = $map - getLayer($Layer - index);

// Open layer's table... take the list of fields to display 
from 
// the HEADERRESULT_FIELDS metadata in the layer object.
$oLayer - open();

$oRes = $oLayer - getResult(0);
//$oShape = $oLayer - 
getShape($oRes-tileindex,$oRes-shapeindex);// before
$oShape = $layer - getShape($oLayer - getResult(0));  
// now ??


while(list($key, $val) = each($oShape - values))
{
//echo br /x - .count($selFields). - .$key .  =  . 
$val;
if (($key  META_DATA) AND ($key  oid) AND ($key 
 id) AND ($key  uid))
$selFields[count($selFields)] = $key;
}



Not sure what I should put there…

Thanks for any hints,

Stefan


[1] http://mapserver.org/MIGRATION_GUIDE.html
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] php_mapscript not being loaded

2012-07-12 Thread Stefan Schwarzer
 And the php -i it spitting out a long list, but no errors.
 
 I have actually all PHP, GD, …, Mapserver from Kyngchaos. So, one single 
 source. But strange enough, every computer seems different, and I ran into 
 a couple of challenges.
 
 I wonder if Apache is still using the system PHP?  The PHP version at the 
 top of phpinfo() should match what you installed (OS X 10.7 system PHP is 
 5.3.10, on 10.6 is 5.3.8).
 
 Also, if the Apache log doesn't have anything, look at Console.app to see 
 if there are any system errors (maybe it can't load a needed library).
 
 Ha, good one. Thanks a lot! Indeed, the phpinfo shows 5.3.8, the php -i 
 shows 5.3.10. I am on OS X 10.7, however. 
 
 What does that mean? I have a mixture of 10.6 and 10.7 on my machine? I have 
 my Snow Leopard still installed on a spearate drive in the machine; does 
 Apache load the php from there?
 
 My PHP installer is supposed to switch the PHP, but sometimes it doesn't.  
 Possibly because the apache config file was altered in a way to break my 
 grep.  System updates are not supposed to change the apache config, but it's 
 a possibility.
 
 You can try running the script manually from the PHP disk image:
 
  sudo /Volumes/PHP\ 5/phpenable.sh cgi5
 
 then
 
  sudo apachectl graceful

Thanks so much. Although it didn't solve the problem, I checked again the php 
-i, and then the /usr/local/php5cgi/bin/php -i, as I recognized there were 
still two different versions. And suddenly saw that error message, mapserver 
which doesn't match the cairo framework. I guess that after the first 
installation a few weeks ago, I newly installed mapserver; but the version had 
changed meanwhile, and required another Cairo version too. Gosh, complicated 
this stuff. Now, it works. Thanks to everybody for the useful tips!

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


Re: [mapserver-users] php_mapscript not being loaded

2012-07-10 Thread Stefan Schwarzer
 
 And the php -i it spitting out a long list, but no errors.
 
 The important point with that 'php -i' command is if it contains a
 'mapscript' section; then compare those results through Apache (does a
 'phpinfo.php' file through your browser display a section for
 'mapscript') - these are the issues to check.  Often, I'll be able to
 load mapscript through the commandline, but Apache cannot - and this
 will show you where you need to spend your time/effort.

Ah, thanks for clarifying. But no, there are two map incidences, but they 
refer to Protocols (such as ftp, http…)


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


Re: [mapserver-users] php_mapscript not being loaded

2012-07-10 Thread Stefan Schwarzer
 And the php -i it spitting out a long list, but no errors.
 
 I have actually all PHP, GD, …, Mapserver from Kyngchaos. So, one single 
 source. But strange enough, every computer seems different, and I ran into a 
 couple of challenges.
 
 I wonder if Apache is still using the system PHP?  The PHP version at the top 
 of phpinfo() should match what you installed (OS X 10.7 system PHP is 5.3.10, 
 on 10.6 is 5.3.8).
 
 Also, if the Apache log doesn't have anything, look at Console.app to see if 
 there are any system errors (maybe it can't load a needed library).

Ha, good one. Thanks a lot! Indeed, the phpinfo shows 5.3.8, the php -i shows 
5.3.10. I am on OS X 10.7, however. 

What does that mean? I have a mixture of 10.6 and 10.7 on my machine? I have my 
Snow Leopard still installed on a spearate drive in the machine; does Apache 
load the php from there?
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] php_mapscript not being loaded

2012-07-10 Thread Stefan Schwarzer

On Jul 10, 2012, at 4:15 PM, Stefan Schwarzer wrote:

 And the php -i it spitting out a long list, but no errors.
 
 I have actually all PHP, GD, …, Mapserver from Kyngchaos. So, one single 
 source. But strange enough, every computer seems different, and I ran into 
 a couple of challenges.
 
 I wonder if Apache is still using the system PHP?  The PHP version at the 
 top of phpinfo() should match what you installed (OS X 10.7 system PHP is 
 5.3.10, on 10.6 is 5.3.8).
 
 Also, if the Apache log doesn't have anything, look at Console.app to see if 
 there are any system errors (maybe it can't load a needed library).
 
 Ha, good one. Thanks a lot! Indeed, the phpinfo shows 5.3.8, the php -i shows 
 5.3.10. I am on OS X 10.7, however. 
 
 What does that mean? I have a mixture of 10.6 and 10.7 on my machine? I have 
 my Snow Leopard still installed on a spearate drive in the machine; does 
 Apache load the php from there?

It says in php -i:

Configuration File (php.ini) Path = /etc
Loaded Configuration File = (none)
Scan this dir for additional .ini files = (none)
Additional .ini files parsed = (none)

The php.ini is in /usr/local/php5cgi/lib/php.ini

So, what should I do? Thanks for any hints! I see slowly light at the end of 
the tunnel….
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] php_mapscript not being loaded

2012-07-09 Thread Stefan Schwarzer
 But hadn't tested mapserver yet… Did all the installation with the latest 
 Kyngchaos libraries.
 
 Running  http://localhost/testphp.php;; but don't see any mapserver or 
 mapscript. Nothing in there.
 
 There is a php_mapscript.so in 
 /usr/local/php5cgi/lib/php/extensions/no-debug-non-zts-20090626. I added 
 extension = php_mapscript.so to php.ini, as well as extension_dir = 
 /usr/local/php5cgi/lib/php/extensions.
 
 No need to set extension_dir, it defaults to the correct dir, which is not 
 as you set it but includes the no-debug... subdir.
 
 Restarted the server, sudo /usr/sbin/apachectl restart.
 
 graceful is all that's needed: sudo apachectl graceful, but it probably 
 doesn't matter.
 
 But still no Mapscript in testphp.php… Did it really restart and load 
 php.ini now?. Any way to check that? It should work that way, no?
 
 No, indeed, didn't matter. Still no mapserver/mapscript appearing in 
 testphp.php. Had added extension=php_mapscript.so to php.ini before 
 already.
 
 What can I do? Thanks for any hints, as I am really stuck!
 
 
 Whenever I get this stuck with loading mapscript, I try to:
 
 - execute the php executable directly (php -i) and look for an error
 message, sometimes it is at the bottom of that generated page
 - check the Apache error logs (error.log)
 
 I have seen this problem when users grab PHP from one location, and then
 download PHP MapScript from another location - that will make your hair
 go grey.

Thanks for those hints. But unfortunately, nothing. I checked the Apache error 
log before, and there is nothing there. At least nothing I think is important. 
I guess the MaxClients thing is not causing my mapsever to not appear, no?

[Tue Jul 10 07:09:58 2012] [notice] caught SIGTERM, shutting down
[Tue Jul 10 07:09:59 2012] [warn] Init: Session Cache is not configured [hint: 
SSLSessionCache]
WARNING: MaxClients of 150 exceeds ServerLimit value of 133 servers,
 lowering MaxClients to 133.  To increase, please see the ServerLimit
 directive.
[Tue Jul 10 07:10:01 2012] [warn] mod_bonjour: Skipping user 'xxx' - no valid 
index file.
[Tue Jul 10 07:10:01 2012] [notice] Digest: generating secret for digest 
authentication ...
[Tue Jul 10 07:10:01 2012] [notice] Digest: done
[Tue Jul 10 07:10:01 2012] [notice] Apache/2.2.21 (Unix) mod_ssl/2.2.21 
OpenSSL/0.9.8r DAV/2 configured -- resuming normal operations


And the php -i it spitting out a long list, but no errors.

I have actually all PHP, GD, …, Mapserver from Kyngchaos. So, one single 
source. But strange enough, every computer seems different, and I ran into a 
couple of challenges.

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


Re: [mapserver-users] php_mapscript not being loaded

2012-07-08 Thread Stefan Schwarzer

 But hadn't tested mapserver yet… Did all the installation with the latest 
 Kyngchaos libraries.
 
 Running  http://localhost/testphp.php;; but don't see any mapserver or 
 mapscript. Nothing in there.
 
 There is a php_mapscript.so in 
 /usr/local/php5cgi/lib/php/extensions/no-debug-non-zts-20090626. I added 
 extension = php_mapscript.so to php.ini, as well as extension_dir = 
 /usr/local/php5cgi/lib/php/extensions.
 
 No need to set extension_dir, it defaults to the correct dir, which is not as 
 you set it but includes the no-debug... subdir.
 
 Restarted the server, sudo /usr/sbin/apachectl restart.
 
 graceful is all that's needed: sudo apachectl graceful, but it probably 
 doesn't matter.
 
 But still no Mapscript in testphp.php… Did it really restart and load 
 php.ini now?. Any way to check that? It should work that way, no?

No, indeed, didn't matter. Still no mapserver/mapscript appearing in 
testphp.php. Had added extension=php_mapscript.so to php.ini before already.

What can I do? Thanks for any hints, as I am really stuck!


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


[mapserver-users] php_mapscript not being loaded

2012-07-05 Thread Stefan Schwarzer
Hi there,

I thought I would have finally got over with all the errors while installing 
everything anew (php, apache, postgres, mapserver). But hadn't tested mapserver 
yet… Did all the installation with the latest Kyngchaos libraries.

Running  http://localhost/testphp.php;; but don't see any mapserver or 
mapscript. Nothing in there.

There is a php_mapscript.so in 
/usr/local/php5cgi/lib/php/extensions/no-debug-non-zts-20090626. I added 
extension = php_mapscript.so to php.ini, as well as extension_dir = 
/usr/local/php5cgi/lib/php/extensions. Restarted the server, sudo 
/usr/sbin/apachectl restart. But still no Mapscript in testphp.php… Did it 
really restart and load php.ini now?. Any way to check that? It should work 
that way, no?

Thanks for any help!


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


[mapserver-users] Re: How to use moveLayerUp

2010-07-12 Thread Stefan Schwarzer


Daniel Morissette wrote:
 
 Have a look at the mapObj's getlayersdrawingorder() and
 setlayersdrawingorder() methods

Hmm... searched around, but couldn't really find a working example. Seems
that hardly anyone is using these calls - or not facing problems with
them...

I do understand a little bit what this calls are supposed to do, but don't
really see how to implement this. And especially, because I want only one
layer to be moved to the top. Seems to me that a moveLayerUp would make
sense here.

Thanks a lot if anyone could give me a link or a piece of code for a working
example.
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/How-to-use-moveLayerUp-tp5273561p5286068.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] How to use moveLayerUp

2010-07-09 Thread Stefan Schwarzer
Hi,

I am working with PHP Mapscript. I would like to move in some secific cases a 
layer up so that it gets drawn after all the other layers have been drawn.

I searched quite some time, but couldn't find any example that would show me 
how to implement this. Can anyone give me a hint?

Thanks a lot,

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


[mapserver-users] GetFeatureInfo returns no results. Why?

2010-05-18 Thread Stefan Schwarzer

Hi there,

I am having problems getting a correct GetFeatureInfo from my WMS.  
The URL looks fine, but I get this message:

GetFeatureInfo results: Search returned no results.

The WMS works well:

http://metafunctions.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/htdocs/mod_map/geo_wms_complete_last_year.map;
service=wms
version=1.1.1
request=getmap
format=image/png
width=900
height=450
srs=EPSG:4326
bbox=-180,-90,180,90
layers=co2_gdp

The GetFeatureInfo looks like this:

http://metafunctions.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/htdocs/mod_map/geo_wms_complete_last_year.map;
version=1.1.1
request=getfeatureinfo
width=900
height=450
srs=EPSG:4326
bbox=-180,-90,180,90
x=9.5y=50
query_layers=co2_gdp
layers=co2_gdp

It should return the value for Germany. Here is the MAPserver code:
   LAYER
NAME co2_gdp
METADATA
'wms_title' 'Emissions of CO2 per  
GDP (PPP)'

'wms_timeextent'  '2006'
'wms_extent' '-180 -90 180 90'
   END # METADATA
PROJECTION
'init=epsg:4326'
END
STATUS OFF
CONNECTIONTYPE postgis
CONNECTION 'xxx'
TYPE POLYGON
DATA the_geom FROM 
TEMPLATE 'dummy'
DUMP TRUE
CLASSITEM 'value'
..

Do I need to add something? Thanks for any adivce,

Stefan


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


[mapserver-users] Re: GetFeatureInfo returns no results. Why?

2010-05-18 Thread Stefan Schwarzer

Ahh Included the wms_include_items and works well. And then, the X/Y are
in pixels? Not in DD? Hmmm Wasn't clear to me. Thanks a lot!
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/GetFeatureInfo-returns-no-results-Why-tp5068753p5068921.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] loadLayer(): Unknown iden tifier. Parsing error near (â):(line 662128)

2010-05-18 Thread Stefan Schwarzer

Hi there,

as far as I know there is no limit in respect to the numbers of layers  
in the mapfile anymore, no? We're running 5.2.1, and it seems that  
somewhere between 45 and 50 layers, it returns me that error. Anyone  
knows why? Anything I can do?


Thanks for any tips!

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


[mapserver-users] Re: loadLayer(): Unknown ide ntifier. Parsing error near (â):(line 662128)

2010-05-18 Thread Stefan Schwarzer


Lars Lingner-2 wrote:
 
 Do you have some special characters in your layer names or other
 specifiers? Like â ?
 

No, everything plain english!
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/loadLayer-Unknown-identifier-Parsing-error-near-a-line-662128-tp5069081p5069168.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] Re: loadLayer(): Unknown ide ntifier. Parsing error near (â):(line 662128)

2010-05-18 Thread Stefan Schwarzer

Ok, after thorough testing it seems indeed to be one special character there
(although not an â). Cheers.
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/loadLayer-Unknown-identifier-Parsing-error-near-a-line-662128-tp5069081p5069522.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] Query Unique Values in Mapfile?

2009-04-06 Thread Stefan Schwarzer

Hi there,

is it possible to make mapserver directly detect the unique values  
in a field of the dbf table? I have twenty or more point and polygon  
shapefiles, each having a column with specific thematic data, such as  
the protected area category. But the content of these columns is  
different. So, defining these classes by hand would consume much time;  
and defining them dynamically via PHP  SQL, then writing a bit of the  
mapfile code before launching the whole thing looks a little bit  
complicated for a relative basic request.


Thanks for any hints,

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


[mapserver-users] Strange Postgis/Mapserver SQL behaviour

2009-03-20 Thread Stefan Schwarzer

Hi there,

I have a unfortunately rather complex query for my postgis layers.

But if I take the SQL and insert it into PgAdmin, I get what I want: a  
table with the_geom, name, value, uid.


But when using this query in the map file, I suddenly get an error  
message:


Warning: [MapServer Error]: prepare_database(): Error declaring  
cursor: ERROR: syntax error at end of input LINE  
2: ...D(-180.200445434298 -90,180.200445434298 90)'::BOX3D, 4326 ) ^  
With query string: DECLARE mycursor BINARY CURSOR FOR SELECT  
value 
::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),uid::text  
from ( SELECT * FROM (SELECT sub1.* FROM ( SELECT r.the_geom, r.name,  
COALESCE(SUM(d.value), -) AS value, r.id AS uid FROM cereals_yield  
AS d RIGHT JOIN countries_view AS c ON c.id = d.id_country RIGHT JOIN  
subregions AS r ON r.id = c.sreg_id WHERE d.year_start = 2006 GROUP BY  
r.name, r.the_geom, r.id ) AS sub1 LEFT JOIN ( SELECT * FROM  
crosstab( 'SELECT r.name AS name,	 d.year_start AS year, SUM(d.value *  
d_nom.value) / SUM(d_nom.value) AS value	 FROM in_cereals_yield AS d  
RIGHT JOIN countries_view AS c ON c.id = d.id_country RIGHT JOIN  
rice_harvested AS d_nom ON d_nom.id_country = d.id_country RIGHT JOIN  
subregions AS r ON r. in /www/geodataportal/htdocs/mod_map/map.php on  
line 1331



Here is the query:

SELECT * FROM (SELECT sub1.* FROM ( SELECT r.the_geom, r.name,  
COALESCE(SUM(d.value), -) AS value, r.id AS uid FROM cereals_yield  
AS d RIGHT JOIN countries_view AS c ON c.id = d.id_country RIGHT JOIN  
subregions AS r ON r.id = c.sreg_id WHERE d.year_start = 2006 GROUP BY  
r.name, r.the_geom, r.id ) AS sub1 LEFT JOIN ( SELECT * FROM  
crosstab( 'SELECT r.name AS name,	 d.year_start AS year, SUM(d.value *  
d_nom.value) / SUM(d_nom.value) AS value	 FROM in_cereals_yield AS d  
RIGHT JOIN countries_view AS c ON c.id = d.id_country RIGHT JOIN  
rice_harvested AS d_nom ON d_nom.id_country = d.id_country RIGHT JOIN  
subregions AS r ON r.id = c.sreg_id WHERE (d.year_start = 2003 ) AND  
(d_nom.year_start = 2003 ) AND d_nom.value  0 GROUP BY r.name,  
d.year_start ORDER BY 1,2;', 3) AS ct(name varchar, y_2003 numeric)	  
ORDER BY 2 NULLS LAST ) AS sub2 ON sub2.name = sub1.name) AS foo



And within the mapfile I attach a USING UNIQUE uid USING srid=4326  
to the query.



Can anyone give me a hint what the problem might be?

Thanks for any adive!

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


[mapserver-users] querybypoint a postgis db with php mapscript

2008-08-26 Thread Stefan Schwarzer

Hi there,

I guess there is something I am doing wrong. I think that since I  
moved from shapefiles to postgis, my query (bypoint/byrect) doesn't  
work anymore. Is there anything I have to change? I am kind of  
frustrated, because if looked around everywhere to find the problem;  
this issue has cost me hours over hours, but nothing in sight


My code looks like this:

//Set the layers status ON (b/c it might not be...)
$Layer - set(status, 1);

$ImgWidth = $map - width;
$ImgHeight = $map - height;
$x = (($ptX / $ImgWidth) * ($ext3 - $ext1)) + $ext1;
$y = $ext4 - (($ptY / $ImgHeight) * ($ext4 - $ext2));

$x1 = (($extent_px0 / $ImgWidth) * ($ext3 - $ext1)) + $ext1;
$y1 = $ext4 - (($extent_px1 / $ImgHeight) * ($ext4 - $ext2));
$x2 = (($extent_px2 / $ImgWidth) * ($ext3 - $ext1)) + $ext1;
$y2 = $ext4 - (($extent_px3 / $ImgHeight) * ($ext4 - $ext2));

$click_pt = ms_newPointObj();
$click_pt - setXY($x, $y);

$click_rt = ms_newRectObj();
$click_rt - setextent($x1, $y2, $x2, $y1);


//Query the Map at the point clicked
if (!$imgbox)
$a = $map - queryByPoint($click_pt, MS_MULTIPLE, -1);
else
$a = $map - queryByRect($click_rt);






And my mapfile like this:

 LAYER
NAME floods_killed
STATUS ON
CONNECTIONTYPE postgis
CONNECTION 'user=xxx password=xxx dbname='
TYPE POLYGON
DATA the_geom FROM
(
SELECT
c.the_geom,
c.name,
COALESCE(d.value, -) AS 
value,
d.id_country AS uid
FROM
floods_killed AS d
RIGHT JOIN
countries AS c ON c.id = 
d.id_country
WHERE
d.year_start = 2007 AND
c.id = d.id_country
) AS foo USING UNIQUE uid USING 
srid=4326
 LABELITEM value
CLASSITEM 'value'
CLASS
NAME ''
EXPRESSION ([value]=-10001)
TEMPLATE 'empty space'
END  # CLASS
CLASS
NAME 'Units: Number of People'
EXPRESSION ([value]=-110003)
TEMPLATE 'units as title in legend'
END  # CLASS


Thanks for any hints!

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


[mapserver-users] Add Content to the Legend

2008-07-21 Thread Stefan Schwarzer

Hi there,

I would like to add information about the Units of the selected  
variable into the legend. When using vector data, this wasn't really  
the problem. I kind of faked empty classes to insert that information.


But now, I wonder how to achieve this when using TIF images. As the  
TIF is already color coded and regrouped into a couple of classes,  
using faked CLASS values, results in the display of zero pixels -  
nothing is being displayed.


Is there another way to slip in some information into the legend? Or  
is the HTML legend the only alternative?


Thanks for any hints,

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


[mapserver-users] queryByPoint + PostGIS layers + USING statement

2008-07-21 Thread Stefan Schwarzer

Hi there,

it seems that it's mandatory for postgis layers to use the USING  
statement in the query.


My layer parameters look a bit like this:

	DATA 'the_geom FROM ( SELECT  FROM xxx LEFT JOIN  WHERE xxx)  
AS foo USING UNIQUE uid USING srid=4326) '


But nevertheless, mapserver doesn't like it...

Can anyone give me a hint what is wrong with that?

Thanks for any advice,

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


[mapserver-users] queryByPoint problem - rien ne va plus

2008-07-08 Thread Stefan Schwarzer

Hi there,

I have a script to query my layers by point or rectangle, which used  
to run smoothly. But now, don't know what happened... I updated from  
an old mapserver version to a recent one. Is it that? I have no idea.


Here is the code which I use. When it reaches the bottom part with the  
queryByPoint it stalls...


Thanks for any help!

Stef


//Get the Layer being queried
$Layer = $map - GetLayerByName($lyr_name);

//Set the layers status ON (b/c it might not be...)
$Layer - set(status, 1);

$ImgWidth = $map - width;
$ImgHeight = $map - height;
$x = (($ptX / $ImgWidth) * ($ext3 - $ext1)) + $ext1;
$y = $ext4 - (($ptY / $ImgHeight) * ($ext4 - $ext2));

$x1 = (($extent_px0 / $ImgWidth) * ($ext3 - $ext1)) + $ext1;
$y1 = $ext4 - (($extent_px1 / $ImgHeight) * ($ext4 - $ext2));
$x2 = (($extent_px2 / $ImgWidth) * ($ext3 - $ext1)) + $ext1;
$y2 = $ext4 - (($extent_px3 / $ImgHeight) * ($ext4 - $ext2));

$click_pt = ms_newPointObj();
$click_pt - setXY($x, $y);

$click_rt = ms_newRectObj();
$click_rt - setextent($x1, $y2, $x2, $y1);


//Query the Map at the point clicked
if (!$imgbox)
$a = $map - queryByPoint($click_pt, MS_MULTIPLE, -1);
else
$a = $map - queryByRect($click_rt);
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] queryByPoint still valid?

2008-05-15 Thread Stefan Schwarzer
hmm... I changed a couple of things in my application: new template  
engine; moved from PHP4 to PHP5; and from mapserver 4.x to mapserver  
5.x


Now, the identify feature (click on a country and give me some  
info about it), has problems


Is anything wrong with these lines?


//Query the Map at the point clicked
if (!$imgbox)
$a = $map - queryByPoint($click_pt, MS_MULTIPLE, -1);
else
$a = $map - queryByRect($click_rt);


Could anyone give me a hint what would be wrong with these lines? It  
seems that mapserver doesn't like it. But it doesn't spit out any  
error message. It just stops working... And after the doc, these  
commands should be quite alright.


Thanks a lot,

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


[mapserver-users] getCapabilities problems

2008-05-13 Thread Stefan Schwarzer

Hi there,

my getCapabilities request seems to have a problem... But I have no  
idea why. I've reduced the whole thing on a couple of lines (see  
below), but still it doesn't work. Can anyone give me a hint why that  
would be?


Thanks for any suggestion!

Stef




http://gridca.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/htdocs/mod_map/geo_wms.mapservice=wmsversion=1.1.1request=getcapabilities



# Map definition -

NAME geo_wms.map
STATUS ON
SIZE 600 300
EXTENT -180 -90 180 90
UNITS DD
IMAGECOLOR 255 255 255
SHAPEPATH '/www/geodataportal/htdocs/../data'
FONTSET '/www/geodataportal/htdocs/mod_map/etc/fonts.txt'
SYMBOLSET '/www/geodataportal/htdocs/mod_map/etc/symbols.sym'

# End Map definition -




# Projection definition -

PROJECTION
'init=epsg:4326'
END

# End Projection definition -




# Web definition -

WEB
IMAGEPATH '/www/geodataportal/temp/'
IMAGEURL 'http://gridca.grid.unep.ch/geodataportal/temp/'
METADATA
'wms_title'  'GEO Data Portal WMS Server'
'wms_service_onlineresource' 
'http://gridca.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/htdocs/mod_map/geo_wms.map;'
'wms_srs''EPSG:4326'
'wms_getfeatureinfo' 
'http://gridca.grid.unep.ch/cgi-bin/mapserv?map=/www/geodataportal/htdocs/mod_map/geo_wms.map;'
'wms_featureinfoformat'  'text/plain'
END
END

# End Web definition -


END # Map File


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


Re: [mapserver-users] getCapabilities problems

2008-05-13 Thread Stefan Schwarzer
my getCapabilities request seems to have a problem... But I have no  
idea why. I've reduced the whole thing on a couple of lines (see  
below), but still it doesn't work. Can anyone give me a hint why  
that would be?


so, it seems to be correct; it just doesn't display the XML file in my  
browser(s) (Safari, Firefox)...

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


[mapserver-users] queryByPoint still valid?

2008-04-23 Thread Stefan Schwarzer

Hi,

hmm... I changed a couple of things in my application: new template  
engine; moved from PHP4 to PHP5; and from mapserver 4.x to mapserver 5.x


Now, the identify feature (click on a country and give me some info  
about it), has problems


Is anything wrong with these lines?


//Query the Map at the point clicked
if (!$imgbox)
$a = $map - queryByPoint($click_pt, MS_MULTIPLE, -1);
else
$a = $map - queryByRect($click_rt);

Thanks for any hints,

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


[mapserver-users] WMS with selected country rectangle box display?

2008-04-21 Thread Stefan Schwarzer

Hi there,

we have developed a WMS which receives a parameter for a selected  
country, producing a map which highlights the selected country, and  
masks a bit the neighboring ones. Now, I would like to create in  
conjunction with this one another WMS, which shows the world as a  
whole, and - as any overview map is doing - displays just a rectangle  
to locate the selected country on the map.


Is this possible as WMS? I have no idea how this would work...

Thanks for any hints,

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


[mapserver-users] How to tile a large TIF image?

2008-04-18 Thread Stefan Schwarzer

Hi there,

I would like to use instead of single large tif image smaller tiles.  
Although I am well aware of mapserver's and gdal's possibilities to  
create the shapes for it, I first need to split the large tif into  
20 or 50 or 100 tiles.


Can anyone give me a hint with what kind of software this is possible?

There is an ArcGIS script, but it doesn't work on my machine ( http://arcscripts.esri.com/details.asp?dbid=13978 
 ).


Thanks for any hints,

Stef

 

  Stefan Schwarzer

  Lean Back and Relax - Enjoy some Nature Photography
  http://photoblog.la-famille-schwarzer.de

  Appetite for Global Data? UNEP GEO Data Portal:
  http://geodata.grid.unep.ch
  






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


Re: [mapserver-users] How to tile a large TIF image?

2008-04-18 Thread Stefan Schwarzer

Thanks for the info.

Did it like this:

Library/Frameworks/GDAL.framework/Versions/1.5/Programs/gdal_translate  
-outsize 10'' 10'' -co TILED=YES gebco/bathymetry.tif gebco/ 
bathymetry_tiled.tif


But get the message: Segmentation fault

Anything that I did wrong? Or should do differently?

Thanks for a hint,

Stef


Hi,

Gdal_translate program has options for you:

c:\FWToolsgdal_translate
Usage: gdal_translate [--help-general]
   [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
 CInt16/CInt32/CFloat32/CFloat64}] [-strict]
   [-of format] [-b band] [-outsize xsize[%] ysize[%]]
   [-scale [src_min src_max [dst_min dst_max]]]
   [-srcwin xoff yoff xsize ysize] [-projwin ulx uly lrx lry]
   [-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value]
   [-gcp pixel line easting northing [elevation]]*
   [-mo META-TAG=VALUE]* [-quiet] [-sds]
   [-co NAME=VALUE]*
   src_dataset dst_dataset

By playing with -srcwin or possibly with -outsize and -projwin you  
should be able to split your image as you wish.  Read more from

http://gdal.org/gdal_translate.html

-Jukka Rahkonen-



Lähettäjä: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
] Puolesta Stefan Schwarzer

Lähetetty: 18. huhtikuuta 2008 12:05
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] How to tile a large TIF image?

Hi there,

I would like to use instead of single large tif image smaller tiles.  
Although I am well aware of mapserver's and gdal's possibilities to  
create the shapes for it, I first need to split the large tif into  
20 or 50 or 100 tiles.


Can anyone give me a hint with what kind of software this is possible?

There is an ArcGIS script, but it doesn't work on my machine ( http://arcscripts.esri.com/details.asp?dbid=13978 
 ).


Thanks for any hints,

Stef

 

  Stefan Schwarzer

  Lean Back and Relax - Enjoy some Nature Photography
  http://photoblog.la-famille-schwarzer.de

  Appetite for Global Data? UNEP GEO Data Portal:
  http://geodata.grid.unep.ch
  








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


Re: [mapserver-users] How to tile a large TIF image?

2008-04-18 Thread Stefan Schwarzer
Thanks a lot for these details. That should be added to the existing  
documents!


But unfortunately I still get a Segmentation fault message...

Stef


Stefan,

I don't think you can specify 10'', you need something in pixels.   
But the command is also probably not what you really need to do.


More likely, you should be doing the following:

gdal_translate -co TILED=YES gebco/bathymetry.tif gebco/ 
bathmetry_tiled.tif


This will create a single tif file that has an internal block size  
of 256x256 - you can think of this as having broken your tif up into  
256x256 tiles but keeps them all within the same file.  This is  
equivalent to breaking the tif up into individual files, creating a  
shapefile that has rectangles for each individual files' extent, and  
using that as a tile index in mapserver.


Next, you want to do this:

gdaladdo gebco/bathymetry.tif 2 4 6 8 16

this will pre-compute smaller versions of the tif image called  
overviews at 1/2, 1/4 1/6 1/8 and 1/16 of the original size of the  
tif - this makes it much more efficient for gdal to return exactly  
what mapserver is asking for at any given scale.  Depending on the  
range of scales that you need to display your raster image at, you  
can add more overview levels (or take some away).


With this two commands, you can make your rasters much more  
efficient for mapserver and probably avoid the need to split them up  
into many files.


It does make the file somewhat larger.  If you are working with very  
large files (  4GB ) then you may run into some problems with tiff  
and may need to investigate another format or a compressed format  
like ECW or MrSID (both requiring commercial licenses I believe).


There are also some built in compression schemes for tiffs in gdal  
which you can apply when running gdal_translate (see http://www.gdal.org/frmt_gtiff.html 
 for creation options), for instance:


gdal_translate -co TILED=YES -co COMPRESS=JPEG -co  
JPEG_QUALITY=80 gebco/bathymetry.tif gebco/bathmetry_tiled.tif


would compress the tif using JPEG compression (lossy) set to 80%  
(low compression, small loss).


Cheers

Paul



On 18-Apr-08, at 5:47 AM, Stefan Schwarzer wrote:

Thanks for the info.

Did it like this:

Library/Frameworks/GDAL.framework/Versions/1.5/Programs/ 
gdal_translate -outsize 10'' 10'' -co TILED=YES gebco/ 
bathymetry.tif gebco/bathymetry_tiled.tif


But get the message: Segmentation fault

Anything that I did wrong? Or should do differently?

Thanks for a hint,

Stef


Hi,

Gdal_translate program has options for you:

c:\FWToolsgdal_translate
Usage: gdal_translate [--help-general]
  [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}] [-strict]
  [-of format] [-b band] [-outsize xsize[%] ysize[%]]
  [-scale [src_min src_max [dst_min dst_max]]]
  [-srcwin xoff yoff xsize ysize] [-projwin ulx uly lrx lry]
  [-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value]
  [-gcp pixel line easting northing [elevation]]*
  [-mo META-TAG=VALUE]* [-quiet] [-sds]
  [-co NAME=VALUE]*
  src_dataset dst_dataset

By playing with -srcwin or possibly with -outsize and -projwin you  
should be able to split your image as you wish.  Read more from

http://gdal.org/gdal_translate.html

-Jukka Rahkonen-



Lähettäjä: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
] Puolesta Stefan Schwarzer

Lähetetty: 18. huhtikuuta 2008 12:05
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] How to tile a large TIF image?

Hi there,

I would like to use instead of single large tif image smaller  
tiles. Although I am well aware of mapserver's and gdal's  
possibilities to create the shapes for it, I first need to split  
the large tif into 20 or 50 or 100 tiles.


Can anyone give me a hint with what kind of software this is  
possible?


There is an ArcGIS script, but it doesn't work on my machine ( http://arcscripts.esri.com/details.asp?dbid=13978 
 ).


Thanks for any hints,

Stef



 Stefan Schwarzer

 Lean Back and Relax - Enjoy some Nature Photography
 http://photoblog.la-famille-schwarzer.de

 Appetite for Global Data? UNEP GEO Data Portal:
 http://geodata.grid.unep.ch
  










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



__

  Paul Spencer
  Chief Technology Officer
  DM Solutions Group Inc
  http://www.dmsolutions.ca/


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


[mapserver-users] Experiences with CartoWeb

2008-04-18 Thread Stefan Schwarzer

Hi there,

we've used mapserver a lot over the last years, in some minor as well  
as some major applications. Now, we're thinking to replace a mapping  
module in a major portal application with cartoweb, in order to avoid  
a duplication of the development of code, of having a more modular  
approach, to facilitate update and maintenance etc.


What are your experiences in using Cartoweb? What are, upon your  
opinion, the major advantages or drawbacks? Anything we should be  
aware of before undergoing such a change in our application?


Thanks for any advices,

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


[mapserver-users] WMS for SRTM ? How to implement?

2008-04-11 Thread Stefan Schwarzer

Hi there,

shouldn't be too complicated to include a WMS into one's own  
mapservice, no? But, don't know why, although I've already done this a  
couple of years ago, I don't succeed in a) finding the right way to  
program the map file code and b) finding a working WMS example. Many  
links are dead ( for example from this site: http://en.giswiki.net/wiki/WMS 
 ), or without instructions.


Can someone point me to a working WMS server and give me a hint how  
the map file layer should look like? I've this here:


LAYER
  NAME modis
  TYPE RASTER
  STATUS ON
  CONNECTION http://onearth.jpl.nasa.gov/browse.cgi?wms_server=wms.cgilayers=modissrs=EPSG:4326 


  CONNECTIONTYPE WMS
  METADATA
wms_srs EPSG:4236
wms_namemodis
wms_format  image/jpeg
  END
END

Thanks for any advice,

Stef

 

  Stefan Schwarzer

  Lean Back and Relax - Enjoy some Nature Photography
  http://photoblog.la-famille-schwarzer.de

  Appetite for Global Data? UNEP GEO Data Portal:
  http://geodata.grid.unep.ch
  






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


[mapserver-users] Mapserver MacPorts - Installation Instructions

2008-04-07 Thread Stefan Schwarzer

Hi there,

is anybody using mapserver with installed macports libs? I would like  
to know what libs I have to install to run correctly mapserver?


I have these so far, but I don't really know if this is correct and  
exhaustive:


sudo port install jpeg
sudo port install libpng
sudo port install flex
sudo port install bison
sudo port install readline
sudo port install lib
sudo port install curl
sudo port install proj
sudo port install geos
sudo port install antigraingeometry

Thanks for any advice,

Stef

 

  Stefan Schwarzer

  Lean Back and Relax - Enjoy some Nature Photography
  http://photoblog.la-famille-schwarzer.de

  Appetite for Global Data? UNEP GEO Data Portal:
  http://geodata.grid.unep.ch
  


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