[mapserver-users] Re: How to set Labels dynamically

2009-12-04 Thread Ludwig Kniprath

Hi Helen,
this sample-script should work:
---schnipp--
?php
//1. Map-Object and Image
$blank_map_object = ms_newMapObj('your path to the sample mapfile below');
$blank_map_object-preparequery();
$blank_map_image = $blank_map_object-prepareImage();
//2. LAYER
$draw_layer = ms_newLayerObj($blank_map_object);
$draw_layer-set('type', MS_LAYER_POINT);
$draw_layer-set('status', MS_ON);
//3. CLASS, STYLE and LABEL
$new_class = ms_newClassObj($draw_layer);
$new_style = ms_newStyleObj($new_class);
$label_obj = $new_class-label;
$label_obj-set('size', 25);
$label_obj-set('type', MS_TRUETYPE);
//Path to arial.ttf must be defined in test_fontset.txt
$label_obj-set('font', 'arial');
$label_obj-set('angle', 30);
//0x007E is the ~ sign
$label_obj-set('wrap', 0x007E);
$label_obj-color-setRGB(0,255,0);
$label_obj-backgroundcolor-setRGB(0,0,255);
$label_obj-backgroundshadowcolor-setRGB(200,200,200);
$label_obj-set('backgroundshadowsizex', 15);
$label_obj-set('backgroundshadowsizey', 15);
//...and so on
//4. Shape with label
$draw_shape = ms_shapeObjFromWkt('POINT(2502500 5602500)');
$draw_shape-set('text', ' ~ Hello World!~ Mapserver is cool... ~');
$draw_layer-addFeature($draw_shape);
$draw_layer-draw($blank_map_image);
//5. Shape to Image
$blank_map_object-drawLabelCache($blank_map_image);
$blank_map_object-labelcache-free();
//6. ready
$image_url=$blank_map_image-saveWebImage();
echo img src='$image_url'/;
?
---schnapp--

With mini-mapfile:
---schnipp--
MAP
   name test
   fontset your path to the fontset
   units meters
   extent 250 560 2505000 5605000
   size 800 600
   imagecolor 255 255 255
   WEB
   imagepath your path to tmp-directory
   imageurl your url to tmp-directory
   END
END
---schnapp--

Regards
Ludwig


Helen Eskina schrieb:

Hi,

My $daLayer is defined dynamically. How should I define Label-Section in
this case?
$daLayer-set(type, MS_LAYER_POINT);
$daLayer-set(status, MS_ON);
 $class = ms_newClassObj($daLayer);
 $style = ms_newStyleObj($class);
 $style-color-setRGB(255,0,0);
 $style-set(symbolname, circle);
 $style-set(size, 10);

Thank you,
Helen
-Original Message-
From: Ludwig Kniprath [mailto:lud...@kni-online.de]
Sent: Thursday, December 03, 2009 4:57 PM
To: Helen Eskina; mapserver-users@lists.osgeo.org
Subject: Re: How to set Labels dynamically

Oops, you're right, drawLabelCache is a method of the map-object, but
all the same it works for me!
Perhaps a missing LABEL-Section in the mapfile-definition of your
$daLayer?
Regards
Ludwig

Helen Eskina schrieb:
  

Hi Ludwig,

Layer object doesn't have DrawLabelCache method. I've tried this line


and
  

got an error. I'm using Mapserver installed with fgs 5.4.2.

I've tried
 $map- drawLabelCache($image);
But it doesn't make any difference.

Helen
-Original Message-
From: Ludwig Kniprath [mailto:lud...@kni-online.de]
Sent: Thursday, December 03, 2009 12:13 PM
To: mapserver-users@lists.osgeo.org
Cc: hesk...@ubitech.com
Subject: RE: How to set Labels dynamically

Hi,
I think there's only one line missing after $daLayer-draw($image):

$daLayer-drawLabelCache($image);

Regards
Ludwig




