Re: [mapserver-users] Designing a wrapper around mapserv which can be used with fcgi

2009-11-03 Thread Adrian Popa

Thank you Andy for explaining.

Actually my wrapper is very hard-core, meaning I don't use mapscript 
(because I had to build it quickly and didn't have time to research 
which was the best approach). Now I have more time and I'd like to tune 
things up, so I will definitely start studying mapscript (If you have a 
link to a good tutorial/function reference for it I am in your debt).


My wrapper just copied over a template map file, edited it (rewrites 
some filters) and then it set

$ENV{'QUERY_STRING'} = $ENV{'QUERY_STRING'}.map=$file;

...and then called

print `/var/www/cgi-bin/mapserv`;


It's barbaric, I know, but it worked for me. :)
It will take a bit of rewrite to add fcgi support and mapscript, but in 
the long run it will be more mantainable... :)


Thanks again,
Adrian

Andy Colson wrote:

Andy Colson wrote:

Adrian Popa wrote:

Hello everyone,

I am currently using a wrapper around mapserv which receives the 
URL parameters, builds the map file (actually I only need to set 
some filters in the map file, but the filters need to be built 
after running some SQL queries with the passed in parameters). 
After the map file is built, mapserv is called (as a shell script), 
and the map gets sent to the user. Currently this wrapper is 
written in perl - so it's not terribly fast as a cgi process.


While this approach works, it is terribly inefficient. I would like 
to use mapserv as a fcgi process (or something faster than plain 
cgi). My question is - how can I /should I build a wrapper around 
mapserv that can customize the MAP file on the fly and run as a 
fcgi process?


Any ideas on where I should start? An example of such a wrapper?

Also, I suspect I can send parameters to mapserver and use some 
sort of variables in the map file to set up my filters - but I 
haven't seen an example. Can someone point me to such a documentation?


Thanks,
Adrian


Have you seen mapscript?  You can use mapserver directly from perl.  
And perl can do fast-cgi.  Here is a little, ad-hoc, non-tested, 
perl fcgi:



#!/usr/bin/perl

use strict;
use mapscript;
use FCGI;


my $request = FCGI::Request( );
while($request-Accept() = 0)
{
my($req, $x, $at, $xmap, $xpin, $sid, $y, $q);

$req = new mapscript::OWSRequest();
$req-loadParams();

$xmap = $req-getValueByName('map');
$xpin = $req-getValueByName('pin');

my $map = new mapscript::mapObj( /maps/$xmap.map );
if (! $map)
{
#print STDERR - Error loading map: $xmap.map\n;
print(Content-type: text/text\r\n\r\n);
print cant load $xmap.map;
$request-Finish();
next;
}

mapscript::msIO_installStdoutToBuffer();

$x = $map-OWSDispatch( $req );
if ($x)
{
print STDERR OWSDispatch: $x\n;
my $errObj = new mapscript::errorObj();
while ($errObj) {
print STDERR ERROR: 
$errObj-{code}:$errObj-{message}:$errObj-{routine} \n;

$errObj = $errObj-next();
}
}

my $content_type = 
mapscript::msIO_stripStdoutBufferContentType();


$x = mapscript::msIO_getStdoutBufferBytes();


print(Content-type: $content_type\r\n\r\n);
if (mapscript::msGetVersionInt() = 50500)
{
print $$x;
} else {
print $x;
}

mapscript::msIO_resetHandlers();
$request-Finish();
}



I'd recommend using mapserver 5.6.0.

-Andy





Adrian Popa wrote:
 Thank you,

 I will look into it. I guess through mapscript I can redefine the
 parameters that get sent to mapserver? Or do I rewrite the whole map?



You can load a map into memory (I assume you were already doing that). 
You said ..perl.. receives the URL parameters ...and... builds the 
map file.



I assume your perl does: use mapscript?

and at some point: my $map = new mapscript::mapObj( /maps/$xmap.map );

You kind of imbed mapserver into your perl script, and can call its 
functions and what not.  After you load the map you can do things to 
it, in memory.


In my example above, I'm using the WMS features ($map-OWSDispatch), 
but you can also generate an image:


my $img = $map-draw();
$img-save('x.jpg', $mapscript::MS_JPG);

-Andy




--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


[mapserver-users] Designing a wrapper around mapserv which can be used with fcgi

2009-11-02 Thread Adrian Popa

Hello everyone,

I am currently using a wrapper around mapserv which receives the URL 
parameters, builds the map file (actually I only need to set some 
filters in the map file, but the filters need to be built after running 
some SQL queries with the passed in parameters). After the map file is 
built, mapserv is called (as a shell script), and the map gets sent to 
the user. Currently this wrapper is written in perl - so it's not 
terribly fast as a cgi process.


While this approach works, it is terribly inefficient. I would like to 
use mapserv as a fcgi process (or something faster than plain cgi). My 
question is - how can I /should I build a wrapper around mapserv that 
can customize the MAP file on the fly and run as a fcgi process?


Any ideas on where I should start? An example of such a wrapper?

Also, I suspect I can send parameters to mapserver and use some sort of 
variables in the map file to set up my filters - but I haven't seen an 
example. Can someone point me to such a documentation?


Thanks,
Adrian

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


Re: [mapserver-users] Designing a wrapper around mapserv which can be used with fcgi

2009-11-02 Thread Adrian Popa

Thank you,

I will look into it. I guess through mapscript I can redefine the 
parameters that get sent to mapserver? Or do I rewrite the whole map?


Andy Colson wrote:

Adrian Popa wrote:

Hello everyone,

I am currently using a wrapper around mapserv which receives the URL 
parameters, builds the map file (actually I only need to set some 
filters in the map file, but the filters need to be built after 
running some SQL queries with the passed in parameters). After the 
map file is built, mapserv is called (as a shell script), and the map 
gets sent to the user. Currently this wrapper is written in perl - so 
it's not terribly fast as a cgi process.


While this approach works, it is terribly inefficient. I would like 
to use mapserv as a fcgi process (or something faster than plain 
cgi). My question is - how can I /should I build a wrapper around 
mapserv that can customize the MAP file on the fly and run as a 
fcgi process?


Any ideas on where I should start? An example of such a wrapper?

Also, I suspect I can send parameters to mapserver and use some sort 
of variables in the map file to set up my filters - but I haven't 
seen an example. Can someone point me to such a documentation?


Thanks,
Adrian


Have you seen mapscript?  You can use mapserver directly from perl.  
And perl can do fast-cgi.  Here is a little, ad-hoc, non-tested, perl 
fcgi:



#!/usr/bin/perl

use strict;
use mapscript;
use FCGI;


my $request = FCGI::Request( );
while($request-Accept() = 0)
{
my($req, $x, $at, $xmap, $xpin, $sid, $y, $q);

$req = new mapscript::OWSRequest();
$req-loadParams();

$xmap = $req-getValueByName('map');
$xpin = $req-getValueByName('pin');

my $map = new mapscript::mapObj( /maps/$xmap.map );
if (! $map)
{
#print STDERR - Error loading map: $xmap.map\n;
print(Content-type: text/text\r\n\r\n);
print cant load $xmap.map;
$request-Finish();
next;
}

mapscript::msIO_installStdoutToBuffer();

$x = $map-OWSDispatch( $req );
if ($x)
{
print STDERR OWSDispatch: $x\n;
my $errObj = new mapscript::errorObj();
while ($errObj) {
print STDERR ERROR: 
$errObj-{code}:$errObj-{message}:$errObj-{routine} \n;

$errObj = $errObj-next();
}
}

my $content_type = 
mapscript::msIO_stripStdoutBufferContentType();


$x = mapscript::msIO_getStdoutBufferBytes();


print(Content-type: $content_type\r\n\r\n);
if (mapscript::msGetVersionInt() = 50500)
{
print $$x;
} else {
print $x;
}

mapscript::msIO_resetHandlers();
$request-Finish();
}



I'd recommend using mapserver 5.6.0.

-Andy



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


[mapserver-users] Any ways to increase performance of Mapserver?

2009-10-21 Thread Adrian Popa
Hello, sorry for this noobie question, but I have been running mapserver 
as a cgi process and sometimes I need to make lots of calls to it to get 
the data I want. I have used TileCache to get the layers I need and 
which don't change over time and it speeds things up considerably.


I was wondering - is it possible (and is it more efficient?) to run 
mapserver as fast-cgi? Would it increase speed? The mapserver in the 
cgi-bin directory is already a binary file - so I'm not sure if fast-cgi 
would do any good.


Also, would I have any extra speed benefits if I make WMS queries 
instead of regular cgi queries?


Thank you,
Adrian

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


Re: [mapserver-users] Any ways to increase performance of Mapserver?

2009-10-21 Thread Adrian Popa

Thanks,

I'm compiling mapserver with fast-cgi support and see how that works out.

Any idea if there is a difference in terms of speed if I make normal CGI 
queries vs WMS queries?


Regards,
Adrian

Pavel Iacovlev wrote:

Fast-cgi is one process that manages all your connections (acts more
like apache module) cgi creates a new process for every connection so
fast-cgi is faster and consumes less resources.
The best performance you should get with tilecache serving TMS(If it's
supported by your client, openlayers supports it), images are request
directly so there is almost no overhead

On Wed, Oct 21, 2009 at 10:42 AM, Adrian Popa
adrian_gh.p...@romtelecom.ro wrote:
  

Hello, sorry for this noobie question, but I have been running mapserver as
a cgi process and sometimes I need to make lots of calls to it to get the
data I want. I have used TileCache to get the layers I need and which don't
change over time and it speeds things up considerably.

I was wondering - is it possible (and is it more efficient?) to run
mapserver as fast-cgi? Would it increase speed? The mapserver in the cgi-bin
directory is already a binary file - so I'm not sure if fast-cgi would do
any good.

Also, would I have any extra speed benefits if I make WMS queries instead of
regular cgi queries?

Thank you,
Adrian

___
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] Any ways to increase performance of Mapserver?

2009-10-21 Thread Adrian Popa

Hello again,

I've compiled mapserver with fast cgi support and I've installed fastcgi 
on my apache. All seems ok, but I'm not sure if mapserver runs as 
fastcgi! I followed the instructions from here: 
http://mapserver.org/optimization/fastcgi.html


Here's what I've added in the configuration:

in httpd.conf (Apache2):

LoadModule fastcgi_module modules/mod_fastcgi.so

...
IfModule mod_fastcgi.c
 AddHandler fastcgi-script .fcgi
 FastCgiIpcDir /tmp/fastcgi
 FastCgiConfig -initial-env PROJ_LIB=/usr/share/proj -initial-env 
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/local/pgsql/lib 
-appConnTimeout 60 -idle-timeout 60 -init-start-delay 1  -minProcesses 2 
-maxClassProcesses 30 -startDelay 5

/IfModule


When httpd restarts, I get in the logs that fastcgi starts ok:
[Wed Oct 21 15:43:04 2009] [notice] FastCGI: process manager initialized 
(pid 12570)


I think I should somehow link mapserv to fastcgi - because I see no 
obvious connection. The script handler is only for .fcgi, but 
mapserver's compilation didn't generate any fcgi files... It seems to 
me, mapserver still runs as a cgi process. If I list the running 
processes when there are no queries to the webserver, there is no 
mapserv process. When I list the processes while doing queries, there 
are several mapserv processes running.


Thanks,
Adrian

Adrian Popa wrote:

Thanks,

I'm compiling mapserver with fast-cgi support and see how that works out.

Any idea if there is a difference in terms of speed if I make normal 
CGI queries vs WMS queries?


Regards,
Adrian

Pavel Iacovlev wrote:

Fast-cgi is one process that manages all your connections (acts more
like apache module) cgi creates a new process for every connection so
fast-cgi is faster and consumes less resources.
The best performance you should get with tilecache serving TMS(If it's
supported by your client, openlayers supports it), images are request
directly so there is almost no overhead

On Wed, Oct 21, 2009 at 10:42 AM, Adrian Popa
adrian_gh.p...@romtelecom.ro wrote:
  

Hello, sorry for this noobie question, but I have been running mapserver as
a cgi process and sometimes I need to make lots of calls to it to get the
data I want. I have used TileCache to get the layers I need and which don't
change over time and it speeds things up considerably.

I was wondering - is it possible (and is it more efficient?) to run
mapserver as fast-cgi? Would it increase speed? The mapserver in the cgi-bin
directory is already a binary file - so I'm not sure if fast-cgi would do
any good.

Also, would I have any extra speed benefits if I make WMS queries instead of
regular cgi queries?

Thank you,
Adrian

___
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] Making labels appear less often on adjacent tiles

2009-10-15 Thread Adrian Popa

Yes, it's clear now. Thanks for the clarification.

Regards,
Adrian

Thomas Bonfort wrote:

simply put, when using that parameter the label point is chosen using
geographical coordinates instead of pixel ones, which means that the
label is anchored to the ground thus making it appear only once even
if the polygon spans multiple rendered tiles. hope this is
sufficiently clear 

regards,

thomas

www.camptocamp.com
+33 5 16 57 01 02



On Wed, Oct 14, 2009 at 14:45, Adrian Popa adrian_gh.p...@romtelecom.ro wrote:
  

Thank you, Thomas,

That worked beautifully. I am curious, though - how does it work? I mean,
the requests are independent and as far as I can see there is no state on
the server telling him some request are part of a larger request. So, how
can it know on which tile to show the label and on which tile not to show
the label?

Thanks

Thomas Bonfort wrote:

yes you can do that, by adding a PROCESSING LABEL_NO_CLIP=ON to the
layers where you don't want repeated labels.

regards,

thomas

www.camptocamp.com
+33 5 16 57 01 02



On Wed, Oct 14, 2009 at 13:29, Adrian Popa adrian_gh.p...@romtelecom.ro
wrote:


Hello everyone,

I'm sure this subject has been discussed before, but I wasn't able to find
relevant information so far, so please point me in the right direction
please.

I have switched to WMS and I am now getting several tiles from my mapserver
for one request (this is desired) (actually there are multiple WMS requests
for a specific area). I have no label clipping issues, so that's fine also.
The thing is, for example, if I zoom over a town and the town is split
between several tiles, I will get a label on each tile for the town name.
Previously, when I was requesting a large tile from my mapserver
(single-tile), this wouldn't happen.

I don't want to set the label to not be visible below a certain
resolution, because that way I wouldn't get any labels below a point.

So, my question is: Is it possible to show the label only once per feature,
not once per request? My guess is not (because I wouldn't know how to
implement it), but I'm curious if there's a solution...

Regards,
Adrian

--
--- Adrian Popa
NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

___
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] Making labels appear less often on adjacent tiles

2009-10-14 Thread Adrian Popa

Hello everyone,

I'm sure this subject has been discussed before, but I wasn't able to 
find relevant information so far, so please point me in the right 
direction please.


I have switched to WMS and I am now getting several tiles from my 
mapserver for one request (this is desired) (actually there are multiple 
WMS requests for a specific area). I have no label clipping issues, so 
that's fine also. The thing is, for example, if I zoom over a town and 
the town is split between several tiles, I will get a label on each tile 
for the town name. Previously, when I was requesting a large tile from 
my mapserver (single-tile), this wouldn't happen.


I don't want to set the label to not be visible below a certain 
resolution, because that way I wouldn't get any labels below a point.


So, my question is: Is it possible to show the label only once per 
feature, not once per request? My guess is not (because I wouldn't know 
how to implement it), but I'm curious if there's a solution...


Regards,
Adrian

--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


Re: [mapserver-users] Making labels appear less often on adjacent tiles

2009-10-14 Thread Adrian Popa

Thank you, Thomas,

That worked beautifully. I am curious, though - how does it work? I 
mean, the requests are independent and as far as I can see there is no 
state on the server telling him some request are part of a larger 
request. So, how can it know on which tile to show the label and on 
which tile not to show the label?


Thanks

Thomas Bonfort wrote:

yes you can do that, by adding a PROCESSING LABEL_NO_CLIP=ON to the
layers where you don't want repeated labels.

regards,

thomas

www.camptocamp.com
+33 5 16 57 01 02



On Wed, Oct 14, 2009 at 13:29, Adrian Popa adrian_gh.p...@romtelecom.ro wrote:
  

Hello everyone,

I'm sure this subject has been discussed before, but I wasn't able to find
relevant information so far, so please point me in the right direction
please.

I have switched to WMS and I am now getting several tiles from my mapserver
for one request (this is desired) (actually there are multiple WMS requests
for a specific area). I have no label clipping issues, so that's fine also.
The thing is, for example, if I zoom over a town and the town is split
between several tiles, I will get a label on each tile for the town name.
Previously, when I was requesting a large tile from my mapserver
(single-tile), this wouldn't happen.

I don't want to set the label to not be visible below a certain
resolution, because that way I wouldn't get any labels below a point.

So, my question is: Is it possible to show the label only once per feature,
not once per request? My guess is not (because I wouldn't know how to
implement it), but I'm curious if there's a solution...

Regards,
Adrian

--
--- Adrian Popa
NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

___
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 produces interlaced PNGs even if I configured the map to output noninterlaced PNGs

2009-10-14 Thread Adrian Popa

Hello all,