Message: 6
Date: Thu, 3 Dec 2009 11:13:10 -0500
From: Helen Eskina hesk...@ubitech.com
Subject: [mapserver-users] How to set Labels dynamically?
To: mapserver-users@lists.osgeo.org
Message-ID: 5cde4e2f906f4ce9b22afedb42cd0...@skysource
Content-Type: text/plain; charset=windows-1252

Hello,



I couldn't find documentation how to set the text labels dynamically

  

using



MapScript.

My application should show points with labels on the map. Points and

  

labels



are obtained dynamically from the database or some text file.

I add the points to the layer and draw layer as following:



$my_point = ms_newpointObj();



$my_point-setXY(-75.895, 45.9227);

$my_point-project($projInObj,$projOutObj);



$line = ms_newLineObj();

$line-add($my_point);

$shape = ms_newShapeObj(MS_SHAPE_POINT);

$shape-add($line);

$shape-set(text, 'new point');

$daLayer-addFeature($shape);



$image=$map-draw();

$daLayer-draw($image);

$image_url=$image-saveWebImage();



Points are displayed on the map, but no text. What am I doing wrong?



I will appreciate any help,

Helen

  


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


[mapserver-users] Anyone know how to set up Mapserver under IIS 7 x64?

2009-12-04 Thread Daniel Walton
I had Mapserver running well under IIS 7 x86 + PHP, but we now have a 64-bit
requirement, and I am having trouble getting Mapserver to work. I tried
32-bit IIS emulation to no avail. I was wondering if anyone out there has
accomplished this in 64 bit Windows, and if so, how?

Thanks guys,
Dan Walton


 Dan Walton
GIS Fire Tools http://gisfiretools.com
(612) 232-6784 callto:+16122326784
dgwal...@gmail.com
[image: Linkedin] http://www.linkedin.com/in/danielwalton2010 [image:
Twitter] http://twitter.com/danwallie
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Anyone know how to set up Mapserver under IIS 7 x64?

2009-12-04 Thread Tamas Szekeres
Daniel,

The x64 binaries at http://vbkto.dyndns.org/sdk/ would be near to this
requirement, if we'd compile mapserver with php support.
This would require at first to compile the php lib for x64 on Windows.
Then you might try to use the x64 SDK package and edit the Makefile and
recompile mapserver accordingly.

Best regards,

Tamas



2009/12/4 Daniel Walton dgwal...@gmail.com

 I had Mapserver running well under IIS 7 x86 + PHP, but we now have a
 64-bit requirement, and I am having trouble getting Mapserver to work. I
 tried 32-bit IIS emulation to no avail. I was wondering if anyone out there
 has accomplished this in 64 bit Windows, and if so, how?

 Thanks guys,
 Dan Walton


  Dan Walton
 GIS Fire Tools http://gisfiretools.com
 (612) 232-6784 callto:+16122326784
 dgwal...@gmail.com
 [image: Linkedin] http://www.linkedin.com/in/danielwalton2010 [image:
 Twitter] http://twitter.com/danwallie

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


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


[mapserver-users] How to avoid warning messages for WFS and optional metadata

2009-12-04 Thread Armin Burger

Hi all

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


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

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


Thanks for any hints

Armin

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


[mapserver-users] html and ajax query

2009-12-04 Thread Jay Kapalczynski
I am trying to get the user to choose from 2 comboboxes...cant seem to get this 
to work...maybe someone out there can see something I am doin wrong?
I think this how it works?  Using the code below
The user selects two values in combo boxes (PriceFactor and PriceArea)
Click the button to call function ReturnQueryResults
The Array is built from the values of the two dropdown boxes (id = 
PriceFactor and id = PriceArea) using their ID values
The javascript call is made that calls Ajax page which sends the php page the 
array of values.  I then have to parse the ID (the array) with Get in the php 
page, formatting the output, which is then shown on the target specified in the 
Ajax page.
The results go back to the back to the ajax page

I don't have a great understanding of this...trying with a couple dropdowns to 
start.

Any help would be greatly appreciated...I think I am pretty close but can use 
another set of eyes...

THanks


HTML PAGE:

pbPlease Choose Price Factor:/bbr
select name=PriceFactor id=PriceFactor
  option value=/option
  option 
value=greaterthanGreater Than/option
  option value=lessthanLess 
Than/option
  option 
value=betweenBetween/option
  option value=equaltoEqual 
To/option
  option 
value=greaterthanequaltoGreater Than Equal To/option
  option 
value=lessthanequaltoLess Than Equal To/option
/select
pbPlease Choose Area:/bbr
select name=PriceArea id=PriceArea
  option value=/option
  option value=100100/option
  option value=500500/option
  option value=700700/option
/select

input type=button value=Send to Ajax and Tab 
onClick=ReturnQueryResults();
br
br


script type=text/javascript

function ReturnQueryResults() {
var url =  PropertyQuery3?;
var input_values_to_append = 
new Array('PriceFactor','PriceArea');
for(var i = 0; i  
input_values_to_append.length; i++) {
url += 
''+input_values_to_append[i].name+'='+input_values_to_append[i].value;

}

javascript:getResulthype('url')
}

/script


AJAX Page:

function getResulthype(url){

var _target = 'content_details_form';

if (id.length == 0) {
document.getElementById(_target).innerHTML=bNo Information 
Available/b;
return;
}
xmlHttp = GetAJAXObject();
if (xmlHttp==null) {
alert (Unable to process your request, your browser does not support 
AJAX!);
return;
}

var url = http://127.0.0.1:80/webapp/php/+url+;;

xmlHttp.onreadystatechange = showResult;
xmlHttp.open(GET,url,true);
xmlHttp.send(null);
}


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


[mapserver-users] Layer based on a view renders faster than if based on a table

2009-12-04 Thread Steve . Toutant
Hi,
I have a layer that renders faster when DATA is defined on a view than on 
a table with a clustered index.

Here is the layer definition
  CONNECTIONTYPE postgis
  CONNECTION host= dbname=xx user=xx password=xx port=5432
  DATA geom900913 FROM prevalence using unique id using srid=900913
  PROCESSING CLOSE_CONNECTION=DEFER
  PROJECTION
init=epsg:900913
  END

My MAP projection is also 900913

If prevalence is a
Postgis View: 0.469s (2.6 seconds in OpenLayers)
Postgis table: 0.781s (3.6 seconds in OpenLayers)
Postgis table+index+cluster: 0.782s ( 3.4 seconds  in OpenLayers)

I thought that a layer definition based on a table would be much faster 
than on a view.
What should be the expected behavior please?

Please tell me is this should be asked to postgis forum.

thanks
Steve


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


Re: [mapserver-users] Layer based on a view renders faster than if based on a table

2009-12-04 Thread Daniel Morissette

steve.tout...@inspq.qc.ca wrote:


I thought that a layer definition based on a table would be much faster 
than on a view.

What should be the expected behavior please?

Please tell me is this should be asked to postgis forum.



I'd suggest you capture the exact SQL query that is run in each case 
(using DEBUG/MS_ERRORFILE) and check that the difference in time indeed 
comes form the PostGIS queries.


If that's the case then you could submit a question to the postgis list 
based on that, taking MapServer out of the equation.


If on the other hand the queries take about the same time and the time 
difference is in MapServer's code (which I doubt) then we'd need more 
details (ideally a testcase) to be able to reproduce and troubleshoot 
the issue.


Daniel
--
Daniel Morissette
http://www.mapgears.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Fw: DECEMBER 5th!! RED BALLOON SEARCH starts Tomorrow! Help Conservation group win $40, 000 for scholarship Program!

2009-12-04 Thread Jennifer Shanks




- Forwarded Message 
From: Lisa Pierce l.pie...@verizon.net
To: sc...@listserv.uri.edu
Sent: Fri, December 4, 2009 5:49:38 PM
Subject: DECEMBER 5th!!  RED BALLOON SEARCH starts Tomorrow! Help Conservation 
group win $40,000 for scholarship Program!

Please send on this note to your network to extend the SCGIS family and
increase our chances of winning! 