My goal is to setup tilecache (which is proving to be a real pain), and 
so far I've noticed that even if I configured my map to generate 
noninterlaced PNGs (instructions here: 
http://www.mapserver.org/faq.html#why-doesn-t-pil-python-imaging-library-open-my-pngs), 
it still generates interlaced PNGs.


Here is my outputformat (the only one defined) in my map:
OUTPUTFORMAT
   NAME 'AGG'
   DRIVER AGG/PNG
   IMAGEMODE RGBA
   TRANSPARENT ON
   FORMATOPTION INTERLACE=OFF
END

The parameters that get sent to my mapserver instance are:
BBOX|2896046.12635,5831228.011975,2935181.884825,5870363.77045|
EXCEPTIONS  |application/vnd.ogc.se_inimage|
FORMAT  |png|
HEIGHT  |256|
LAYERS 
|Judete,RuralSate,Rural,Urban,roads,roads-buc,buildings,GranitaJudete|

MAP |/var/www/html/map/rtc_base.map|
MAP_IMAGETYPE   |agg|
MAXEXTENT   |left-bottom=(20.26,43.16) right-top=(29.7,48.46)|
MAXRESOLUTION   |156543|
REQUEST |GetMap|
SERVICE |WMS|
SRS |EPSG:900913|
STYLES  
TRANSITIONEFFECT|resize|
TRANSPARENT |false|
UNITS   |m|
VERSION |1.1.1|
WIDTH   |256|


I'm not sure if MAP_IMAGETYPE=agg is the one which selects the 
outputformat or not, but the map seems to be rendered with AGG (I could 
be wrong, of course).


So, what am I missing here? Is there another parameter that should be 
sent to mapserver to select the outputformat?


By the way, the image file generated has these properties: img.png: PNG 
image, 256 x 256, 8-bit colormap, interlaced


Thanks,
Adrian

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


Re: [mapserver-users] mapserver produces interlaced PNGs even if I configured the map to output noninterlaced PNGs

2009-10-14 Thread Adrian Popa

Hmm,
I did that, and kept the same query parameters and I get this error:

msPostMapParseOutputFormatSetup(): General error message. Unable to 
select IMAGETYPE `agg'.


So, it seems that imagetype is useful after all.


Guillaume Sueur wrote:

hi,

rename your OUTPUTFORMAT to 'PNG' for it to be used when asking for png
format. 


Guillaume

Le mercredi 14 octobre 2009 à 16:36 +0300, Adrian Popa a écrit :
  
Hello all, 


My goal is to setup tilecache (which is proving to be a real pain),
and so far I've noticed that even if I configured my map to generate
noninterlaced PNGs (instructions here:
http://www.mapserver.org/faq.html#why-doesn-t-pil-python-imaging-library-open-my-pngs),
 it still generates interlaced PNGs.

Here is my outputformat (the only one defined) in my map:
OUTPUTFORMAT
NAME 'AGG'
DRIVER AGG/PNG
IMAGEMODE RGBA
TRANSPARENT ON
FORMATOPTION INTERLACE=OFF
END

The parameters that get sent to my mapserver instance are:
BBOX
2896046.12635,5831228.011975,2935181.884825,5870363.77045
EXCEPTIONS
application/vnd.ogc.se_inimage
FORMAT
png
HEIGHT
256
LAYERS
Judete,RuralSate,Rural,Urban,roads,roads-buc,buildings,GranitaJudete
MAP
/var/www/html/map/rtc_base.map
MAP_IMAGETYPE
agg
MAXEXTENT
left-bottom=(20.26,43.16)
right-top=(29.7,48.46)
MAXRESOLUTION
156543
REQUEST
GetMap
SERVICE
WMS
SRS
EPSG:900913
STYLES


TRANSITIONEFFECT
resize
TRANSPARENT
false
UNITS
m
VERSION
1.1.1
WIDTH
256

I'm not sure if MAP_IMAGETYPE=agg is the one which selects the
outputformat or not, but the map seems to be rendered with AGG (I
could be wrong, of course).

So, what am I missing here? Is there another parameter that should be
sent to mapserver to select the outputformat?

By the way, the image file generated has these properties: img.png:
PNG image, 256 x 256, 8-bit colormap, interlaced

Thanks,
Adrian

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




  



--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


Re: [mapserver-users] mapserver produces interlaced PNGs even if I configured the map to output noninterlaced PNGs

2009-10-14 Thread Adrian Popa

Thanks Jukka,

I added MIMETYPE image/png2 to my OUTPUTFORMAT and I called with 
FORMAT=image/png2, and now, the PNGs are non-interlaced!


I don't really understand what the difference is, but  I'm glad it works.

Thanks again... now I only have to figure out why tilecache isn't 
working yet...


Rahkonen Jukka wrote:

Hi,
 
It is possible that rendering does not go through agg.  I am not sure, 
but perhaps by adding

MIMETYPE image/png2
to outputformat and calling either FORMAT=image/png2 or FORMAT=image/png
you could do some comparisons.
 
-Jukka Rahkonen-



*L�hett�j�:* mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] *Puolesta *Adrian
Popa
*L�hetetty:* 14. lokakuuta 2009 16:36
*Vastaanottaja:* mapserver-users@lists.osgeo.org
*Aihe:* [mapserver-users] mapserver produces interlaced PNGs even
if I configured the map to output noninterlaced PNGs

Hello all,

My goal is to setup tilecache (which is proving to be a real
pain), and so far I've noticed that even if I configured my map to
generate noninterlaced PNGs (instructions here:

http://www.mapserver.org/faq.html#why-doesn-t-pil-python-imaging-library-open-my-pngs),
it still generates interlaced PNGs.

Here is my outputformat (the only one defined) in my map:
OUTPUTFORMAT
NAME 'AGG'
DRIVER AGG/PNG
IMAGEMODE RGBA
TRANSPARENT ON
FORMATOPTION INTERLACE=OFF
END

The parameters that get sent to my mapserver instance are:
BBOX|2896046.12635,5831228.011975,2935181.884825,5870363.77045|
EXCEPTIONS  |application/vnd.ogc.se_inimage|
FORMAT  |png|
HEIGHT  |256|
LAYERS
|Judete,RuralSate,Rural,Urban,roads,roads-buc,buildings,GranitaJudete|

MAP |/var/www/html/map/rtc_base.map|
MAP_IMAGETYPE   |agg|
MAXEXTENT   |left-bottom=(20.26,43.16) right-top=(29.7,48.46)|
MAXRESOLUTION   |156543|
REQUEST |GetMap|
SERVICE |WMS|
SRS |EPSG:900913|
STYLES  
TRANSITIONEFFECT|resize|
TRANSPARENT |false|
UNITS   |m|
VERSION |1.1.1|
WIDTH   |256|


I'm not sure if MAP_IMAGETYPE=agg is the one which selects the
outputformat or not, but the map seems to be rendered with AGG (I
could be wrong, of course).

So, what am I missing here? Is there another parameter that should
be sent to mapserver to select the outputformat?

By the way, the image file generated has these properties:
img.png: PNG image, 256 x 256, 8-bit colormap, interlaced

Thanks,
Adrian




--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


Re: [mapserver-users] msProcessProjection(): Projection library error. no system list, errno: 13

2009-10-13 Thread Adrian Popa

Update:

I have symlinked the null file to epsg, and now strace shows that the 
file is read, but I still get the same error when trying to call WMS 
GetMap... :(


[r...@terra map]# ls -l /usr/share/proj/null
lrwxrwxrwx 1 root root 20 Oct 13 10:50 /usr/share/proj/null - 
/usr/share/proj/epsg



Adrian Popa wrote:

Thank you for your reply Lars, my info is inline.

Lars Lingner wrote:

Adrian Popa schrieb:
  

Hmm, any idea on this one? How can I find out if proj is trying to read
the epsg file? I'm thinking of using strace to see what files it tries
to open, but I don't know what syntax to use to try to project from 4326
to 900913...





Just to clarify:

- Your data is in wgs84 (epsg:4326)
  

Yes

- you want to serve mercator projection (epsg:900913)
  

Yes (the frontend will be OpenLayers (through TileCache)

A few questions:

- are there any errors in the capabilities document?
  
No, it looks ok. I can post it if you want, but it's a bit large. It 
outputs an XML which describes the layers, projections and some 
settings from the map file. I haven't seen another working 
GetCapabilites file, so I can't tell if it's missing something...

- did you tried to use mapserver logging (MS_ERRORFILE) and high debug
level (DEBUG 5)
  
Here is the output after enabling MS_ERRORFILE and DEBUG 5 at layer 
level and at map level:
[Tue Oct 13 10:36:36 2009].954434 msProcessProjection(): Projection 
library error. no system list, errno: 13


[Tue Oct 13 10:36:36 2009].954562 mapserv request processing time 
(msLoadMap not incl.): 0.000s

[Tue Oct 13 10:36:36 2009].954584 msFreeMap(): freeing map at 0x8496ac8.
[Tue Oct 13 10:36:36 2009].954651 freeLayer(): freeing layer at 0x84a9378.

- could you try to use shp2img, maybe this gives you a bit more information?
  
[r...@terra map]# shp2img -o /tmp/out.png -m 
/var/www/html/map/rtc_base.map -e 20.258 43.16 
29.703 49.2016 -s 1250 800 -l GranitaJudete
This works just fine (however it doesn't use WMS!). The image 
displayed is correct (and it is projected in mercator projection!).


If I run:
[r...@terra map]# strace shp2img -o /tmp/out.png -m 
/var/www/html/map/rtc_base.map -e 20.258 43.16 
29.703 49.2016 -s 1250 800 -l GranitaJudete 21 | 
grep epsg
.. I don't get any matches on the epsg file that is supposed to be 
used by proj.
Looking through the output of strace, I can see it tries to open some 
proj-related files...
open(/usr/share/proj/proj_def.dat, O_RDONLY) = -1 ENOENT (No such 
file or directory)
open(/usr/share/proj/null, O_RDONLY)  = -1 ENOENT (No such file or 
directory)


I wonder why it tries to open a file called null - maybe an error?

- did you compile MapServer and the dependencies by yourself?
  

Yes. These are my configure arguments:
./configure --with-freetype --with-png --with-agg=../agg-2.5 
--with-proj --with-ogr --with-gdal --with-xml2 --with-wfs --with-wcs \
--with-wmsclient --with-wfsclient --with-postgis --with-threads 
--with-sos --with-mygis --with-geos --with-tiff

- what MapServer version do you use?
  

version 5.4.1

- do you have Proj4 installed? (OpenLayers doesn't use the same lib, it
uses the javascript lib)
  

[adri...@terra mapserver]$ rpm -qa | grep proj
proj-devel-4.5.0-1.fc5
proj-4.5.0-1.fc5


I hope it does not look like keeping you busy, but without further
information its difficult to help.

  
Your help is very much appreciated. Any idea is a good one because it 
might get me out of this predicament. :)

Regards,
Adrian

P.S. If I understand how projections work - if I call the projection 
with it's EPSG code it needs the epsg file to get the details about 
the projection. In my layers I'm using the EPSG definition instead the 
EPSG code to define my projections. If I switch to codes it won't work 
(I have tried a few months ago). So, to me, it seems mapserver (or 
proj) can't get the definitions from the epsg file (maybe because it 
searches for the wrong file). I will try to create the file and try 
again. I'll let you know how it works.

Lars
___
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] msProcessProjection(): Projection library error. no system list, errno: 13

2009-10-13 Thread Adrian Popa

Thank you for your reply Lars, my info is inline.

Lars Lingner wrote:

Adrian Popa schrieb:
  

Hmm, any idea on this one? How can I find out if proj is trying to read
the epsg file? I'm thinking of using strace to see what files it tries
to open, but I don't know what syntax to use to try to project from 4326
to 900913...





Just to clarify:

- Your data is in wgs84 (epsg:4326)
  

Yes

- you want to serve mercator projection (epsg:900913)
  

Yes (the frontend will be OpenLayers (through TileCache)

A few questions:

- are there any errors in the capabilities document?
  
No, it looks ok. I can post it if you want, but it's a bit large. It 
outputs an XML which describes the layers, projections and some settings 
from the map file. I haven't seen another working GetCapabilites file, 
so I can't tell if it's missing something...

- did you tried to use mapserver logging (MS_ERRORFILE) and high debug
level (DEBUG 5)
  
Here is the output after enabling MS_ERRORFILE and DEBUG 5 at layer 
level and at map level:
[Tue Oct 13 10:36:36 2009].954434 msProcessProjection(): Projection 
library error. no system list, errno: 13


[Tue Oct 13 10:36:36 2009].954562 mapserv request processing time 
(msLoadMap not incl.): 0.000s

[Tue Oct 13 10:36:36 2009].954584 msFreeMap(): freeing map at 0x8496ac8.
[Tue Oct 13 10:36:36 2009].954651 freeLayer(): freeing layer at 0x84a9378.

- could you try to use shp2img, maybe this gives you a bit more information?
  
[r...@terra map]# shp2img -o /tmp/out.png -m 
/var/www/html/map/rtc_base.map -e 20.258 43.16 
29.703 49.2016 -s 1250 800 -l GranitaJudete
This works just fine (however it doesn't use WMS!). The image displayed 
is correct (and it is projected in mercator projection!).


If I run:
[r...@terra map]# strace shp2img -o /tmp/out.png -m 
/var/www/html/map/rtc_base.map -e 20.258 43.16 
29.703 49.2016 -s 1250 800 -l GranitaJudete 21 | grep 
epsg
.. I don't get any matches on the epsg file that is supposed to be used 
by proj.
Looking through the output of strace, I can see it tries to open some 
proj-related files...
open(/usr/share/proj/proj_def.dat, O_RDONLY) = -1 ENOENT (No such file 
or directory)
open(/usr/share/proj/null, O_RDONLY)  = -1 ENOENT (No such file or 
directory)


I wonder why it tries to open a file called null - maybe an error?

- did you compile MapServer and the dependencies by yourself?
  

Yes. These are my configure arguments:
./configure --with-freetype --with-png --with-agg=../agg-2.5 --with-proj 
--with-ogr --with-gdal --with-xml2 --with-wfs --with-wcs \
--with-wmsclient --with-wfsclient --with-postgis --with-threads 
--with-sos --with-mygis --with-geos --with-tiff

- what MapServer version do you use?
  

version 5.4.1

- do you have Proj4 installed? (OpenLayers doesn't use the same lib, it
uses the javascript lib)
  

[adri...@terra mapserver]$ rpm -qa | grep proj
proj-devel-4.5.0-1.fc5
proj-4.5.0-1.fc5


I hope it does not look like keeping you busy, but without further
information its difficult to help.

  
Your help is very much appreciated. Any idea is a good one because it 
might get me out of this predicament. :)

Regards,
Adrian

P.S. If I understand how projections work - if I call the projection 
with it's EPSG code it needs the epsg file to get the details about the 
projection. In my layers I'm using the EPSG definition instead the EPSG 
code to define my projections. If I switch to codes it won't work (I 
have tried a few months ago). So, to me, it seems mapserver (or proj) 
can't get the definitions from the epsg file (maybe because it searches 
for the wrong file). I will try to create the file and try again. I'll 
let you know how it works.

Lars
___
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] msProcessProjection(): Projection library error.no system list, errno: 13

2009-10-13 Thread Adrian Popa

Hello Jukka,

I have added the PROJ_LIB statement in the map file. Unfortunately, 
nothing changes... strace still shows that shp2img tries to read 
/usr/share/proj/null (and it succeeds).
I have added the line with the google projection to the end of the epsg 
(and null) file.


I still get the same error.

Is there any way I can call proj + some parameters to ask for a 
projection between WGS84 to Google? I'd like to close in on the problem.


Thanks,
Adrian

Rahkonen Jukka wrote:

Hi,
 
First, it is possible to tell Mapserver where to find the projection 
files in the mapfile, in MAP section.  Excerpt from 
http://www.mapserver.org/mapfile/map.html
 
PROJ_LIB [path]
The CONFIG parameter can be used to define the location of your EPSG 
files for the Proj.4 library. Setting the [key] to PROJ_LIB and the 
[value] to the location of your EPSG files will force PROJ.4 to use 
this value. Using CONFIG allows you to avoid setting environment 
variables to point to your PROJ_LIB directory. Here are some examples:

Unix
CONFIG PROJ_LIB /usr/local/share/proj/
 
 
Second, Mapserver epsg file ships without Google projection. Without 
adding the definition it is impossible to refer to epsg:900913 
projection with the code number. Have you added corresponding line to 
the epsg file, whitch is usually in /usr/share/proj/epsg?
 
900913 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null 
mailto:+nadgri...@null +no_defs
 
Put it on the first line so Mapserver finds it immediately without a 
need to go through the whole list.
 
-Jukka Rahkonen-



*L�hett�j�:* mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] *Puolesta *Adrian
Popa
*L�hetetty:* 13. lokakuuta 2009 10:55
*Vastaanottaja:* Lars Lingner
*Kopio:* mapserver-users@lists.osgeo.org
*Aihe:* Re: [mapserver-users] msProcessProjection(): Projection
library error.no system list, errno: 13

Update:

I have symlinked the null file to epsg, and now strace shows that
the file is read, but I still get the same error when trying to
call WMS GetMap... :(

[r...@terra map]# ls -l /usr/share/proj/null
lrwxrwxrwx 1 root root 20 Oct 13 10:50 /usr/share/proj/null -
/usr/share/proj/epsg


Adrian Popa wrote:

Thank you for your reply Lars, my info is inline.

Lars Lingner wrote:

Adrian Popa schrieb:
  

Hmm, any idea on this one? How can I find out if proj is trying to read
the epsg file? I'm thinking of using strace to see what files it tries
to open, but I don't know what syntax to use to try to project from 4326
to 900913...





Just to clarify:

- Your data is in wgs84 (epsg:4326)
  

Yes

- you want to serve mercator projection (epsg:900913)
  

Yes (the frontend will be OpenLayers (through TileCache)

A few questions:

- are there any errors in the capabilities document?
  

No, it looks ok. I can post it if you want, but it's a bit large.
It outputs an XML which describes the layers, projections and
some settings from the map file. I haven't seen another working
GetCapabilites file, so I can't tell if it's missing something...

- did you tried to use mapserver logging (MS_ERRORFILE) and high debug
level (DEBUG 5)
  

Here is the output after enabling MS_ERRORFILE and DEBUG 5 at
layer level and at map level:
[Tue Oct 13 10:36:36 2009].954434 msProcessProjection():
Projection library error. no system list, errno: 13

[Tue Oct 13 10:36:36 2009].954562 mapserv request processing time
(msLoadMap not incl.): 0.000s
[Tue Oct 13 10:36:36 2009].954584 msFreeMap(): freeing map at
0x8496ac8.
[Tue Oct 13 10:36:36 2009].954651 freeLayer(): freeing layer at
0x84a9378.

- could you try to use shp2img, maybe this gives you a bit more information?
  

[r...@terra map]# shp2img -o /tmp/out.png -m
/var/www/html/map/rtc_base.map -e 20.258 43.16
29.703 49.2016 -s 1250 800 -l GranitaJudete
This works just fine (however it doesn't use WMS!). The image
displayed is correct (and it is projected in mercator projection!).

If I run:
[r...@terra map]# strace shp2img -o /tmp/out.png -m
/var/www/html/map/rtc_base.map -e 20.258 43.16
29.703 49.2016 -s 1250 800 -l GranitaJudete 21
| grep epsg
.. I don't get any matches on the epsg file that is supposed to
be used by proj.
Looking through the output of strace, I can see it tries to open
some proj-related files...
open(/usr/share/proj/proj_def.dat, O_RDONLY) = -1 ENOENT (No
such file or directory)
open(/usr/share/proj/null, O_RDONLY)  = -1 ENOENT (No such file
or directory)

I wonder why it tries to open a file called null - maybe an error?

- did

[mapserver-users] msProcessProjection(): Projection library error. no system list, errno: 13

2009-10-12 Thread Adrian Popa

Hello all!

I'm trying to convert my regular MAP file to be WMS compliant and to be 
able to get the contents through WMS requests. I am following the 
tutorial here: http://mapserver.org/ogc/wms_server.html.


The GetCapabilities request works: 
http://terra/cgi-bin/mapserv?map=/var/www/html/map/rtc_base.mapSERVICE=WMSVERSION=1.1.1REQUEST=GetCapabilities


The GetMap request fails:
http://terra/cgi-bin/mapserv?map=/var/www/html/map/rtc_base.mapSERVICE=WMSVERSION=1.1.1REQUEST=GetMapLAYERS=GranitaJudeteSTYLES=SRS=EPSG:4326

The output returned is:
?xml version='1.0' encoding=ISO-8859-1 standalone=no ?
!DOCTYPE ServiceExceptionReport SYSTEM 
http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd;

ServiceExceptionReport version=1.1.1
ServiceException
msProcessProjection(): Projection library error. no system list, errno: 13

/ServiceException
/ServiceExceptionReport


The Map file has the following definitions:
MAP
...
WEB
  ...
  METADATA
 ...
 wms_title Basic Map
   wms_attribution_title Basic Map
   wms_srs EPSG:900913
  END
 END

PROJECTION
   #spherical mercator/google
+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 
+y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs

END

LAYER
 NAME GranitaJudete
 ...
 METADATA
   wms_title GranitaJudete
   wms_srs EPSG:4326
   END
   PROJECTION
   #WGS84
   +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
   END
   ...
END

END

The thing is (if I remember correctly) my mapserver doesn't really 
recognize projections by their EPSG code, but it works if I supply the 
other definition. I'm not sure how to correct that and I don't know if 
this is the cause.


I've looked into PROJ4 source code and I found refrences to errorcode 
-13 in this function: PJ *pj_latlong_from_proj( PJ *pj_in ) from 
src/pj_utils.c. It returns errorcode -13 if can't find datum, ellps 
or a.


I'm not sure where to go from here, as google doesn't find this 
particular error code...


Thanks

--
--- 
Adrian Popa



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


Re: [mapserver-users] msProcessProjection(): Projection library error. no system list, errno: 13

2009-10-12 Thread Adrian Popa

Hello,

Thanks for your answers.

I had already included the google EPSG in the proj main file:
[r...@terra map]# cat /usr/share/proj/epsg | grep 900913
900913 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs


I have added wms_srs EPSG:900913 EPSG:4326 to my map file, but the 
GetMap request fails for both SRS 900913 and SRS 4326 with the same 
error message.


My linux version is Fedora Core 5. I'm not sure if the location of the  
epsg is correct, but it works ok with openlayers (running on the same 
server).


Regards,
Adrian

Milo van der Linden wrote:

Hello Adrian,

Change the METADATA section of your mapfile from:

wms_srs EPSG:900913

to

wms_srs EPSG:900913 EPSG:4326 EPSG:whatever projections you want to
expose

the wms_srs parameter for the MAP is a collection of space separated
EPSG codes that tells the wms-server what projections it supports.
Please use this space seperated list ONLY at the MAP section, when in
Layers, wms_srs needs to be a single EPSG-code that is native to the
particular layer


Good luck!

Milo van der Linden


Adrian Popa schreef:
  

Hello all!

I'm trying to convert my regular MAP file to be WMS compliant and to
be able to get the contents through WMS requests. I am following the
tutorial here: http://mapserver.org/ogc/wms_server.html.

The GetCapabilities request works:
http://terra/cgi-bin/mapserv?map=/var/www/html/map/rtc_base.mapSERVICE=WMSVERSION=1.1.1REQUEST=GetCapabilities


The GetMap request fails:
http://terra/cgi-bin/mapserv?map=/var/www/html/map/rtc_base.mapSERVICE=WMSVERSION=1.1.1REQUEST=GetMapLAYERS=GranitaJudeteSTYLES=SRS=EPSG:4326


The output returned is:
?xml version='1.0' encoding=ISO-8859-1 standalone=no ?
!DOCTYPE ServiceExceptionReport SYSTEM
http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd;
ServiceExceptionReport version=1.1.1
ServiceException
msProcessProjection(): Projection library error. no system list,
errno: 13

/ServiceException
/ServiceExceptionReport


The Map file has the following definitions:
MAP
...
WEB
  ...
  METADATA
 ...
 wms_title Basic Map
   wms_attribution_title Basic Map
   wms_srs EPSG:900913
  END
 END

PROJECTION
   #spherical mercator/google
+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
+y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs
END

LAYER
 NAME GranitaJudete
 ...
 METADATA
   wms_title GranitaJudete
   wms_srs EPSG:4326
   END
   PROJECTION
   #WGS84
   +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
   END
   ...
END

END

The thing is (if I remember correctly) my mapserver doesn't really
recognize projections by their EPSG code, but it works if I supply the
other definition. I'm not sure how to correct that and I don't know if
this is the cause.

I've looked into PROJ4 source code and I found refrences to errorcode
-13 in this function: PJ *pj_latlong_from_proj( PJ *pj_in ) from
src/pj_utils.c. It returns errorcode -13 if can't find datum,
ellps or a.

I'm not sure where to go from here, as google doesn't find this
particular error code...

Thanks





  


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


Re: [mapserver-users] msProcessProjection(): Projection library error. no system list, errno: 13

2009-10-12 Thread Adrian Popa
Hmm, any idea on this one? How can I find out if proj is trying to read 
the epsg file? I'm thinking of using strace to see what files it tries 
to open, but I don't know what syntax to use to try to project from 4326 
to 900913...



Adrian Popa wrote:

Hello,

Thanks for your answers.

I had already included the google EPSG in the proj main file:
[r...@terra map]# cat /usr/share/proj/epsg | grep 900913
900913 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs


I have added wms_srs EPSG:900913 EPSG:4326 to my map file, but the 
GetMap request fails for both SRS 900913 and SRS 4326 with the same 
error message.


My linux version is Fedora Core 5. I'm not sure if the location of 
the  epsg is correct, but it works ok with openlayers (running on the 
same server).


Regards,
Adrian

Milo van der Linden wrote:

Hello Adrian,

Change the METADATA section of your mapfile from:

wms_srs EPSG:900913

to

wms_srs EPSG:900913 EPSG:4326 EPSG:whatever projections you want to
expose

the wms_srs parameter for the MAP is a collection of space separated
EPSG codes that tells the wms-server what projections it supports.
Please use this space seperated list ONLY at the MAP section, when in
Layers, wms_srs needs to be a single EPSG-code that is native to the
particular layer


Good luck!

Milo van der Linden


Adrian Popa schreef:
  

Hello all!

I'm trying to convert my regular MAP file to be WMS compliant and to
be able to get the contents through WMS requests. I am following the
tutorial here: http://mapserver.org/ogc/wms_server.html.

The GetCapabilities request works:
http://terra/cgi-bin/mapserv?map=/var/www/html/map/rtc_base.mapSERVICE=WMSVERSION=1.1.1REQUEST=GetCapabilities


The GetMap request fails:
http://terra/cgi-bin/mapserv?map=/var/www/html/map/rtc_base.mapSERVICE=WMSVERSION=1.1.1REQUEST=GetMapLAYERS=GranitaJudeteSTYLES=SRS=EPSG:4326


The output returned is:
?xml version='1.0' encoding=ISO-8859-1 standalone=no ?
!DOCTYPE ServiceExceptionReport SYSTEM
http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd;
ServiceExceptionReport version=1.1.1
ServiceException
msProcessProjection(): Projection library error. no system list,
errno: 13

/ServiceException
/ServiceExceptionReport


The Map file has the following definitions:
MAP
...
WEB
  ...
  METADATA
 ...
 wms_title Basic Map
   wms_attribution_title Basic Map
   wms_srs EPSG:900913
  END
 END

PROJECTION
   #spherical mercator/google
+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
+y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs
END

LAYER
 NAME GranitaJudete
 ...
 METADATA
   wms_title GranitaJudete
   wms_srs EPSG:4326
   END
   PROJECTION
   #WGS84
   +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
   END
   ...
END

END

The thing is (if I remember correctly) my mapserver doesn't really
recognize projections by their EPSG code, but it works if I supply the
other definition. I'm not sure how to correct that and I don't know if
this is the cause.

I've looked into PROJ4 source code and I found refrences to errorcode
-13 in this function: PJ *pj_latlong_from_proj( PJ *pj_in ) from
src/pj_utils.c. It returns errorcode -13 if can't find datum,
ellps or a.

I'm not sure where to go from here, as google doesn't find this
particular error code...

Thanks





  




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



--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


[mapserver-users] Tips on generating tiles from mapserver

2009-10-06 Thread Adrian Popa

Hello everyone,

I have some mapserver layers that I would like to generate into tiles 
(because the content doesn't change much). I would like to find out the 
following:

1) a link to a tutorial or help on how to do this (which tools to use)
2) how can I calculate an estimate of the size those tiles would occupy
3) what naming convention (or extra details) are needed to make the 
tiles viewable in OpenLayers.


Thanks,
Adrian

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


Re: [mapserver-users] Tips on generating tiles from mapserver

2009-10-06 Thread Adrian Popa
Thanks for the help Benoît, but the project you sent me doesn't seem to 
be able to generate tiles from map files. It seems to be able to 
generate tiles from other images. Maybe I'm missing something



Benoît Andrieu wrote:

Very quick answer, some could add comments ! ^^

1. http://www.gdal.org/gdal2tiles.html
2. It will depend on the output format of gdal2tiles (jpeg/tiff/png  
compression). Don't know !

3. Don't know !

Sorry !

Regards,
Benoît

- Original Message - From: Adrian Popa 
adrian_gh.p...@romtelecom.ro

To: mapserver-users@lists.osgeo.org
Sent: Tuesday, October 06, 2009 11:04 AM
Subject: [mapserver-users] Tips on generating tiles from mapserver



Hello everyone,

I have some mapserver layers that I would like to generate into tiles 
(because the content doesn't change much). I would like to find out 
the following:

1) a link to a tutorial or help on how to do this (which tools to use)
2) how can I calculate an estimate of the size those tiles would occupy
3) what naming convention (or extra details) are needed to make the 
tiles viewable in OpenLayers.


Thanks,
Adrian

___
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] Tips on generating tiles from mapserver

2009-10-06 Thread Adrian Popa

Thank you Lars,
I will follow your approach. I hope I won't run out of disk space :)


Lars Lingner wrote:

Adrian Popa schrieb:
  

Hello everyone,

I have some mapserver layers that I would like to generate into tiles
(because the content doesn't change much). I would like to find out the
following:
1) a link to a tutorial or help on how to do this (which tools to use)



You could use TileCache. It comes with an tilecache_seed.py script which
generates the tiles queering MapServer.

A sample config can look like:

- MapServer layer

LAYER
TYPE POLYGON
STATUS ON
NAME landuse
CONNECTIONTYPE POSTGIS
CONNECTION host=host port=port dbname=dbname user=dbuser
password=dbpasswd
DATA way from (select way,id ,landuse from otg_polygon where
landuse is not null ) as foo using unique id using srid=900913
PROCESSING LABEL_NO_CLIP=ON
PROCESSING CLOSE_CONNECTION=DEFER
CLASSITEM landuse
METADATA
  WMS_TITLE landuse
  WMS_GROUP_TITLE landuse
  WMS_EXTENT -3654301.4476046 3830412.5307382 6971056.978358
9730128.1208444
  WMS_ABSTRACT layer landuse
END #metadata
CLASS
STYLE
COLOR #E3E2DF
END
END
END

- corresponding TileCache config

[landuse]
type=WMS
url=http://example.org/cgi-bin/mapserv?map=/path/to/mapfile.map
layers=landuse
extension=png
bbox=-3654301.4476046,3830412.5307382,6971056.978358,9730128.1208444
maxResolution=9783.93961875
srs=EPSG:900913
metaTile=true
metaSize=8,8

You have to adjust the extents, resolutions, srs, url to your needs
Have a look at TileCache docs for further explanation. (www.tilecache.org)

  

2) how can I calculate an estimate of the size those tiles would occupy



I have no formula at hand.

  

3) what naming convention (or extra details) are needed to make the
tiles viewable in OpenLayers.




Either you are using TileCache or you can direct access the cache
directory via an OpenLayers.Layer.TileCache so you don't have to bother
with naming.


Lars
___
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] Any pointers on calculating the shortest route between 2 points?

2009-08-24 Thread Adrian Popa

Hello everybody,

Sorry if this question is not specific to mapserver, but I was wondering 
if I could get some pointers on where to start with this problem.


So, I have a layer with street numbers for some cities, and I want to be 
able to display the route between 2 such points. I've done something 
similar in the past by using Boost (as a perl module) and loading the 
network as a graph and using Dijkstra algorithm to calculate the 
shortest path between 2 points. The problem is - the data I had clearly 
defined the nodes of the graph (vertexes) and the edges (links) between 
the nodes, so I was able to easily build the graph and interpret the 
results.

The data I have now looks like this (for a record):

OGRFeature(Streets_geocoding):1123
 Name (String) = West St
 FromLeft (Integer) = 3
 ToLeft (Integer) = 5
 FromRight (Integer) = 12
 ToRight (Integer) = 32
 Link_ID (Real) =  588532637
 Judet (String) = TIMIS
 Localitate (String) = TIMISOARA
 L_PostCode (String) = 300609
 R_PostCode (String) = 300609
 Style = PEN(w:2px,c:#ff00ff,id:mapinfo-pen-2.ogr-pen-0)
 LINESTRING (21.17921 45.7513097,21.18102 45.7537902)

The problem is I have lots of small links (street segments) but without 
an obvious way to link them together (maybe Link_ID is something useful 
- I'll look into it).


My question is: In your opinion - how is routing implemented on maps 
(e.g. on GPS receivers) - Do the maps have special information, or 
should I manage with what I have?


Any pointers are helpful, thanks

Regards,
Adrian

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


Re: [mapserver-users] map not available over the Lan or internet

2009-08-12 Thread Adrian Popa
Make sure your server listens on all interfaces, not only on loopback. 
You need to check apache's config for this and restart the server.


Also, you can do netstat -a (I think) on your windows system and look 
for your port (8085). If next to it you see 0.0.0.0, it means the server 
is listening on all interfaces. If you see 127.0.0.1, it means the 
server is listening only on loopback.


Good luck.


sunny74 wrote:

Hi,

I am displaying map using mapserver and openlayers in aspx(ASP.NET) page.
But problem is that the map is displayed only on local machine and not from
a remote machine on the Lan or Internet.
On doing some rD i found that if the url is given as in a local machine i.e

http://localhost:8085/cgi-bin/mapserv.exe?map=WR_Shape/wrmap.mapmode=map

Then map is displayed.
But if it is given like this,

http://172.16.128.173:8085/cgi-bin/mapserv.exe?map=WR_Shape/wrmap.mapmode=map

then it is not.

So how can I get mapserver to display map with IP.

Thanks for your replies.
  



--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


Re: [mapserver-users] map not available over the Lan or internet

2009-08-12 Thread Adrian Popa
I forgot... windows automatically replaces IP addresses with hostnames 
when hostnames are known. SubranilBasu is your hostname and it matches 
your ip address 127.0.0.1.


The concept of listening on all/an interface is the following: when  you 
start a server it can accept queries from all interfaces (it's listening 
on ip1:8085, ip2:8085, 127.0.0.1:8085 - or a more compact way of writing 
this is: 0.0.0.0:8085). The server can be started listening only on one 
interface (for instance listening for queries on the loopback interface 
127.0.0.1) - and it will not reply to queries that come on other interfaces.


This is what the Listen directive does in apache. I think that it should 
be Listen 0.0.0.0:8085 if you want to enable the web server on all 
interfaces (but I haven't checked).


Regards,
Adrian

sunny74 wrote:

Hi Adrian,

I did as u suggested and next to port 8085 I see SubranilBasu:0  LISTENING
and not 0.0.0.0 or 127.0.0.1
as u have stated.


I don't understand the terms listening on all interfaces and listening
only on loopback.Could u pls explain them.

Thanks for your reply.

Regards.



Adrian Popa wrote:
  
Make sure your server listens on all interfaces, not only on loopback. 
You need to check apache's config for this and restart the server.


Also, you can do netstat -a (I think) on your windows system and look 
for your port (8085). If next to it you see 0.0.0.0, it means the server 
is listening on all interfaces. If you see 127.0.0.1, it means the 
server is listening only on loopback.


Good luck.


sunny74 wrote:


Hi,

I am displaying map using mapserver and openlayers in aspx(ASP.NET) page.
But problem is that the map is displayed only on local machine and not
from
a remote machine on the Lan or Internet.
On doing some rD i found that if the url is given as in a local machine
i.e

http://localhost:8085/cgi-bin/mapserv.exe?map=WR_Shape/wrmap.mapmode=map

Then map is displayed.
But if it is given like this,

http://172.16.128.173:8085/cgi-bin/mapserv.exe?map=WR_Shape/wrmap.mapmode=map

then it is not.

So how can I get mapserver to display map with IP.

Thanks for your replies.
  
  

--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

___
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] tooltip openlayers /wms

2009-08-10 Thread Adrian Popa

Hello Youness,

Check out this link (for Vector layers) -  maybe it helps: 
http://www.mail-archive.com/us...@openlayers.org/msg7.html



YOUNESS ELMEDRAOUI wrote:

Hi,

plz, how can i create a tooltips with openlayers / wms layers?
 
thnks

best regards,
Youness ELMEDRAOUI
Les informations figurant sur cet e-mail ont un caract�re strictement 
confidentiel et sont exclusivement adress�es au destinataire mentionn� 
ci-dessus.Tout usage, reproduction ou divulgation de cet e-mail est 
strictement interdit si vous n'en �tes pas le destinataire.Dans ce 
cas, veuillez nous en avertir imm�diatement par la m�me voie et 
d�truire l'original. Merci



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



--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


[mapserver-users] Applying a hatch over a line layer

2009-07-27 Thread Adrian Popa

Hello,

I'm trying to apply a hatch over a line segment, but it doesn't seem to 
work.

My symbol definition is:

SYMBOL   
NAME 'hatch'
TYPE HATCH  
END  


My layer definition is:
LAYER
   TYPE LINE
   ...
   CLASS
  NAME Test
  EXPRESSION ( [flag] eq 1)
  STYLE   
   SYMBOL 'hatch'  
   ANGLE 45
   SIZE 3 #spacing between lines
   WIDTH 4 #width of each line 
   color #00 
   END 
   style   
 color #fff94d   
 width 2   
 antialias true
   end 
   END

END

The behavior is the following: mapserver draws the lines using the 
second style (a yellowish color), but doesn't draw a hatch over my line.


I've tried with the hatch symbol after the style definition, but it 
still doesn't work.  The hatch worked for POLYGON layers just fine.


Is there any way I can use it for LINE data?

Thanks,
Adrian

P.S. I'm using mapserver 5.4.1


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


Re: [mapserver-users] Applying a hatch over a line layer

2009-07-27 Thread Adrian Popa

Hello Thomas,

Thank you for your reply. I tried your solution and it draws a dashed 
line paralel to my feature (on each side because the symbol is thicker). 
This is nice, but I was wondering if it's possible to draw the lines at 
an angle relative to my feature, thus created the hatch effect.


If this is not possible with a simple symbol - would it be possible with 
a graphical symbol (picture)? And if yes, should I expect a high 
performance penalty?


Thanks again,
Adrian

Thomas Bonfort wrote:

hi,

hatches only apply to polygon layers.

what you are probably looking for is the PATTERN keyword:

symbol
  type simple
  pattern 2 2 end
  name dashes
end


regards,
thomas

www.camptocamp.com
+33 4 79 26 57 97



On Mon, Jul 27, 2009 at 11:37, Adrian Popaadrian_gh.p...@romtelecom.ro wrote:
  

Hello,

I'm trying to apply a hatch over a line segment, but it doesn't seem to
work.
My symbol definition is:

SYMBOL  NAME 'hatch'
   TYPE HATCH  END
My layer definition is:
LAYER
  TYPE LINE
  ...
  CLASS
 NAME Test
 EXPRESSION ( [flag] eq 1)
 STYLE SYMBOL 'hatch'
  ANGLE 45   SIZE 3 #spacing between
lines
  WIDTH 4 #width of each line   color #00
  END   style
color #fff94d   width 2
antialias true   end
  END
END

The behavior is the following: mapserver draws the lines using the second
style (a yellowish color), but doesn't draw a hatch over my line.

I've tried with the hatch symbol after the style definition, but it still
doesn't work.  The hatch worked for POLYGON layers just fine.

Is there any way I can use it for LINE data?

Thanks,
Adrian

P.S. I'm using mapserver 5.4.1


___
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] Applying a hatch over a line layer

2009-07-27 Thread Adrian Popa
...Or, to be more clear, I would like to give my lines a striped look 
-  I don't know if there's an easier way to do it than using a symbol...


Thanks.


Adrian Popa wrote:

Hello Thomas,

Thank you for your reply. I tried your solution and it draws a dashed 
line paralel to my feature (on each side because the symbol is 
thicker). This is nice, but I was wondering if it's possible to draw 
the lines at an angle relative to my feature, thus created the hatch 
effect.


If this is not possible with a simple symbol - would it be possible 
with a graphical symbol (picture)? And if yes, should I expect a high 
performance penalty?


Thanks again,
Adrian

Thomas Bonfort wrote:

hi,

hatches only apply to polygon layers.

what you are probably looking for is the PATTERN keyword:

symbol
  type simple
  pattern 2 2 end
  name dashes
end


regards,
thomas

www.camptocamp.com
+33 4 79 26 57 97



On Mon, Jul 27, 2009 at 11:37, Adrian Popaadrian_gh.p...@romtelecom.ro wrote:
  

Hello,

I'm trying to apply a hatch over a line segment, but it doesn't seem to
work.
My symbol definition is:

SYMBOL  NAME 'hatch'
   TYPE HATCH  END
My layer definition is:
LAYER
  TYPE LINE
  ...
  CLASS
 NAME Test
 EXPRESSION ( [flag] eq 1)
 STYLE SYMBOL 'hatch'
  ANGLE 45   SIZE 3 #spacing between
lines
  WIDTH 4 #width of each line   color #00
  END   style
color #fff94d   width 2
antialias true   end
  END
END

The behavior is the following: mapserver draws the lines using the second
style (a yellowish color), but doesn't draw a hatch over my line.

I've tried with the hatch symbol after the style definition, but it still
doesn't work.  The hatch worked for POLYGON layers just fine.

Is there any way I can use it for LINE data?

Thanks,
Adrian

P.S. I'm using mapserver 5.4.1


___
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] Applying a hatch over a line layer

2009-07-27 Thread Adrian Popa

Hello Thomas,

Thank you for your reply. I tried first with an image, but the output 
didn't look so hot, so I created my own symbol by following this guide: 
http://umn.mapserver.ch/MapServer/en/sym_vector.htm


It still doesn't look very nice, but I will tune it from here.

Thanks again,
Adrian

Thomas Bonfort wrote:

yes, you can definitely do that with an image symbol, although that
won't be very flexible if you want to change the width.

another solution would be with a vector symbol.

in both cases, you'll have to add a negative GAP to your symbol definition.

cheers,

thomas

www.camptocamp.com
+33 4 79 26 57 97



On Mon, Jul 27, 2009 at 13:47, Adrian Popaadrian_gh.p...@romtelecom.ro wrote:
  

...Or, to be more clear, I would like to give my lines a striped look -  I
don't know if there's an easier way to do it than using a symbol...

Thanks.


Adrian Popa wrote:

Hello Thomas,

Thank you for your reply. I tried your solution and it draws a dashed line
paralel to my feature (on each side because the symbol is thicker). This is
nice, but I was wondering if it's possible to draw the lines at an angle
relative to my feature, thus created the hatch effect.

If this is not possible with a simple symbol - would it be possible with a
graphical symbol (picture)? And if yes, should I expect a high performance
penalty?

Thanks again,
Adrian

Thomas Bonfort wrote:

hi,

hatches only apply to polygon layers.

what you are probably looking for is the PATTERN keyword:

symbol
  type simple
  pattern 2 2 end
  name dashes
end


regards,
thomas

www.camptocamp.com
+33 4 79 26 57 97



On Mon, Jul 27, 2009 at 11:37, Adrian Popaadrian_gh.p...@romtelecom.ro
wrote:


Hello,

I'm trying to apply a hatch over a line segment, but it doesn't seem to
work.
My symbol definition is:

SYMBOL  NAME 'hatch'
   TYPE HATCH  END
My layer definition is:
LAYER
  TYPE LINE
  ...
  CLASS
 NAME Test
 EXPRESSION ( [flag] eq 1)
 STYLE SYMBOL 'hatch'
  ANGLE 45   SIZE 3 #spacing between
lines
  WIDTH 4 #width of each line   color #00
  END   style
color #fff94d   width 2
antialias true   end
  END
END

The behavior is the following: mapserver draws the lines using the second
style (a yellowish color), but doesn't draw a hatch over my line.

I've tried with the hatch symbol after the style definition, but it still
doesn't work.  The hatch worked for POLYGON layers just fine.

Is there any way I can use it for LINE data?

Thanks,
Adrian

P.S. I'm using mapserver 5.4.1


___
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] Performance in regular expressions or analternative way to select a list of features

2009-07-21 Thread Adrian Popa

Just for reference:

I tried to select about 130 items using a regular expression in the form 
of EXPRESSION (/^ITEM1|ITEM2|ITEM3|...|ITEM130$/) and rendering took 
about 4.5-5 seconds.


I tried to select the exact same 130 items using IN syntax: EXPRESSION 
([myfield] IN ITEM1,ITEM2,ITEM3,...,ITEM130) and the query took 
about 8.5-9 seconds.


The tests were run several times in the same conditions - so the 
relative results should be relevant.


So - performance favors regular expressions :)



Adrian Popa wrote:
Here's how I fixed this issue. I ended up regenerating the shapefile 
and dbf and adding a separate column with the grouping I desired. Now, 
my map file selects from that column, and the syntax is much simpler 
(by one or two orders of magnitude). I am happy with the results, 
however, I didn't get the chance to try out all the other methods 
because of lack of time.


Thanks again,
Adrian

Adrian Popa wrote:

Hello Steve,

I haven't tried out the simplified regex so I don't know if it will 
be faster. I will try to test it as part of a speed test of the 
various methods...


I'm not sure what you mean by writing a temporary set of geometries. 
Do you mean adding an index to my data so that I can select it by a 
different (grouping) field instead? Unfortunately I can't do that 
because the same item can be part of 10-20 groups, so there would not 
be an easy way to group items apart from duplicating them in the 
shapefile/dbf. I'm not sure if there's a problem if the same feature 
appears 12 times in the same shapefile.


In the end data reorganizing might be the fastest method available. 
Problem is some items will belong to groups dinamically, so I will 
have to implement a selection mechanism based on item id...


Regards,
Adrian

Steve Lime wrote:

Have you tried a simplified version of your regex? I think you can do:

  EXPRESSION /^ITEM1|ITEM2|ITEM3|ITEM4$/

You might also consider writing a temporary set of geometries if a user will 
continually display from
that set. In that case your overhead would be in managing the set of features 
which would be higher
the first time but then very fast to render. Your dynamic portion of the 
mapfile would reference the
temporary data.

Steve

  

On 7/14/2009 at 1:15 AM, in message 4a5c2277.80...@romtelecom.ro, Adrian Popa


adrian_gh.p...@romtelecom.ro wrote:
  

Hello everyone,

Here's my problem: I'm trying to highlight segments from a line layer by 
using an expression in a specific class. This portion of the mapfile is 
dynamically generated and when it is done, it is sent to mapserver for 
rendering.
My problem is that I have to select between 10 - 400 features at a time 
and I noticed when I have a lot of features there is a severe 
performance degradation in mapserver (takes a lot of time to render or 
even times out).

Right now, my expression is built using regular expressions: something like:
*EXPRESSION /^ITEM1$|^ITEM2$|^ITEM3$|^ITEM4$/*
This works ok, but as I said has a performance penalty when you reach 
~400 items.  My data is selected from a shapefile layer which has about 
5500 items.


Since I wouldn't be using the regular expressions at full capacity (I'm 
matching the full name), I might rewrite the expression using something 
like:
*EXPRESSION ( ([NAME]==ITEM1) OR ([NAME]==ITEM2) OR 
([NAME]==ITEM3) OR ([NAME]==ITEM4) )*


 From the documentation I see that:
/Regular expression with MapServer work similarly to string comparison, 
but allow more complex operation. They are slower than pure string 
comparisons, but might be still faster than logical expression. As with 
the string comparison use regular expressions, a FILTERITEM or a 
CLASSITEM has to defined, respectively.


/I would like to know if there is an efficient way of selecting a list 
of elements from a layer, or what are your recommendations.


Also - have there been significant changes in performance for this issue 
from mapserver 4.10 (I am now migrating to mapserver 5.4)?


Thanks,
Adrian




  




___
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
  



--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


Re: [mapserver-users] Problems when using complex expressions

2009-07-21 Thread Adrian Popa

Thanks, Andreas,

I've tried your solution (and already looked over the manual) but it 
still doesn't match anything...


Also - EXPRESSION ([myColumn] =~ /MYREGEXP/i) doesn't match anything
and EXPRESSION [myColumn] =~ /MYREGEXP/i   complains of a syntax error.

myColumn is the exact same thing as what I use in the layer's CLASSITEM 
definition.


I am puzzled... I think I'm using the EXPRESSION syntax the wrong way, 
but I'm not sure what I'm doing wrong.


Regards,
Adrian

Andreas Albarello wrote:

Adrian Popa wrote:

EXPRESSION (/MYREGEXP/i)- doesn't work (doesn't match anything)
EXPRESSION /MYREGEXP/i  - works
EXPRESSION [myColumn] ==1 - doesn't work (loadClass(): Unknown 
identifier. Parsing error near (=))

EXPRESSION ([myColumn] ==1) - doesn't work (doesn't match anything)
EXPRESSION ([myColumn] eq 1) - works

EXPRESSION (/MYREGEXP/i)  ([myColumn] eq 1)  - doesn't work 
(doesn't match anything)
EXPRESSION /MYREGEXP/i  ([myColumn] eq 1)  - doesn't work 
(loadClass(): Unknown identifier. Parsing error near ())
EXPRESSION ((/MYREGEXP/i)  ([myColumn] eq 1))  - doesn't work 
(doesn't match anything)


I have checked my data and it should match - most likely, my 
expression is wrong. Any suggestions? What is the correct syntax for 
mixing regular expressions with other values?


Adrian,

have a look at this: http://mapserver.org/mapfile/expressions.html

As far as mixing regular and other expressions goes, this is the 
correct way to do it:


EXPRESSION (([myColumn] =~ /MYREGEXP/i)  ([myColumn] eq 1))

Best regards,



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


Re: [mapserver-users] Problems when using complex expressions

2009-07-21 Thread Adrian Popa
I managed to find a workaround for my problem: I used a FILTER statement 
in the layer definition and an EXPRESSION in my classes:


LAYER
   ...
   FILTERITEM myColumn1
   FILTER /MYREGEXP/i

   CLASS
  NAME Test
  EXPRESSION ( [myColumn2] eq 1 )
  
   END
END

This configuration seems to work - I will test it some more...
If anywone has an idea why the previous examples didn't work - I'd be 
happy to hear it out...


Regards,
Adrian

Adrian Popa wrote:

Thanks, Andreas,

I've tried your solution (and already looked over the manual) but it 
still doesn't match anything...


Also - EXPRESSION ([myColumn] =~ /MYREGEXP/i) doesn't match anything
and EXPRESSION [myColumn] =~ /MYREGEXP/i   complains of a syntax error.

myColumn is the exact same thing as what I use in the layer's 
CLASSITEM definition.


I am puzzled... I think I'm using the EXPRESSION syntax the wrong way, 
but I'm not sure what I'm doing wrong.


Regards,
Adrian

Andreas Albarello wrote:

Adrian Popa wrote:

EXPRESSION (/MYREGEXP/i)- doesn't work (doesn't match anything)
EXPRESSION /MYREGEXP/i  - works
EXPRESSION [myColumn] ==1 - doesn't work (loadClass(): Unknown 
identifier. Parsing error near (=))

EXPRESSION ([myColumn] ==1) - doesn't work (doesn't match anything)
EXPRESSION ([myColumn] eq 1) - works

EXPRESSION (/MYREGEXP/i)  ([myColumn] eq 1)  - doesn't work 
(doesn't match anything)
EXPRESSION /MYREGEXP/i  ([myColumn] eq 1)  - doesn't work 
(loadClass(): Unknown identifier. Parsing error near ())
EXPRESSION ((/MYREGEXP/i)  ([myColumn] eq 1))  - doesn't work 
(doesn't match anything)


I have checked my data and it should match - most likely, my 
expression is wrong. Any suggestions? What is the correct syntax for 
mixing regular expressions with other values?


Adrian,

have a look at this: http://mapserver.org/mapfile/expressions.html

As far as mixing regular and other expressions goes, this is the 
correct way to do it:


EXPRESSION (([myColumn] =~ /MYREGEXP/i)  ([myColumn] eq 1))

Best regards,



___
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] Performance in regular expressions or analternative way to select a list of features

2009-07-17 Thread Adrian Popa
Here's how I fixed this issue. I ended up regenerating the shapefile 
and dbf and adding a separate column with the grouping I desired. Now, 
my map file selects from that column, and the syntax is much simpler (by 
one or two orders of magnitude). I am happy with the results, however, I 
didn't get the chance to try out all the other methods because of lack 
of time.


Thanks again,
Adrian

Adrian Popa wrote:

Hello Steve,

I haven't tried out the simplified regex so I don't know if it will be 
faster. I will try to test it as part of a speed test of the various 
methods...


I'm not sure what you mean by writing a temporary set of geometries. 
Do you mean adding an index to my data so that I can select it by a 
different (grouping) field instead? Unfortunately I can't do that 
because the same item can be part of 10-20 groups, so there would not 
be an easy way to group items apart from duplicating them in the 
shapefile/dbf. I'm not sure if there's a problem if the same feature 
appears 12 times in the same shapefile.


In the end data reorganizing might be the fastest method available. 
Problem is some items will belong to groups dinamically, so I will 
have to implement a selection mechanism based on item id...


Regards,
Adrian

Steve Lime wrote:

Have you tried a simplified version of your regex? I think you can do:

  EXPRESSION /^ITEM1|ITEM2|ITEM3|ITEM4$/

You might also consider writing a temporary set of geometries if a user will 
continually display from
that set. In that case your overhead would be in managing the set of features 
which would be higher
the first time but then very fast to render. Your dynamic portion of the 
mapfile would reference the
temporary data.

Steve

  

On 7/14/2009 at 1:15 AM, in message 4a5c2277.80...@romtelecom.ro, Adrian Popa


adrian_gh.p...@romtelecom.ro wrote:
  

Hello everyone,

Here's my problem: I'm trying to highlight segments from a line layer by 
using an expression in a specific class. This portion of the mapfile is 
dynamically generated and when it is done, it is sent to mapserver for 
rendering.
My problem is that I have to select between 10 - 400 features at a time 
and I noticed when I have a lot of features there is a severe 
performance degradation in mapserver (takes a lot of time to render or 
even times out).

Right now, my expression is built using regular expressions: something like:
*EXPRESSION /^ITEM1$|^ITEM2$|^ITEM3$|^ITEM4$/*
This works ok, but as I said has a performance penalty when you reach 
~400 items.  My data is selected from a shapefile layer which has about 
5500 items.


Since I wouldn't be using the regular expressions at full capacity (I'm 
matching the full name), I might rewrite the expression using something 
like:
*EXPRESSION ( ([NAME]==ITEM1) OR ([NAME]==ITEM2) OR 
([NAME]==ITEM3) OR ([NAME]==ITEM4) )*


 From the documentation I see that:
/Regular expression with MapServer work similarly to string comparison, 
but allow more complex operation. They are slower than pure string 
comparisons, but might be still faster than logical expression. As with 
the string comparison use regular expressions, a FILTERITEM or a 
CLASSITEM has to defined, respectively.


/I would like to know if there is an efficient way of selecting a list 
of elements from a layer, or what are your recommendations.


Also - have there been significant changes in performance for this issue 
from mapserver 4.10 (I am now migrating to mapserver 5.4)?


Thanks,
Adrian




  




___
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] Performance in regular expressions or an alternative way to select a list of features

2009-07-15 Thread Adrian Popa

Hello David,

I wasn't aware of the IN syntax. It looks cleaner, and hopefully will 
be better. I think in the end I will try all sollutions and see which 
one is the fastest for a given (large) expression.


Thangs again,
Adrian

Fawcett, David wrote:

Adrian,
 
One method that I have used is to use an IN statement in my expression 
and then use a variable to populate the list of IDs in the statement. 
 
I create a class like this:
 
 CLASS

   NAME Low
   EXPRESSION ('[COUNTY_FIP]' in '%group1%')
   OUTLINECOLOR 0 0 0  
   COLOR 255 204 204

END
 
And then in the URL calling the map, I include group1=27001,27003,27005
 
I actually use this with five classes (five different URL vars) to 
create a thematic map of counties based entirely on data passed in 
through the URL. 
 
I have no idea on how the performance of this method compares to what 
you have done, but it might be worth a try.  There are only 87 
counties in Minnesota, so that is the largest number it gets, but the 
performance isn't bad.
 
David.


-Original Message-
*From:* mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of
*Adrian Popa
*Sent:* Tuesday, July 14, 2009 1:15 AM
*To:* mapserver-users@lists.osgeo.org
*Subject:* [mapserver-users] Performance in regular expressions or
an alternative way to select a list of features

Hello everyone,

Here's my problem: I'm trying to highlight segments from a line
layer by using an expression in a specific class. This portion of
the mapfile is dynamically generated and when it is done, it is
sent to mapserver for rendering.
My problem is that I have to select between 10 - 400 features at a
time and I noticed when I have a lot of features there is a severe
performance degradation in mapserver (takes a lot of time to
render or even times out).
Right now, my expression is built using regular expressions:
something like:
*EXPRESSION /^ITEM1$|^ITEM2$|^ITEM3$|^ITEM4$/*
This works ok, but as I said has a performance penalty when you
reach ~400 items.  My data is selected from a shapefile layer
which has about 5500 items.

Since I wouldn't be using the regular expressions at full capacity
(I'm matching the full name), I might rewrite the expression using
something like:
*EXPRESSION ( ([NAME]==ITEM1) OR ([NAME]==ITEM2) OR
([NAME]==ITEM3) OR ([NAME]==ITEM4) )*

From the documentation I see that:
/Regular expression with MapServer work similarly to string
comparison, but allow more complex operation. They are slower than
pure string comparisons, but might be still faster than logical
expression. As with the string comparison use regular expressions,
a FILTERITEM or a CLASSITEM has to defined, respectively.

/I would like to know if there is an efficient way of selecting a
list of elements from a layer, or what are your recommendations.

Also - have there been significant changes in performance for this
issue from mapserver 4.10 (I am now migrating to mapserver 5.4)?

Thanks,
Adrian



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


Re: [mapserver-users] Performance in regular expressions or analternative way to select a list of features

2009-07-15 Thread Adrian Popa

Hello Steve,

I haven't tried out the simplified regex so I don't know if it will be 
faster. I will try to test it as part of a speed test of the various 
methods...


I'm not sure what you mean by writing a temporary set of geometries. Do 
you mean adding an index to my data so that I can select it by a 
different (grouping) field instead? Unfortunately I can't do that 
because the same item can be part of 10-20 groups, so there would not be 
an easy way to group items apart from duplicating them in the 
shapefile/dbf. I'm not sure if there's a problem if the same feature 
appears 12 times in the same shapefile.


In the end data reorganizing might be the fastest method available. 
Problem is some items will belong to groups dinamically, so I will have 
to implement a selection mechanism based on item id...


Regards,
Adrian

Steve Lime wrote:

Have you tried a simplified version of your regex? I think you can do:

  EXPRESSION /^ITEM1|ITEM2|ITEM3|ITEM4$/

You might also consider writing a temporary set of geometries if a user will 
continually display from
that set. In that case your overhead would be in managing the set of features 
which would be higher
the first time but then very fast to render. Your dynamic portion of the 
mapfile would reference the
temporary data.

Steve

  

On 7/14/2009 at 1:15 AM, in message 4a5c2277.80...@romtelecom.ro, Adrian Popa


adrian_gh.p...@romtelecom.ro wrote:
  

Hello everyone,

Here's my problem: I'm trying to highlight segments from a line layer by 
using an expression in a specific class. This portion of the mapfile is 
dynamically generated and when it is done, it is sent to mapserver for 
rendering.
My problem is that I have to select between 10 - 400 features at a time 
and I noticed when I have a lot of features there is a severe 
performance degradation in mapserver (takes a lot of time to render or 
even times out).

Right now, my expression is built using regular expressions: something like:
*EXPRESSION /^ITEM1$|^ITEM2$|^ITEM3$|^ITEM4$/*
This works ok, but as I said has a performance penalty when you reach 
~400 items.  My data is selected from a shapefile layer which has about 
5500 items.


Since I wouldn't be using the regular expressions at full capacity (I'm 
matching the full name), I might rewrite the expression using something 
like:
*EXPRESSION ( ([NAME]==ITEM1) OR ([NAME]==ITEM2) OR 
([NAME]==ITEM3) OR ([NAME]==ITEM4) )*


 From the documentation I see that:
/Regular expression with MapServer work similarly to string comparison, 
but allow more complex operation. They are slower than pure string 
comparisons, but might be still faster than logical expression. As with 
the string comparison use regular expressions, a FILTERITEM or a 
CLASSITEM has to defined, respectively.


/I would like to know if there is an efficient way of selecting a list 
of elements from a layer, or what are your recommendations.


Also - have there been significant changes in performance for this issue 
from mapserver 4.10 (I am now migrating to mapserver 5.4)?


Thanks,
Adrian




  


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


[mapserver-users] Displaying a string instead of a label

2009-07-15 Thread Adrian Popa

Hi everybody,

Can someone point me to the relevant part of the documentation/example 
that shows how to display a static string (set at the layer level) for a 
layer instead of displaying a label? Does 'annotation' have anything to 
do with this?


Thanks,
Adrian

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


Re: [mapserver-users] Displaying a string instead of a label

2009-07-15 Thread Adrian Popa

Thank you Charlotte,

I will give it a try!

Regards,
Adrian

Charlotte Declercq wrote:

Hi Adrian,

You can set the TEXT property of the CLASS object like this :

CLASS
 NAME departement
 LABEL
   ANGLE 0.00
   ANTIALIAS TRUE
   FONT Arial
   MAXSIZE 256
   MINSIZE 4
   SIZE 8
   TYPE TRUETYPE
   BUFFER 0
   COLOR 0 0 0
   FORCE FALSE
   MINDISTANCE -1
   MINFEATURESIZE -1
   OFFSET 1 1
   PARTIALS TRUE
   POSITION CC
   SHADOWCOLOR 0 0 0
 END
 STYLE
   ANGLE 360
   COLOR 232 246 9
   OPACITY 100
   SIZE 10
   SYMBOL Carre
 END
 TEXT my static text
END

It will override the label. You don't need CLASSITEM, LABELITEM, 
LABELMAXSCALEDENOM and LABELMINSCADENOM but you need the LABEL object.

The documentation is here : http://mapserver.org/mapfile/class.html

/TEXT [string]/
   /Static text to label features in this class with. This overrides
   values obtained from the LABELTIEM. The string may be given as an
   expression delimited using the ()’s. This allows you to concatenate
   multiple attributes into a single label. For example:
   ([FIRSTNAME],[LASTNAME])./


I think you can set the TEXT property on classical layer types such as 
POLYGON, LINE, POINT, not only ANNOTATION.
If you use ANNOTATION, then the text will be placed at the centroid of 
the polygon of the middle of the line.


Regards,




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


[mapserver-users] Performance in regular expressions or an alternative way to select a list of features

2009-07-14 Thread Adrian Popa

Hello everyone,

Here's my problem: I'm trying to highlight segments from a line layer by 
using an expression in a specific class. This portion of the mapfile is 
dynamically generated and when it is done, it is sent to mapserver for 
rendering.
My problem is that I have to select between 10 - 400 features at a time 
and I noticed when I have a lot of features there is a severe 
performance degradation in mapserver (takes a lot of time to render or 
even times out).

Right now, my expression is built using regular expressions: something like:
*EXPRESSION /^ITEM1$|^ITEM2$|^ITEM3$|^ITEM4$/*
This works ok, but as I said has a performance penalty when you reach 
~400 items.  My data is selected from a shapefile layer which has about 
5500 items.


Since I wouldn't be using the regular expressions at full capacity (I'm 
matching the full name), I might rewrite the expression using something 
like:
*EXPRESSION ( ([NAME]==ITEM1) OR ([NAME]==ITEM2) OR 
([NAME]==ITEM3) OR ([NAME]==ITEM4) )*


From the documentation I see that:
/Regular expression with MapServer work similarly to string comparison, 
but allow more complex operation. They are slower than pure string 
comparisons, but might be still faster than logical expression. As with 
the string comparison use regular expressions, a FILTERITEM or a 
CLASSITEM has to defined, respectively.


/I would like to know if there is an efficient way of selecting a list 
of elements from a layer, or what are your recommendations.


Also - have there been significant changes in performance for this issue 
from mapserver 4.10 (I am now migrating to mapserver 5.4)?


Thanks,
Adrian

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


Re: [mapserver-users] Performance in regular expressions or an alternative way to select a list of features

2009-07-14 Thread Adrian Popa

Hello Nikolai,

As far as you know - the Layers/Classes are processed in paralel 
(threads)? Would it even be more efficient not to use expressions, but 
to use simple string matchings and dynamically generate 10-400 Classes 
in a layer (one class per item)?


What would be the best/most scalable approach?

Thank you,
Adrian

Nikolai Nikolov wrote:


Hi Adrian,

 

I have used long EXPRESSION list in the past, but my data are 
“static”, so eventually I modified the map data and removed the 
polygons I didn’t want to render.


 

I could suggest to you to use in your map file several LAYERs or 
CLASSes to “spread around” long EXPRESSION lists. Those LAYERs or 
CLASSes would be identical but for the EXPRESSION lists.  You could 
put a limit of let’s say 10 selected features per CLASS definition.


 


Best regards,

Nick

 




*From:* mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Adrian 
Popa

*Sent:* 14 July 2009 07:15
*To:* mapserver-users@lists.osgeo.org
*Subject:* [mapserver-users] Performance in regular expressions or an 
alternative way to select a list of features


 


Hello everyone,

Here's my problem: I'm trying to highlight segments from a line layer 
by using an expression in a specific class. This portion of the 
mapfile is dynamically generated and when it is done, it is sent to 
mapserver for rendering.
My problem is that I have to select between 10 - 400 features at a 
time and I noticed when I have a lot of features there is a severe 
performance degradation in mapserver (takes a lot of time to render or 
even times out).
Right now, my expression is built using regular expressions: something 
like:

*EXPRESSION /^ITEM1$|^ITEM2$|^ITEM3$|^ITEM4$/*
This works ok, but as I said has a performance penalty when you reach 
~400 items.  My data is selected from a shapefile layer which has 
about 5500 items.


Since I wouldn't be using the regular expressions at full capacity 
(I'm matching the full name), I might rewrite the expression using 
something like:
*EXPRESSION ( ([NAME]==ITEM1) OR ([NAME]==ITEM2) OR 
([NAME]==ITEM3) OR ([NAME]==ITEM4) )*


From the documentation I see that:
/Regular expression with MapServer work similarly to string 
comparison, but allow more complex operation. They are slower than 
pure string comparisons, but might be still faster than logical 
expression. As with the string comparison use regular expressions, a 
FILTERITEM or a CLASSITEM has to defined, respectively.


/I would like to know if there is an efficient way of selecting a list 
of elements from a layer, or what are your recommendations.


Also - have there been significant changes in performance for this 
issue from mapserver 4.10 (I am now migrating to mapserver 5.4)?


Thanks,
Adrian



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


[mapserver-users] Adding a diagonal hash over a layer

2009-06-29 Thread Adrian Popa

Hello,

I'd like to add a diagonal hash over some polygon elements. Can this be 
done using a symbol? If yes, can you point me to an example?


Also - how can I create such a symbol?

I'm using mapserver 5.4.

Thank you for your patience.
Regards,
Adrian

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


Re: [mapserver-users] Adding a proxy/wrapper between the web frontend (openlayers) and mapserver

2009-06-29 Thread Adrian Popa
Hi everyone! I managed to create such a proxy/wrapper - after I 
generated the mapfile, I just modified some environment variables and 
called mapserv as a regular script. Thankfully the evrironment in which 
my wrapper was called is preserved and sent to mapserv.


Here's an example:

#create the mapfile as desired and save the contents to a file who's 
complete path is stored in $file


#change the query string and add the map parameter:
$ENV{'QUERY_STRING'} = $ENV{'QUERY_STRING'}.map=$file;
#call the original mapserv script and return the output to the user
print `/var/www/cgi-bin/mapserv`;

#all done

The only major problem I encountered was that mapserver couldn't open 
the files referenced in the mapfile (fonts, template, shapefiles). I had 
to specify the  full paths in the map file to get it working.


Cheers,
Adrian

Adrian Popa wrote:

Hello everyone!

For special reasons (dynamic data) I need to create some sort of 
proxy/wrapper around mapserv (5.2) to permit the dynamic modification 
of the mapfile based on the age of the specific mapfile.
Basically the user will request a mapfile which on most ocasions will 
be generated on the fly (server-side). I would like to feed this 
mapfile to mapserv and return the image to the user in a way it's 
compatible with open layers. The user would see this wapper in a 
transparent way.


I know how to configure the openlayers part and I know how to generate 
the map file, but I'm not sure how to link my wrapper to mapserver...
How do I call mapserver the same way the web server would call it? I 
think if I call it through a shell, it wouldn't work the same way. I 
don't really want to call shp2img because it's harder to maintain.


The output part should be straightforward - I would just print out 
what mapserver returns - because it should take care of setting 
content-type and sending the image.


Any tips on where I could start?
Thanks!

P.S. I'm writing the wapper in perl and I'm not using the mapserver 
API (but I could if it's necessary)



___
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] AGG vs GD rendering shows no difference

2009-06-17 Thread Adrian Popa
I've managed to run mapserv through gdb, and my suspicions were 
confirmed - it dies in the AGG part:


...
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xa3e000
[Thread debugging using libthread_db enabled]
[New Thread -1208244032 (LWP 18090)]

*Program received signal SIGSEGV, Segmentation fault.*
[Switching to Thread -1208244032 (LWP 18090)]
*0x00402b8c in agg::vertex_sequenceagg::vertex_dist, 6u::add () from 
/usr/lib/libagg.so.2*

(gdb) where
#0  0x00402b8c in agg::vertex_sequenceagg::vertex_dist, 6u::add () 
from /usr/lib/libagg.so.2
#1  0x00402c2f in agg::vertex_sequenceagg::vertex_dist, 
6u::modify_last () from /usr/lib/libagg.so.2

#2  0x004050e5 in agg::vcgen_stroke::add_vertex () from /usr/lib/libagg.so.2
#3  0x080d2f4c in agg::conv_adaptor_vcgenline_adaptor, 
agg::vcgen_stroke, agg::null_markers::vertex (this=0xbfdcdbf4, 
x=0xbfdcdc98, y=0xbfdcdca0)
   at 
/home/adrianp/mapserver/mapserver-5.4.1/../agg-2.5/include/agg_conv_adaptor_vcgen.h:115
#4  0x080e4206 in AGGMapserverRenderer::renderPolylineline_adaptor 
(this=0xa079968, p...@0xa081b58, col...@0xbfdcdf48, width=1, 
dashstylelength=0, dashstyle=0x9c27980,
   lc=agg::round_cap, lj=agg::round_join) at 
/home/adrianp/mapserver/mapserver-5.4.1/../agg-2.5/include/agg_rasterizer_scanline_aa.h:206
#5  0x080ccc46 in msDrawLineSymbolAGG (symbolset=0x9c2556c, 
image=0x9c4bb78, p=0xbfdce298, style=0x9c3ba18, scalefactor=1) at 
mapagg.cpp:1672
#6  0x080b331d in msDrawLineSymbol (symbolset=0x9c2556c, 
image=0x9c4bb78, p=0xbfdce298, style=0x9c3ba18, scalefactor=1) at 
mapdraw.c:2117
#7  0x080b1d4d in msDrawShape (map=0x9c25548, layer=0x9c3ae60, 
shape=0xbfdce298, image=0x9c4bb78, style=0, querymapMode=1) at 
mapdraw.c:1782
#8  0x080ae1eb in msDrawVectorLayer (map=0x9c25548, layer=0x9c3ae60, 
image=0x9c4bb78) at mapdraw.c:938
#9  0x080ad91d in msDrawLayer (map=0x9c25548, layer=0x9c3ae60, 
image=0x9c4bb78) at mapdraw.c:743

#10 0x080acb54 in msDrawMap (map=0x9c25548, querymap=0) at mapdraw.c:441
#11 0x080584b3 in main (argc=2, argv=0xbfdcea84) at mapserv.c:1417

I'll have to check to see if there are known bugs regarding AGG...

Adrian Popa wrote:

Thank you for your suggestion Andreas,

I have run shp2img and unfortunately:
[r...@terra tmp]# shp2img -o /tmp/out.png -m 
/var/www/html/msmap/dynamicmaps/fibUaBrx.map -e 20.258 
43.16 29.703 49.2016 -s 1250 800 -l GranitaJudete 
Judete Urban Rural RuralSate buildings fibra fiber-common fiber-STM64 
fiber-STM16 fiber-STM4 fiber-STM1 fiber-problems-main 
fiber-problems-related fibraProblems

*Segmentation fault*

Running the command through strace, it ends up like this:


read(4, h\376\237\224O\320;@p\225\4\25\'x...@\264d\270^\320;@\26..., 
45056) = 45056
read(4, \303\362oU\36\206;@by\237\354...@\34\271\214\333\37\206..., 
4096) = 4096

_llseek(9, 12288, [12288], SEEK_SET)= 0
read(9, ..., 4096) = 148
_llseek(4, 1458176, [1458176], SEEK_SET) = 0
read(4, \25\327\377\332\27\...@\30\256\23v9|;@\233M%\235\372\22..., 
24576) = 24576
read(4,  a\1$\203\...@.\245\211px 
;@\314\353\330\355\242\...@\367..., 4096) = 1784

close(8)= 0
munmap(0xb7f36000, 4096)= 0
close(4)= 0
munmap(0xb7f38000, 4096)= 0
close(9)= 0
munmap(0xb7f35000, 4096)= 0
gettimeofday({1245157506, 462482}, NULL) = 0
gettimeofday({1245157506, 462600}, NULL) = 0
open(/etc/localtime, O_RDONLY)= 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=798, ...}) = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=798, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f38000
read(4, TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\7\0..., 
4096) = 798

close(4)= 0
munmap(0xb7f38000, 4096)= 0
gettimeofday({1245157506, 463468}, NULL) = 0
gettimeofday({1245157506, 463535}, NULL) = 0
gettimeofday({1245157506, 463599}, NULL) = 0
gettimeofday({1245157506, 463664}, NULL) = 0
gettimeofday({1245157506, 463734}, NULL) = 0
gettimeofday({1245157506, 463802}, NULL) = 0
gettimeofday({1245157506, 463866}, NULL) = 0
gettimeofday({1245157506, 463934}, NULL) = 0
gettimeofday({1245157506, 464028}, NULL) = 0
*open(/var/www/html/msmap/dynamicmaps/../data/Judete.shp, 
O_RDONLY|O_LARGEFILE) = 4*
open(/var/www/html/msmap/dynamicmaps/../data/Judete.shx, 
O_RDONLY|O_LARGEFILE) = 8

fstat64(4, {st_mode=S_IFREG|0555, st_size=1484536, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f38000
*read(4*, \0\0\'\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\vS|..., 
4096) = 4096

fstat64(8, {st_mode=S_IFREG|0555, st_size=436, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f36000
read(8, \0\0\'\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0..., 
4096) = 436
open(/var/www

Re: [mapserver-users] AGG vs GD rendering shows no difference

2009-06-17 Thread Adrian Popa

Hello everyone!

After a few hours of digging, I managed to solve the problem.
I checked mapserver's dependencies and it was linked against agg 2.3:
[r...@terra tmp]# ldd /var/www/cgi-bin/mapserv | grep agg
   libagg.so.2 = /usr/lib/libagg.so.2 (0x003f5000)

lrwxrwxrwx 1 root root 15 Jun 15 10:31 /usr/lib/libagg.so - 
libagg.so.2.0.1
lrwxrwxrwx 1 root root 15 Jun 15 10:31 /usr/lib/libagg.so.2 - 
libagg.so.2.0.1

-rwxr-xr-x 1 root root 228524 Feb 17  2006 /usr/lib/libagg.so.2.0.1

However, when I compiled mapserver I pointed the AGG code (--with-agg) 
to version 2.5.


So mapserver had been compiled against agg 2.5 but was running with agg 
2.3. This caused the segfault when using agg.


The solution is to compile AGG2.5 and to install it in the system.
Unfortunately, the AGG documentation is scarce and doesn't clearly say 
how to compile the code, and even if I'm a linux seasoned user, I failed 
to see the autogen.sh script.

Here's how I compiled AGG:
*sh 
autogen.sh   

./configure --disable-platform --disable-examples 
--prefix=/usr 

make


make install  *


And now, I have also the newer libs in my /usr/lib/ directory:
[r...@terra mapserver]# ls -l /usr/lib/libagg*
-rw-r--r-- 1 root root 1313570 Jun 17 17:06 /usr/lib/libagg.a
-rw-r--r-- 1 root root  395874 Jun 17 17:06 /usr/lib/libaggfontfreetype.a
-rwxr-xr-x 1 root root 897 Jun 17 17:06 /usr/lib/libaggfontfreetype.la
lrwxrwxrwx 1 root root  27 Jun 17 17:06 
/usr/lib/libaggfontfreetype.so - libaggfontfreetype.so.2.0.4
lrwxrwxrwx 1 root root  27 Jun 17 17:06 
/usr/lib/libaggfontfreetype.so.2 - libaggfontfreetype.so.2.0.4
-rwxr-xr-x 1 root root  283338 Jun 17 17:06 
/usr/lib/libaggfontfreetype.so.2.0.4

-rwxr-xr-x 1 root root 785 Jun 17 17:06 /usr/lib/libagg.la
-rw-r--r-- 1 root root   53282 Feb 17  2006 /usr/lib/libaggplatformX11.a
lrwxrwxrwx 1 root root  26 Jun 15 10:31 
/usr/lib/libaggplatformX11.so - libaggplatformX11.so.2.0.1
lrwxrwxrwx 1 root root  26 Jun 15 10:31 
/usr/lib/libaggplatformX11.so.2 - libaggplatformX11.so.2.0.1
-rwxr-xr-x 1 root root   43468 Feb 17  2006 
/usr/lib/libaggplatformX11.so.2.0.1
lrwxrwxrwx 1 root root  15 Jun 17 17:06 /usr/lib/libagg.so - 
libagg.so.2.0.4
lrwxrwxrwx 1 root root  15 Jun 17 17:06 /usr/lib/libagg.so.2 - 
libagg.so.2.0.4

-rwxr-xr-x 1 root root  228524 Feb 17  2006 /usr/lib/libagg.so.2.0.1
-rwxr-xr-x 1 root root  774469 Jun 17 17:06 /usr/lib/libagg.so.2.0.4

And mapserver renders my maps very well (see attached photos)

Thank you all for your help!
Regards,
Adrian

inline: agg.pnginline: png.png___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] AGG vs GD rendering shows no difference

2009-06-16 Thread Adrian Popa

Thank you for your suggestion.

I have corrected the mapfile ( added IMAGETYPE 'AGG'), however, when I 
try to load the map, I get a 500 web server error:


[Tue Jun 16 13:43:25 2009] [error] [client 80.97.196.77] Premature end 
of script headers: mapserv, referer: http://terra/msmap/testmap.pl


It seems to me that mapserv dies and doesn't output any headers back. 
How could I find out the error message?
I already have a log statement in my WEB section: LOG 
/var/www/html/map.log (the file is writable by apache)


Unfortunately I don't get anything in this log.

My mapserver supports:

[r...@terra html]# /var/www/cgi-bin/mapserv -v
MapServer version 5.4.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV 
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER 
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER 
SUPPORTS=THREADS SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR 
INPUT=GDAL INPUT=MYGIS INPUT=SHAPEFILE


Any ideas how to debug this?

Thanks

Andreas Albarello wrote:

Adrian Popa wrote:

The original mapfile had rendering set up like this:
IMAGETYPE PNG

while the new mapfile has rendering set up like this:
IMAGETYPE PNG
OUTPUTFORMAT

   NAME 'AGG'
   DRIVER AGG/PNG

  IMAGEMODE RGB
END 


Adrian,

you'll most likely need to write

IMAGETYPE 'AGG'

instead of

IMAGETYPE PNG

to make sure your new outputformat is used.

Best regards,




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


Re: [mapserver-users] AGG vs GD rendering shows no difference

2009-06-16 Thread Adrian Popa

Thank you for your suggestion Andreas,

I have run shp2img and unfortunately:
[r...@terra tmp]# shp2img -o /tmp/out.png -m 
/var/www/html/msmap/dynamicmaps/fibUaBrx.map -e 20.258 
43.16 29.703 49.2016 -s 1250 800 -l GranitaJudete Judete 
Urban Rural RuralSate buildings fibra fiber-common fiber-STM64 
fiber-STM16 fiber-STM4 fiber-STM1 fiber-problems-main 
fiber-problems-related fibraProblems

*Segmentation fault*

Running the command through strace, it ends up like this:


read(4, h\376\237\224O\320;@p\225\4\25\'x...@\264d\270^\320;@\26..., 
45056) = 45056
read(4, \303\362oU\36\206;@by\237\354...@\34\271\214\333\37\206..., 
4096) = 4096

_llseek(9, 12288, [12288], SEEK_SET)= 0
read(9, ..., 4096) = 148
_llseek(4, 1458176, [1458176], SEEK_SET) = 0
read(4, \25\327\377\332\27\...@\30\256\23v9|;@\233M%\235\372\22..., 
24576) = 24576
read(4,  a\1$\203\...@.\245\211px ;@\314\353\330\355\242\...@\367..., 
4096) = 1784

close(8)= 0
munmap(0xb7f36000, 4096)= 0
close(4)= 0
munmap(0xb7f38000, 4096)= 0
close(9)= 0
munmap(0xb7f35000, 4096)= 0
gettimeofday({1245157506, 462482}, NULL) = 0
gettimeofday({1245157506, 462600}, NULL) = 0
open(/etc/localtime, O_RDONLY)= 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=798, ...}) = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=798, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f38000
read(4, TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\7\0..., 
4096) = 798

close(4)= 0
munmap(0xb7f38000, 4096)= 0
gettimeofday({1245157506, 463468}, NULL) = 0
gettimeofday({1245157506, 463535}, NULL) = 0
gettimeofday({1245157506, 463599}, NULL) = 0
gettimeofday({1245157506, 463664}, NULL) = 0
gettimeofday({1245157506, 463734}, NULL) = 0
gettimeofday({1245157506, 463802}, NULL) = 0
gettimeofday({1245157506, 463866}, NULL) = 0
gettimeofday({1245157506, 463934}, NULL) = 0
gettimeofday({1245157506, 464028}, NULL) = 0
*open(/var/www/html/msmap/dynamicmaps/../data/Judete.shp, 
O_RDONLY|O_LARGEFILE) = 4*
open(/var/www/html/msmap/dynamicmaps/../data/Judete.shx, 
O_RDONLY|O_LARGEFILE) = 8

fstat64(4, {st_mode=S_IFREG|0555, st_size=1484536, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f38000
*read(4*, \0\0\'\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\vS|..., 
4096) = 4096

fstat64(8, {st_mode=S_IFREG|0555, st_size=436, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f36000
read(8, \0\0\'\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0..., 
4096) = 436
open(/var/www/html/msmap/dynamicmaps/../data/Judete.dbf, 
O_RDONLY|O_LARGEFILE) = 9

fstat64(9, {st_mode=S_IFREG|0555, st_size=12436, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f35000
read(9, \3k\6\24*\0\0\0\201\0%\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0..., 
4096) = 4096

_llseek(9, 0, [0], SEEK_SET)= 0
read(9, \3k\6\24*\0\0\0\201\0%\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0..., 
4096) = 4096

_llseek(8, 0, [0], SEEK_SET)= 0
read(8, \0\0\'\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0..., 
4096) = 436

read(8, , 4096)   = 0
_llseek(4, 0, [0], SEEK_SET)= 0
*read(4*, \0\0\'\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\vS|..., 
4096) = 4096
*read(4,* 
\...@by\233\300\226bg@\342\376\n\341\34...@\266mo\267\241..., 49152) = 
49152
*read(4,* ]\3...@\34\21\376\224 +...@g\245\\8\247\3356@6\277\213.\f..., 
4096) = 4096

--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Process 20970 detached


I'm not sure if it faults because it can't read from file handler 4 
(Judete.shp), or if it's something else... I also tried by not 
specifying Judete in the layer list, but it still dies (while reading 
Judete.shp!).


I will look further into problems with AGG (because it renders fine with 
PNG)


Thank you for your help - now I know where to look.
Regards,
Adrian

P.S. Ideas are welcome!

Andreas Albarello wrote:


On 16 Jun 2009, at 14:25, Adrian Popa wrote:


Hello David,

I got the 500 errors from the http error log file. Unfortunately no 
additional information is provided.
I added the MS_ERRORFILE and DEBUG statements to my map file and 
although the errorfile is created, I don't get any other information 
(neither when the map loads perfectly, nor when it dies with 
premature end of script headers.


I read RFC 28 (http://mapserver.org/development/rfc/ms-rfc-28.html) 
and they specified that the server should be compiled with 
-DENABLE_STDERR_DEBUG, so I recompiled mapserver:
CFLAGS=-DENABLE_STDERR_DEBUG ./configure  --with-freetype --with-png 
--with-agg=../agg-2.5 --with-proj --with-ogr --with-gdal --with-xml2 
--with-wfs --with-wcs --with-wmsclient --with-wfsclient

[mapserver-users] Importing a Google/Yahoo maps raster layer

2009-06-01 Thread Adrian Popa

Hello everybody,

I'm not sure if it's been disscussed on the list already or not, but I 
wanted to ask if it's possible to integrate mapserver (and starting with 
which version?) with Google/Yahoo maps.
I would like to display the raster (satellite) images from google/yahoo 
as a layer in the map. The thing is - I don't want to store the actual 
raster data on my server - but to make requests to google/yahoo on the fly.


Thank you,
Adrian Popa

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


Re: [mapserver-users] Importing a Google/Yahoo maps raster layer

2009-06-01 Thread Adrian Popa

Hello David,

Unfortunatelly I am tied into a different web presentation layer - 
MsMap. It has some features (like marking locations at specific 
coordinates and adding interactive options to them) and I can't abandon it.

I will look at openlayers, to see if it supports the functionality I need.

Thank you for your help.
Adrian Popa

Fawcett, David wrote:

Take a look at OpenLayers.  http://www.openlayers.org
 
Here is an example of an OpenLayers application that uses Google as 
the base layer.  
http://www.openlayers.org/dev/examples/sundials-spherical-mercator.html  
(When the app first loads, it is using OpenStreetMap data as the base 
layer.  Click on the '+' icon on the right side of the map to expand 
the layer switcher and you can then switch to a Google layer.)
 
You can also use Microsoft Virtual Earth data 
http://www.openlayers.org/dev/examples/
 
And using MapServer, you can publish your data as a WMS and pull it in 
to the same OpenLayers app.  (You can also connect to MapServer with a 
native MapServer CGI call, but the developers are encouraging the use 
of a standard WMS call.)
 
David.


-Original Message-
*From:* mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of
*Adrian Popa
*Sent:* Monday, June 01, 2009 4:16 AM
*To:* Rahkonen Jukka
*Cc:* mapserver-users@lists.osgeo.org
*Subject:* Re: [mapserver-users] Importing a Google/Yahoo maps
raster layer

Hello,

Thank you for your clarification. So, I would need the client-side
to support google/yahoo layers and mapserver would run to feed
just its specific layers.
Interesting.

Anyway, do you know any other projects that offer (with an open
license) access to raster satellite/aerial imagery that can be
integrated with mapserver?

Regards,
Adrian Popa

Rahkonen Jukka wrote:

Hi,

Terms and conditions of these services do not allow cascading
Google/Yahoo maps through Mapserver.  However, it is allowed to let the
mapping client to make this integration. One example I found from my
bookmarks is here:

http://sautter.com/map/?zoom=5lat=64.45292lon=30layers=B000TFFF

-Jukka Rahkonen

Adrian Popa wrote:
  

Hello everybody,

I'm not sure if it's been disscussed on the list already or 
not, but I wanted to ask if it's possible to integrate 
mapserver (and starting with which version?) with Google/Yahoo maps.
I would like to display the raster (satellite) images from 
google/yahoo as a layer in the map. The thing is - I don't 
want to store the actual raster data on my server - but to 
make requests to google/yahoo on the fly.


Thank you,
Adrian Popa

___
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] Importing a Google/Yahoo maps raster layer

2009-06-01 Thread Adrian Popa

Hello Christopher,

Your example has the elements that I need :) Is this basic functionality 
included in openlayers by default, or is it an addon?
Also - will openlayers work with mapserver by default - or through WMS 
(I don't have experience with WMS)?


Thanks for your references.

Christopher Schmidt wrote:

On Mon, Jun 01, 2009 at 05:06:24PM +0300, Adrian Popa wrote:
  

Hello David,

Unfortunatelly I am tied into a different web presentation layer - 
MsMap. It has some features (like marking locations at specific 
coordinates and adding interactive options to them) and I can't abandon it.

I will look at openlayers, to see if it supports the functionality I need.



I'm assuming Annotations are visible marks on the map, and adding
interactive options to them means that you can cause something to
happen when you click. The first example that was given -- the
'sundials' example -- has both of these features.

For a more advanced demonstration of OpenLayers technology, you might be
interested in something more like:

  http://recovery-map.org/map/76/toxic-rivers-of-boston/

-- Chris  

  

Thank you for your help.
Adrian Popa

Fawcett, David wrote:


Take a look at OpenLayers.  http://www.openlayers.org

Here is an example of an OpenLayers application that uses Google as 
the base layer.  
http://www.openlayers.org/dev/examples/sundials-spherical-mercator.html  
(When the app first loads, it is using OpenStreetMap data as the base 
layer.  Click on the '+' icon on the right side of the map to expand 
the layer switcher and you can then switch to a Google layer.)


You can also use Microsoft Virtual Earth data 
http://www.openlayers.org/dev/examples/


And using MapServer, you can publish your data as a WMS and pull it in 
to the same OpenLayers app.  (You can also connect to MapServer with a 
native MapServer CGI call, but the developers are encouraging the use 
of a standard WMS call.)


David.

   -Original Message-
   *From:* mapserver-users-boun...@lists.osgeo.org
   [mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of
   *Adrian Popa
   *Sent:* Monday, June 01, 2009 4:16 AM
   *To:* Rahkonen Jukka
   *Cc:* mapserver-users@lists.osgeo.org
   *Subject:* Re: [mapserver-users] Importing a Google/Yahoo maps
   raster layer

   Hello,

   Thank you for your clarification. So, I would need the client-side
   to support google/yahoo layers and mapserver would run to feed
   just its specific layers.
   Interesting.

   Anyway, do you know any other projects that offer (with an open
   license) access to raster satellite/aerial imagery that can be
   integrated with mapserver?

   Regards,
   Adrian Popa

   Rahkonen Jukka wrote:
  

   Hi,

   Terms and conditions of these services do not allow cascading
   Google/Yahoo maps through Mapserver.  However, it is allowed to let 
   the

   mapping client to make this integration. One example I found from my
   bookmarks is here:

   http://sautter.com/map/?zoom=5lat=64.45292lon=30layers=B000TFFF

   -Jukka Rahkonen

   Adrian Popa wrote:
 


   Hello everybody,

   I'm not sure if it's been disscussed on the list already or 
   not, but I wanted to ask if it's possible to integrate 
   mapserver (and starting with which version?) with Google/Yahoo maps.
   I would like to display the raster (satellite) images from 
   google/yahoo as a layer in the map. The thing is - I don't 
   want to store the actual raster data on my server - but to 
   make requests to google/yahoo on the fly.


   Thank you,
   Adrian Popa

   ___
   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




  



--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


Re: [mapserver-users] Importing a Google/Yahoo maps raster layer

2009-06-01 Thread Adrian Popa

Thank you for the info - I will give it a try on a testbed installation :)

Christopher Schmidt wrote:

On Mon, Jun 01, 2009 at 05:20:25PM +0300, Adrian Popa wrote:
  

Hello Christopher,

Your example has the elements that I need :) Is this basic functionality 
included in openlayers by default, or is it an addon?
Also - will openlayers work with mapserver by default - or through WMS 
(I don't have experience with WMS)?



Both, but WMS is highly recommended, because using MapServer as CGI is
prone to hide errors due to misconfiguration. (Setting up WMS requires
only adding:

  metadata
web
  wms_srs EPSG:4326
end
  end

to your mapfile to work minimally; everything else is optional.)

The recovery map example has a significant amount of code, but it is
using the trunk version of OpenLayers with no additional features. The
UI, some of the popups, the layer addition/removal are all additional
pieces added to that UI, but there are other toolkits (Like GeoExt) that
provide these in open source software as well.

Best Regards,

  



--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


Re: [mapserver-users] Help in Fedora Linux

2009-04-10 Thread Adrian Popa

You could disable selinux by setting:
SELINUX=disabled
in /etc/sysconfig/selinux and rebooting your system.

If you want to use selinux, you will need to create a set of 
permissions to allow mapserver to write to specific directories - but 
it's beyond my level of expertise...


Rui Gomes wrote:

Hi...

I build a websig in Linux Ubuntu and now i'm trying to do the same in
Linux Fedora but i having a few problems.
SELinux is preventing the write of the images in the tmp folder.
How i solve this?

Thanks


  



--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


[mapserver-users] Generating a symbol with a fixed size

2009-04-09 Thread Adrian Popa

Hello everybody,

I'm using mapserver v4.10 and I'm trying to display a circle symbol that 
has a fixed radius (in meters) that shows the coverage area over a map. 
The main problem is setting the radius so it would change and cover the 
same area with different zoom levels (more clearly - I want the radius 
to be 40m independent of the zoom selected).


Is it possible to do with mapserver?
The data (points) where I want to draw this symbol is available as an 
ESRI shapefile layer (as POINT data).


Thanks in advance,

--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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


[mapserver-users] displaying LINESTRING elements from shapefiles

2009-04-06 Thread Adrian Popa

Hello everybody,

I'm trying to display a map generated from openstreetmaps and saved as 
several shapefile layers. The map was obtained from: 
http://download.geofabrik.de/osm/europe/

The shapefile roads.shp has a data type of LINESTRING:

[r...@alarms romania-osm-shp]# ogrinfo -al roads.shp | head -30
INFO: Open of `roads.shp'
 using driver `ESRI Shapefile' successful.

Layer name: roads
Geometry: Line String
Feature Count: 51469
Extent: (20.379788, 43.653826) - (29.712869, 48.221387)
Layer SRS WKT:
GEOGCS[GCS_WGS_1984,
   DATUM[WGS_1984,
   SPHEROID[WGS_1984,6378137,298.257223563]],
   PRIMEM[Greenwich,0],
   UNIT[Degree,0.017453292519943295]]
osm_id: Real (16.0)
name: String (32.0)
type: String (16.0)
oneway: Integer (1.0)
OGRFeature(roads):0
 osm_id (Real) = 1349
 name (String) = Bulevardul Mircea Eliade
 type (String) = tertiary
 oneway (Integer) = 0
 LINESTRING (26.0931117 44.4696734,26.09368389998 
44.46912489997,26.0940642 44.4685717,26.0961094 
44.46564860002)


I've tried creating the MAP file with a layer type of 
LINE/LINESTRING/POLYGON, but the map would not display the layer 
(however mapserver would generate an image).


My version of mapserver is 4.10.3 (fedora core 8).

My question is: can I display this data type directly with mapserver, or 
do I need to convert it to something else? Is my version of mapserver 
too old to display this data?


Thanks.

Adrian

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


Re: [mapserver-users] displaying LINESTRING elements from shapefiles

2009-04-06 Thread Adrian Popa

Hello,

Thanks for the example - I will look into it.

Cheers,
Adrian

Rahkonen Jukka wrote:

Hi,

This layer shows OSM roads for me from the same shapefiles that you are
trying to use. 


LAYER
NAME OSM_roads
STATUS ON
DATA d:\Data\OSM\roads
TYPE LINE
UNITS METERS
METADATA
  wms_titleOSM_tiet
END
CLASS
NAME roads
OUTLINECOLOR 0 255 0
END
PROJECTION
  init=epsg:4326 
END
  END


Check that EXTENT in your mapfile suits the data.

-Jukka Rahkonen-
 


Adrian Popa wrote:

  

Hello everybody,

I'm trying to display a map generated from openstreetmaps and 
saved as several shapefile layers. The map was obtained from: 
http://download.geofabrik.de/osm/europe/

The shapefile roads.shp has a data type of LINESTRING:

[r...@alarms romania-osm-shp]# ogrinfo -al roads.shp | head -30
INFO: Open of `roads.shp'
  using driver `ESRI Shapefile' successful.

Layer name: roads
Geometry: Line String
Feature Count: 51469
Extent: (20.379788, 43.653826) - (29.712869, 48.221387) Layer SRS WKT:
GEOGCS[GCS_WGS_1984,
DATUM[WGS_1984,
SPHEROID[WGS_1984,6378137,298.257223563]],
PRIMEM[Greenwich,0],
UNIT[Degree,0.017453292519943295]]
osm_id: Real (16.0)
name: String (32.0)
type: String (16.0)
oneway: Integer (1.0)
OGRFeature(roads):0
  osm_id (Real) = 1349
  name (String) = Bulevardul Mircea Eliade
  type (String) = tertiary
  oneway (Integer) = 0
  LINESTRING (26.0931117 44.4696734,26.09368389998
44.46912489997,26.0940642 44.4685717,26.0961094
44.46564860002)

I've tried creating the MAP file with a layer type of 
LINE/LINESTRING/POLYGON, but the map would not display the 
layer (however mapserver would generate an image).


My version of mapserver is 4.10.3 (fedora core 8).

My question is: can I display this data type directly with 
mapserver, or do I need to convert it to something else? Is 
my version of mapserver too old to display this data?


Thanks.

Adrian

___
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] Changing the EXTENT for a layer

2009-02-25 Thread Adrian Popa

Hello all!

I'm trying to display some layers (ESRI Shapefile and MapInfo) in the 
same map. The ESRI shapefiles work just fine, and I've used them for a 
long time. The new MapInfo layer however has very different Extent 
values for its coordinates and does not overlap with the original layers 
(they should overlap, because they cover the same area).


Here is some output from ogrinfo:

1. A layer that displays ok and for which the coordinates are 
longitude/latitude:


[adri...@server data]$ ogrinfo Limits.shp -so -al
Had to open data source read-only.
INFO: Open of `Limits.shp'
 using driver `ESRI Shapefile' successful.

Layer name: Limits
Geometry: Line String
Feature Count: 8718
*Extent: (20.261522, 43.618437) - (29.704897, 48.264780)*
Layer SRS WKT:
GEOGCS[GCS_WGS_1984,
   DATUM[WGS_1984,
   SPHEROID[WGS_1984,6378137.0,298.257223563]],
   PRIMEM[Greenwich,0.0],
   UNIT[Degree,0.0174532925199433]]
OBJECTID_1: Integer (9.0)
TIP: Integer (4.0)
Shape_Leng: Real (19.11)

2. A layer which displays if I set the Extent parameter in the MAP file 
to the values returned by ogrinfo:


[adri...@server data]$ ogrinfo coverage.TAB -so -al
Had to open data source read-only.
INFO: Open of `coverage.TAB'
 using driver `MapInfo File' successful.

Layer name: coverage
Geometry: Unknown (any)
Feature Count: 1
*Extent: (550.002594, 4830850.004496) - (707800.001127, 5318099.996174)*
Layer SRS WKT:
PROJCS[unnamed,
   GEOGCS[unnamed,
   DATUM[WGS_1984,
   SPHEROID[WGS 84,6378137,298.257223563],
   TOWGS84[0,0,0,-0,-0,-0,0]],
   PRIMEM[Greenwich,0],
   UNIT[degree,0.0174532925199433]],
   PROJECTION[Transverse_Mercator],
   PARAMETER[latitude_of_origin,0],
   PARAMETER[central_meridian,27],
   PARAMETER[scale_factor,0.9996],
   PARAMETER[false_easting,50],
   PARAMETER[false_northing,0],
   UNIT[Meter,1.0]]
LEGEND: String (50.0)
THRESHOLD: Real (0.0)
COLOR: String (20.0)
Prediction_name: String (50.0)


I don't know how the second layer was generated (perhaps the values in 
extent are not longitude/latitude values), but I would like to display 
both layers in the same coordinate system.
If I consider the second set of values is longitude/latitude, they make 
no sense (unless the surface of Earth is the same as the surface of 
Jupiter!).


My question is: can mapserver do the translation of coordinates (by 
adding/substracting a fixed value), or do I need to do this with another 
system?
If the solution is external to mapserver, what's my next step (some 
manuals please!)?


I haven't worked with projections; could this be the cause?

Any help is appreciated, thanks!
Adrian

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


Re: [mapserver-users] Changing the EXTENT for a layer

2009-02-25 Thread Adrian Popa

Hello,

Thank you for your reply. I managed to find out the MapInfo layer is 
using WGS 84 / UTM zone 35N (like you predicted).
I will try to adjust my mapfile for these projections.  I guess I need 
to reproject *every* layer.


Thanks again for your help. I'll contant all to let you know how it 
worked out.


Cheers,
Adrian

Rahkonen Jukka wrote:

Hi,
 
Mapserver works without any knowledge about projection with one 
dataset if only the extents suit the data coordinates. That's the case 
with your ESRI layer. But you have two datasets which obviously are 
using different projections.  To show them together either (or both) 
of them needs to be reprojected.  And that is possible only if you 
know and tell Mapserver the projections for both datasets.
 
What needs to be done is
1) Set at the MAP level the projection that you want Mapserver to use 
for output as well as map extents using values and units of the output 
projection.

2) Set at the LAYER level the projections for both of the datasets.
 
To make is as simple as possible for the beginning I suggest to 
use projection epsg:4326 and a bit wider extents than you have now at 
MAP level.  Thats because those extents are already working for you, 
and ESRI dataset most propably is in WGS84 projection.  Thus you 
should use projection epsg:4326 also for your ESRI layer.
 
Then there will be just the Mapinfo layer left.  Defined by the the 
ogrinfo line PARAMETER[central_meridian,27] and coordinates it looks 
like it might be in UTM 35N projection (epsg:32635).  Have a try with 
that first.
 
-Jukka Rahkonen-
 

*L�hett�j�:* mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] *Puolesta *Adrian Popa

*L�hetetty:* 25. helmikuuta 2009 9:25
*Vastaanottaja:* mapserver-users@lists.osgeo.org
*Aihe:* [mapserver-users] Changing the EXTENT for a layer

Hello all!

I'm trying to display some layers (ESRI Shapefile and MapInfo) in
the same map. The ESRI shapefiles work just fine, and I've used
them for a long time. The new MapInfo layer however has very
different Extent values for its coordinates and does not overlap
with the original layers (they should overlap, because they cover
the same area).

Here is some output from ogrinfo:

1. A layer that displays ok and for which the coordinates are
longitude/latitude:

[adri...@server data]$ ogrinfo Limits.shp -so -al
Had to open data source read-only.
INFO: Open of `Limits.shp'
  using driver `ESRI Shapefile' successful.

Layer name: Limits
Geometry: Line String
Feature Count: 8718
*Extent: (20.261522, 43.618437) - (29.704897, 48.264780)*
Layer SRS WKT:
GEOGCS[GCS_WGS_1984,
DATUM[WGS_1984,
SPHEROID[WGS_1984,6378137.0,298.257223563]],
PRIMEM[Greenwich,0.0],
UNIT[Degree,0.0174532925199433]]
OBJECTID_1: Integer (9.0)
TIP: Integer (4.0)
Shape_Leng: Real (19.11)

2. A layer which displays if I set the Extent parameter in the MAP
file to the values returned by ogrinfo:

[adri...@server data]$ ogrinfo coverage.TAB -so -al
Had to open data source read-only.
INFO: Open of `coverage.TAB'
  using driver `MapInfo File' successful.

Layer name: coverage
Geometry: Unknown (any)
Feature Count: 1
*Extent: (550.002594, 4830850.004496) - (707800.001127,
5318099.996174)*
Layer SRS WKT:
PROJCS[unnamed,
GEOGCS[unnamed,
DATUM[WGS_1984,
SPHEROID[WGS 84,6378137,298.257223563],
TOWGS84[0,0,0,-0,-0,-0,0]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433]],
PROJECTION[Transverse_Mercator],
PARAMETER[latitude_of_origin,0],
PARAMETER[central_meridian,27],
PARAMETER[scale_factor,0.9996],
PARAMETER[false_easting,50],
PARAMETER[false_northing,0],
UNIT[Meter,1.0]]
LEGEND: String (50.0)
THRESHOLD: Real (0.0)
COLOR: String (20.0)
Prediction_name: String (50.0)


I don't know how the second layer was generated (perhaps the
values in extent are not longitude/latitude values), but I would
like to display both layers in the same coordinate system.
If I consider the second set of values is longitude/latitude, they
make no sense (unless the surface of Earth is the same as the
surface of Jupiter!).

My question is: can mapserver do the translation of coordinates
(by adding/substracting a fixed value), or do I need to do this
with another system?
If the solution is external to mapserver, what's my next step
(some manuals please!)?

I haven't worked with projections; could this be the cause?

Any help is appreciated, thanks!
Adrian



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http

Re: [mapserver-users] Changing the EXTENT for a layer

2009-02-25 Thread Adrian Popa

Yup, it worked like a charm!

Thank you for your help. One more question - how cpu intensive is 
reprojection using mapserver? I mean, if I have 300 users requesting the 
page, will I kill the CPU because it needs to reproject a layer, or are 
the calculations straight-forward and add little extra load on the server?
Can I reproject the layer offline and load it without projection in 
mapserver? If I can, which tool would I use (proj4?)?


Thanks again,
Adrian

Rahkonen Jukka wrote:

Hi,
 
Mapserver works without any knowledge about projection with one 
dataset if only the extents suit the data coordinates. That's the case 
with your ESRI layer. But you have two datasets which obviously are 
using different projections.  To show them together either (or both) 
of them needs to be reprojected.  And that is possible only if you 
know and tell Mapserver the projections for both datasets.
 
What needs to be done is
1) Set at the MAP level the projection that you want Mapserver to use 
for output as well as map extents using values and units of the output 
projection.

2) Set at the LAYER level the projections for both of the datasets.
 
To make is as simple as possible for the beginning I suggest to 
use projection epsg:4326 and a bit wider extents than you have now at 
MAP level.  Thats because those extents are already working for you, 
and ESRI dataset most propably is in WGS84 projection.  Thus you 
should use projection epsg:4326 also for your ESRI layer.
 
Then there will be just the Mapinfo layer left.  Defined by the the 
ogrinfo line PARAMETER[central_meridian,27] and coordinates it looks 
like it might be in UTM 35N projection (epsg:32635).  Have a try with 
that first.
 
-Jukka Rahkonen-
 

*L�hett�j�:* mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] *Puolesta *Adrian Popa

*L�hetetty:* 25. helmikuuta 2009 9:25
*Vastaanottaja:* mapserver-users@lists.osgeo.org
*Aihe:* [mapserver-users] Changing the EXTENT for a layer

Hello all!

I'm trying to display some layers (ESRI Shapefile and MapInfo) in
the same map. The ESRI shapefiles work just fine, and I've used
them for a long time. The new MapInfo layer however has very
different Extent values for its coordinates and does not overlap
with the original layers (they should overlap, because they cover
the same area).

Here is some output from ogrinfo:

1. A layer that displays ok and for which the coordinates are
longitude/latitude:

[adri...@server data]$ ogrinfo Limits.shp -so -al
Had to open data source read-only.
INFO: Open of `Limits.shp'
  using driver `ESRI Shapefile' successful.

Layer name: Limits
Geometry: Line String
Feature Count: 8718
*Extent: (20.261522, 43.618437) - (29.704897, 48.264780)*
Layer SRS WKT:
GEOGCS[GCS_WGS_1984,
DATUM[WGS_1984,
SPHEROID[WGS_1984,6378137.0,298.257223563]],
PRIMEM[Greenwich,0.0],
UNIT[Degree,0.0174532925199433]]
OBJECTID_1: Integer (9.0)
TIP: Integer (4.0)
Shape_Leng: Real (19.11)

2. A layer which displays if I set the Extent parameter in the MAP
file to the values returned by ogrinfo:

[adri...@server data]$ ogrinfo coverage.TAB -so -al
Had to open data source read-only.
INFO: Open of `coverage.TAB'
  using driver `MapInfo File' successful.

Layer name: coverage
Geometry: Unknown (any)
Feature Count: 1
*Extent: (550.002594, 4830850.004496) - (707800.001127,
5318099.996174)*
Layer SRS WKT:
PROJCS[unnamed,
GEOGCS[unnamed,
DATUM[WGS_1984,
SPHEROID[WGS 84,6378137,298.257223563],
TOWGS84[0,0,0,-0,-0,-0,0]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433]],
PROJECTION[Transverse_Mercator],
PARAMETER[latitude_of_origin,0],
PARAMETER[central_meridian,27],
PARAMETER[scale_factor,0.9996],
PARAMETER[false_easting,50],
PARAMETER[false_northing,0],
UNIT[Meter,1.0]]
LEGEND: String (50.0)
THRESHOLD: Real (0.0)
COLOR: String (20.0)
Prediction_name: String (50.0)


I don't know how the second layer was generated (perhaps the
values in extent are not longitude/latitude values), but I would
like to display both layers in the same coordinate system.
If I consider the second set of values is longitude/latitude, they
make no sense (unless the surface of Earth is the same as the
surface of Jupiter!).

My question is: can mapserver do the translation of coordinates
(by adding/substracting a fixed value), or do I need to do this
with another system?
If the solution is external to mapserver, what's my next step
(some manuals please!)?

I haven't worked with projections; could this be the cause?

Any help is appreciated, thanks

Re: [mapserver-users] Color palette for road-like layers

2009-01-06 Thread Adrian Popa

Yes Bob, I like the roads. :)
Can you show me how you are able to draw contours around your roads?

Thanks


Bob Basques wrote:

Adrian,

Would the lines used for this map work for you?

https://gis.ci.stpaul.mn.us/gis/gismo_public/html/

Looks like the original Mapfile link is broken though, I'll need to 
fix that in the morning.


bobb






--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core


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


Re: [mapserver-users] Color palette for road-like layers

2009-01-06 Thread Adrian Popa

Thank you all for your help,

I had the feeling this is how it's done, but I was hoping for a simpler 
approach.


Anyway, now I must only find some decent colors for my layers :)
Cheers,
Adrian

Paul Spencer wrote:

Adrian,

that is a fairly simple trick, you need to draw roads twice to do it.  
You can do that with two separate layers or two STYLE objects within a 
class depending on what effect you want to achieve.


In both cases, you just draw the road 2 pixels wider in your 'outline' 
color (called a casement).  For instance, assuming you are using two 
STYLE objects:


LAYER
  NAME Major Roads
  TYPE LINE
  DATA myroads
  CLASS
NAME Major Roads
STYLE #Casement style
SIZE 9
COLOR 192 192 192
SYMBOL circle
END
STYLE #Center style
SIZE 7
COLOR 255 255 255
SYMBOL circle
END
  END
END

You would use two separate layers to draw the casement and center 
style if you had several layers and/or classes of roads that you 
wanted to 'merge' the casements - in your google screenshoot, you 
should notice that the grey casement on Hollywood St merges with the 
casement on W 8th St and there is no grey line between the two center 
colors, this would be how to achieve a similar effect in MapServer.


Cheers

Paul

On 6-Jan-09, at 3:51 AM, Adrian Popa wrote:


Yes Bob, I like the roads. :)
Can you show me how you are able to draw contours around your roads?

Thanks


Bob Basques wrote:


Adrian,

Would the lines used for this map work for you?

https://gis.ci.stpaul.mn.us/gis/gismo_public/html/

Looks like the original Mapfile link is broken though, I'll need to 
fix that in the morning.


bobb






--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core

___
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://research.dmsolutions.ca/





--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core


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


Re: [mapserver-users] Adding symbols on top of polyline elements

2008-11-13 Thread Adrian Popa
I looked again over your example, and now I understand the difference 
from what I tried. Thanks!


thomas bonfort wrote:

you don't have to... you can use the multiple style blocks as I showed
in my last email
althoug you will have to play with offsets to avoid the symbols overlapping

thomas

On Thu, Nov 13, 2008 at 09:40, Adrian Popa [EMAIL PROTECTED] wrote:
  

Thanks for the reply Thomas,

I will try a workaround by creating a third symbol with both arrows on top
of it 

Thanks,

thomas bonfort wrote:

Hi,



Case 3: displaying both arrows on the same element:
  CLASS
NAME Right
EXPRESSION /^FO040314$/
STYLE
SYMBOL right
SIZE 24
COLOR 51 102 0
END
   END
   CLASS
NAME Left
EXPRESSION /^FO040314$/
STYLE
SYMBOL left
SIZE 24
COLOR 102 51 0
END
   END

How can I display both arrows on the same object (or do they display, but
they overlap completely?)


only ONE class is drawn for each feature, the first one in the rder of
the mapfile to meet the expression and scale tests. so your second
class is never rendered in this case.

CLASS
 NAME Rightand left
 EXPRESSION /^FO040314$/
 STYLE
 SYMBOL right
 SIZE 24
 COLOR 51 102 0
 END
 STYLE
 SYMBOL left
 SIZE 24
 COLOR 102 51 0
 END
END


cheers,
thomas



--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core





  



--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core


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


Re: [mapserver-users] Adding symbols on top of polyline elements

2008-11-12 Thread Adrian Popa

Hello everybody,

I managed to draw the arrows for the polyline layer, and they look ok, 
but (for a strange reason) I am required to draw these arrows both ways 
sometimes for the same element. I would like for the arrows to overlap, 
but instead only one of them is displayed. I attached 3 small pictures 
(sorry for the spam, but I hope it's not against the mailing list 
policy) with the displayed outcome in these three cases:


Case 1: displaying arrows with the 'right' symbol
CLASS
   NAME Right
   EXPRESSION /^FO040314$/
   STYLE
   SYMBOL right
   SIZE 24
   COLOR 51 102 0
   END
  END
  CLASS
   NAME Left
   EXPRESSION /SUPERCALIFRAGILISTICEXPIALIDOCIOUS/
   STYLE
   SYMBOL left
   SIZE 24
   COLOR 102 51 0
   END
  END

Case 2:
displaying arrows with the 'left' symbol
 CLASS
   NAME Right
   EXPRESSION /SUPERCALIFRAGILISTICEXPIALIDOCIOUS/
   STYLE
   SYMBOL right
   SIZE 24
   COLOR 51 102 0
   END
  END
  CLASS
   NAME Left
   EXPRESSION /^FO040314$/
   STYLE
   SYMBOL left
   SIZE 24
   COLOR 102 51 0
   END
  END

Case 3: displaying both arrows on the same element:
 CLASS
   NAME Right
   EXPRESSION /^FO040314$/
   STYLE
   SYMBOL right
   SIZE 24
   COLOR 51 102 0
   END
  END
  CLASS
   NAME Left
   EXPRESSION /^FO040314$/
   STYLE
   SYMBOL left
   SIZE 24
   COLOR 102 51 0
   END
  END

How can I display both arrows on the same object (or do they display, 
but they overlap completely?)


Thanks for your help,
Adrian


Adrian Popa wrote:
Can you please clarify to me what you mean by data that is oriented? 
When I built the road layer from GPS data, I added polylines starting 
from point A-...-B and recorded all the inflections in the road 
between A and B.

By ordered data you mean the direction in this case is A-B?
If I wanted to reverse the direction I'd have to write the data to the 
shapefile in the order B-A?


Thanks

thomas bonfort wrote:

it's the direction of the underlying geometry that's used.
so you either need
* data that's oriented, and a single boolean filed indicating if its
oneway or not,
* or an unoriented geometry, and a field indicating if the oneway
direction is reversed or not wrt the geometry (and two directional
symbols, one with  , the other with )

cheers,
thomas

On Mon, Nov 10, 2008 at 12:01, Adrian Popa [EMAIL PROTECTED] wrote:
  

Hello Thomas,

Thank you very much for your tip! It's great.
However, I have a question: How can I select the direction of the arrow? I
mean, between A and B I have a road segment:

AB

Right now, it renders as A--B, but I want it to render as
A-B.

My question is: how does mapserver select the order of A and B? If I
understand this, I can create another symbol and use it for the reverse
path.

Thanks,
Adrian

thomas bonfort wrote:

Hi,

for repeated arrow symbols, you can use a truetype (or image, or
vector) symbol, with a negative GAP:

SYMBOL
 NAME oneway
 TYPE TRUETYPE
 CHARACTER ''
 FONT arial
 GAP -20
END

and then in your layer:

STYLE
 SYMBOL oneway
 SIZE 8
 COLOR 0 0 0
END

cheers,
thomas

On Mon, Nov 10, 2008 at 10:51, Adrian Popa [EMAIL PROTECTED]
wrote:


Hello everybody,

I have a map that displays roads stored in a polyline format. I would like
to mark one-way streets with an arrow symbol drawn on top of the road
itself. The symbol can be as small as possible (for beginning I would like
to be able to superimpose it anywhere between the street ends, and later on
I will lock it to be next to one of the ends).

I can already select the one way streets based on the following template:

  CLASS

 Name OneWay

 EXPRESSION
/^FO040127$|^FO040132$|^FO040139$|^FO040120$|^FO040104$|^FO040131$|^FO040146$|^FO040129$/
 STYLE

COLOR 255 0 0

WIDTH 4

 END

 LABEL

 COLOR 0 0 255

 TYPE TRUETYPE

 FONT arial

 SIZE 8

 ANTIALIAS TRUE


 POSITION AUTO


 ANGLE AUTO
 PARTIALS TRUE


 MINDISTANCE 0


 BUFFER 0   END


 END

Can you show me an example of how to draw such a symbol on top of the layer?
Thank you

Adrian

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





--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core





  



--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core

  



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



--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de

Re: [mapserver-users] Adding symbols on top of polyline elements

2008-11-10 Thread Adrian Popa

Hello Thomas,

Thank you very much for your tip! It's great.
However, I have a question: How can I select the direction of the arrow? 
I mean, between A and B I have a road segment:


AB

Right now, it renders as A--B, but I want it to 
render as A-B.


My question is: how does mapserver select the order of A and B? If I 
understand this, I can create another symbol and use it for the reverse 
path.


Thanks,
Adrian

thomas bonfort wrote:

Hi,

for repeated arrow symbols, you can use a truetype (or image, or
vector) symbol, with a negative GAP:

SYMBOL
 NAME oneway
 TYPE TRUETYPE
 CHARACTER ''
 FONT arial
 GAP -20
END

and then in your layer:

STYLE
 SYMBOL oneway
 SIZE 8
 COLOR 0 0 0
END

cheers,
thomas

On Mon, Nov 10, 2008 at 10:51, Adrian Popa [EMAIL PROTECTED] wrote:
  

Hello everybody,

I have a map that displays roads stored in a polyline format. I would like
to mark one-way streets with an arrow symbol drawn on top of the road
itself. The symbol can be as small as possible (for beginning I would like
to be able to superimpose it anywhere between the street ends, and later on
I will lock it to be next to one of the ends).

I can already select the one way streets based on the following template:

  CLASS

 Name OneWay

 EXPRESSION
/^FO040127$|^FO040132$|^FO040139$|^FO040120$|^FO040104$|^FO040131$|^FO040146$|^FO040129$/
 STYLE

COLOR 255 0 0

WIDTH 4

 END

 LABEL

 COLOR 0 0 255

 TYPE TRUETYPE

 FONT arial

 SIZE 8

 ANTIALIAS TRUE


 POSITION AUTO


 ANGLE AUTO
 PARTIALS TRUE


 MINDISTANCE 0


 BUFFER 0   END


 END

Can you show me an example of how to draw such a symbol on top of the layer?
Thank you

Adrian

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




  



--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core


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


Re: [mapserver-users] Adding symbols on top of polyline elements

2008-11-10 Thread Adrian Popa
Can you please clarify to me what you mean by data that is oriented? 
When I built the road layer from GPS data, I added polylines starting 
from point A-...-B and recorded all the inflections in the road 
between A and B.

By ordered data you mean the direction in this case is A-B?
If I wanted to reverse the direction I'd have to write the data to the 
shapefile in the order B-A?


Thanks

thomas bonfort wrote:

it's the direction of the underlying geometry that's used.
so you either need
* data that's oriented, and a single boolean filed indicating if its
oneway or not,
* or an unoriented geometry, and a field indicating if the oneway
direction is reversed or not wrt the geometry (and two directional
symbols, one with  , the other with )

cheers,
thomas

On Mon, Nov 10, 2008 at 12:01, Adrian Popa [EMAIL PROTECTED] wrote:
  

Hello Thomas,

Thank you very much for your tip! It's great.
However, I have a question: How can I select the direction of the arrow? I
mean, between A and B I have a road segment:

AB

Right now, it renders as A--B, but I want it to render as
A-B.

My question is: how does mapserver select the order of A and B? If I
understand this, I can create another symbol and use it for the reverse
path.

Thanks,
Adrian

thomas bonfort wrote:

Hi,

for repeated arrow symbols, you can use a truetype (or image, or
vector) symbol, with a negative GAP:

SYMBOL
 NAME oneway
 TYPE TRUETYPE
 CHARACTER ''
 FONT arial
 GAP -20
END

and then in your layer:

STYLE
 SYMBOL oneway
 SIZE 8
 COLOR 0 0 0
END

cheers,
thomas

On Mon, Nov 10, 2008 at 10:51, Adrian Popa [EMAIL PROTECTED]
wrote:


Hello everybody,

I have a map that displays roads stored in a polyline format. I would like
to mark one-way streets with an arrow symbol drawn on top of the road
itself. The symbol can be as small as possible (for beginning I would like
to be able to superimpose it anywhere between the street ends, and later on
I will lock it to be next to one of the ends).

I can already select the one way streets based on the following template:

  CLASS

 Name OneWay

 EXPRESSION
/^FO040127$|^FO040132$|^FO040139$|^FO040120$|^FO040104$|^FO040131$|^FO040146$|^FO040129$/
 STYLE

COLOR 255 0 0

WIDTH 4

 END

 LABEL

 COLOR 0 0 255

 TYPE TRUETYPE

 FONT arial

 SIZE 8

 ANTIALIAS TRUE


 POSITION AUTO


 ANGLE AUTO
 PARTIALS TRUE


 MINDISTANCE 0


 BUFFER 0   END


 END

Can you show me an example of how to draw such a symbol on top of the layer?
Thank you

Adrian

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





--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core





  



--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core


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


[mapserver-users] Display road layer realistically

2008-10-06 Thread Adrian Popa

Hello everybody,

I have to draw a fiber-optic layer that can be interpreted like a road 
layer (polyline data type). I've drawn it in simple ways (colored 
lines), but now it must look more professional... I would like some tips 
on how to draw this/color schemes to make it look better.


LAYER  
   NAME fibraProblems 
   TYPE LINE  
   STATUS off 
   DATA fibra 
   CLASSITEM nume   
   LABELITEM nume   
   CLASS  
  Name Selected 
  EXPRESSION /selected/
  STYLE   
 COLOR 255 0 0
 WIDTH 4  
  END 
  LABEL   
   COLOR 0 0 255  
   TYPE TRUETYPE  
   FONT arial 
   SIZE 8 
   ANTIALIAS TRUE 
   POSITION AUTO  
   PARTIALS TRUE  
   MINDISTANCE 0  
   BUFFER 0   
   #   PRIORITY 5 
  END 
  END 
END




Also, on some parts of the fiber, there are multiple fibers going the 
same way... I would like to represent them like in this subway map: 
http://www.frenchculture.com/images/metro_map.gif, meaning adjacent 
fibers should apear next to each-other. Any idea if this can be done 
with mapserver?


Thank you,
Adrian


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


[mapserver-users] Displaying layers based on zoom level

2008-06-06 Thread Adrian Popa

Hello everybody,

I'm new to this mailing list, so forgive me if this question has been 
asked before (I haven't been able to search the archives).


My question is this:
I have a map with several layers (including cities, roads, villages) and 
I would like to automatically turn some layers on when the user has 
zoomed in enough. I know I have read somewhere that you can set a 
property to the layer to tell it when it should be turned automatically 
on, but I can't find the property name or an example to get me going.


So please, point me in the right direction.

Thank you!

PS. I'm using mapserver 4.1 (and msMap as a frontend).

--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core


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


Re: [mapserver-users] Displaying layers based on zoom level

2008-06-06 Thread Adrian Popa
Thank you very much for your help. I made the changes (tweaked the 
values for MAXSCALE) and I'm happy with the results :)


Cheers!

David Martinez Morata wrote:

Hi!
The functions in LAYER object are
MAXSCALE 'Value of Scale'
MINSCALE 'Value of minimun Scale'
Consult this http://mapserver.gis.umn.edu/docs/reference/mapfile/layer
And at the end of the page you find some considerations for MINSCALE 
AND MAXSCALE interpretation in MapServer



2008/6/6 Adrian Popa [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]:


Hello everybody,

I'm new to this mailing list, so forgive me if this question has
been asked before (I haven't been able to search the archives).

My question is this:
I have a map with several layers (including cities, roads,
villages) and I would like to automatically turn some layers on
when the user has zoomed in enough. I know I have read somewhere
that you can set a property to the layer to tell it when it should
be turned automatically on, but I can't find the property name or
an example to get me going.

So please, point me in the right direction.

Thank you!

PS. I'm using mapserver 4.1 (and msMap as a frontend).

-- 
Adrian Popa


Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core


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





--
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core


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