RED BALLOON SEARCH Tomorrow! Help Conservation group win $40,000 for
scholarship Program! 
Importance: High

http://www.edc.uri.edu/scgis/

SCGIS Takes On The DARPA Challenge:

Help the Society for Conservation GIS win $40,000 for our international
scholarship program and improve our SCGIS networking efforts!
www.scgis.org

The Challenge: Help the SCGIS Team locate 10 RED Weather Balloons THIS
Saturday Dec 05, 2009. This is a one day event and all we need are your
eyes...We do NOT need individuals to drive all over the countryside, we need
increased numbers of observers. If you forward this email to ALL individuals
on your contact list we have a greater chance of winning. The only way we
can possible win this challenge is to have thousands of eyes looking for
these red weather balloons located throughout the United States. You do NOT
have to be a geocacher or own a GPS to participate, we just need you to
keep an eye out for the balloons. This money will be used to help
conservationists world-wide to gain the skills they need to conserve the
environment, indigenous tribes, and local communities.

Why SCGIS: Because the Society of Conservation GIS is comprised of the
world's smartest mapping geeks, nerds, wonks, and pros, if we can't come up
with 10 geographic locations for bright red balloons, who can? Oh yeah, if
we are the first to log the 10 balloon sites, the SCGIS will win a prize of
$40,000 which will be used to support the SCGIS International Scholarship
Fund. Our participation in this event is strictly for fund-raising purposes,
and having some fun as well.

Why is DARPA Doing This?: They want to find out how society can mobilize
itself using the Internet and social networking tools. We have the answer --
pull together a great group like SCGIS and their friends and put them to the
task.

Rules/information for the Challenge:
. Balloons will go up at 10:00am (ET) (7:00am PT) and be taken down at 4:00
pm local time on Saturday 05 Dec - yes this means they will be visible for 6
hrs on the east coast and 9 hrs on the west coast.
. All balloon locations will be visible from a roadway and all areas will be
accessible to the public by pedestrian access. Officials will be stationed
with the balloons and participants should ask officials for the balloon
number and to verify that it is a DARPA Challenge balloon.
. Balloons will be visible on 05 Dec ONLY, but we have until noon on 14 Dec
to collect the information from our participants.
. Federal government employees can not submit locations to DARPA but they
can partiticpate in the search for balloons. SCGIS will submit locations for
everyone. 
. The balloons coordinates should be collected in degree-minute-second
(DDD-MM-SS) format (latitude/longitude, do not use negative values for
longitude). IF you do not have a GPS unit, we have staff available to
convert available information (street intersections,...nearby lakes) for
you..gather as much information as possible, and be as detailed as possible.
See the instructions below for submitting your observation


What You Need to Do: Take a walk, go for a jog, hop on your bike, or fire up
that hybrid and go for a Saturday drive. If you see a big red balloon that
looks like this, take a photo, get an address, and if you are
geospatially-enabled, compute a lat-long value that is within 1 mile of
where the balloon is. If you have no idea how to determine the latitude and
longitude, not prob, just us get an address. There will be a credentialed
DARPA staffer at the site so if you are not sure you found a DARPA balloon,
just ask. DARPA balloons are also numbered (1-10) and be sure to record this
as well. More photos of DARPA balloons can be seen here.  

Spread the Word: Tell your friends, family, colleagues, and neighbors to be
on the lookout for a red DARPA balloon. And tell them you are doing it for
SCGIS and their scholarship fund. If they find one, let us know. Here is a
sample announcement for your friends, colleagues and family. 

Reporting Your Observation: We need the following information from you:

Participant's Info:
Participant's Name:
Telephone Number:
Email Address:
Participant's State:
Participant's County:
Participant's Town/City:

KEY Info: 
Balloon Number (Balloon number will be clearly visible and is available from
the DARPA staff at the balloon site):
Street Intersection and City of sighting.
Lat/Long of the Balloon (If feasible but not necessary) How the coordinate
was derived.
A photo (if possible)
Brief (few sentences) of the setting of the balloon (any details are
valuable) Brief summary of who they heard about this contest from