[mapserver-users] choosing region of interest using "referencemap"

2010-03-26 Thread ahmet temiz
hello

I was wondering how I could choose region of interest using "referencemap" ?

Could you give me a hint ?

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


RE: [mapserver-users] Mapserver Templates

2010-03-26 Thread Lime, Steve D (DNR)
Hi Andrew: Cleaning out my email and I noticed this message received no love. 
It's probably because it's a bit vague. Depends what you mean by template. 
There aren't interface templates in the ArcGIS Server sense, primarily because 
MapServer doesn't cover the client-side of things. You'd need to look to the 
variety of client-side environments capable of using MapServer services (e.g. 
OpenLayers, GeoMoose, GeoExt, MapFish, pmapper, etc...) Layer templates for 
setting up OGC services can be found in the various how-to documents. MapServer 
supports templating for presentation of query results but I get the feeling 
that's not what you're after...

Steve

From: mapserver-users-boun...@lists.osgeo.org 
[mapserver-users-boun...@lists.osgeo.org] On Behalf Of Andrew Lewin 
[ale...@spatialconserve.com]
Sent: Thursday, March 18, 2010 8:57 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Mapserver Templates

Hi All,

Are there any templates available for MapServer?

Thanks,

Andrew

Andrew Lewin, M.Sc., Adv. Dipl. GIS
President
Spatial-Conserve Inc.
www.spatialconserve.com
Email: ale...@spatialconserve.com
Tel: (905) 639-4646
Mobile: (905) 630-8441
Skype: andrew.lewin99




___
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] Extreme data-driven Symbology with CGI mapserver

2010-03-26 Thread Lime, Steve D (DNR)
Hi Brent: Producing legends with bound styling is indeed problematic. MapServer 
has no way to know how many variations are possible and it doesn't cache those 
encountered in a map draw. Binding a class name might help but the binding is 
at the feature level and a class name would generally apply to a group of 
features. Still, it might provide a useful key for a hash of styles that could 
be rendered as a legend.

Might be more interesting to be able to configure a file or URL-based SLD 
reference for a layer from within the mapfile. For example:

LAYER
  NAME 'extreme-symbology'
  DATA ...
  CONNECTION ...
  SLD 'some flle' or 'some url'
  ...
END

Then you'd have some other sort of production process, either scheduled or live 
to build the SLD from your database. Just a thought.

Yet another idea would be to take advantage of includes. We might consider 
allowing a URL-based include to get a snippet of mapfile content. Producing 
that text (e.g. all the classes, and styles) wouldn't require mapscript at all. 

An option that would work now would be to produce the include file through a 
scheduled process. Just write a small script to write that piece of a mapfile 
and schedule it to run at some interval. Nice and simple and no MapScript.

Steve

From: mapserver-users-boun...@lists.osgeo.org 
[mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser 
[bfra...@geoanalytic.com]
Sent: Thursday, March 25, 2010 1:14 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Extreme data-driven Symbology with CGI mapserver

All,

   I'm looking for advice (or at least a reality check).

The short story:

Can CGI mapserver generate a legend "on the fly" for a varying number of classes
(class names from a database)?


The Long story:
---
  I'm storing feature geometry in a database and I'd like to store symbology
too.  In theory, this would allow a users/admins to add layers and classes in an
adhoc manner, and I'd like mapserver (in std CGI mode, I'd like to avoid
MapScript if possible) to automatically render the features AND produce a
meaningful standard graphic legend.

   So my database tables would look like:

Tables for storing things:
--
Geom Table (lots of rows, one per feature):
 pkGeomIDThe primary key
 WKT The WKT/WKB geometry of a feature
 fkClassID   Foreign key to Class table

Class Table (a few rows, for unique symbology):
 pkClassid
 ClassName   A nice name to put in the legend
 fkLayerID   Foreign key to Layer table
 Color   The color of the line (eg "255 0 0")

Layer Table (only a couple of rows, just for organizing the classes):
 pkLayerID
 LayerName   A nice name to put in the legend


And a view, joining the above tables,
so Mapserver can render the features:
--
Render View:
 pkGeomID  WKT   LayerName  ClassName   Color

While this will likely work for rendering the features, I'm doubtful that
mapserver will be able to keep track of the class names for a legend.  While I
can set the color from a database attribute:

CLASS
   NAME 'SetByCGI?'
   STYLE
 COLOR [Color]
   END  # Style
END # Class

it is not possible to set the CLASS NAME that way.  It is possible (I think) to
set it with a CGI variable (something like
&map.layer[0].Class[0]=NAME+"Trails") but that would not allow for the
dynamic number of classes.  Or would it?  If I put 10 class defs in my map file,
then pass as many names as needed (up to 10) in the URL perhaps I could get a
meaningful legend.

Or maybe WFS is the answer... Or I'll likely need to switch to MapScript.  If
there's any interest in doing this via CGI, perhaps we could collaborate on an
enhancement.

Thanks!
Brent Fraser

___
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] Extreme data-driven Symbology with CGI mapserver

2010-03-26 Thread Brent Fraser

Steve,

  Many thanks for the thoughtful reply.  I haven't looked at Mapserver's 
rendering logic yet, but as the CLASS NAME binding would only be relevant for 
MODE=LEGEND, perhaps there could be a separate bit of code developed for 
generating a data-driven legend.


  The use of the INCLUDE in the map file would be somewhat difficult.  In my 
case the CLASS list varies per logged-in user so the file management might get 
convoluted.


  I love the URL-based SLD idea (can I have it tomorrow?). I'll have to read 
the doc on SLDs.


  Maybe it's because I've been working on GeoMoose's feature digitizing and 
reading OpenLayers posts about creating features via WFS, but I see a time when 
Mapserver's LAYER/CLASSS structure needs to be able to be generated from the data.


Thanks again!
Brent Fraser

Lime, Steve D (DNR) wrote:

Hi Brent: Producing legends with bound styling is indeed problematic. MapServer 
has no way to know how many variations are possible and it doesn't cache those 
encountered in a map draw. Binding a class name might help but the binding is 
at the feature level and a class name would generally apply to a group of 
features. Still, it might provide a useful key for a hash of styles that could 
be rendered as a legend.

Might be more interesting to be able to configure a file or URL-based SLD 
reference for a layer from within the mapfile. For example:

LAYER
  NAME 'extreme-symbology'
  DATA ...
  CONNECTION ...
  SLD 'some flle' or 'some url'
  ...
END

Then you'd have some other sort of production process, either scheduled or live 
to build the SLD from your database. Just a thought.

Yet another idea would be to take advantage of includes. We might consider allowing a URL-based include to get a snippet of mapfile content. Producing that text (e.g. all the classes, and styles) wouldn't require mapscript at all. 


An option that would work now would be to produce the include file through a 
scheduled process. Just write a small script to write that piece of a mapfile 
and schedule it to run at some interval. Nice and simple and no MapScript.

Steve

From: mapserver-users-boun...@lists.osgeo.org 
[mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser 
[bfra...@geoanalytic.com]
Sent: Thursday, March 25, 2010 1:14 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Extreme data-driven Symbology with CGI mapserver

All,

   I'm looking for advice (or at least a reality check).

The short story:

Can CGI mapserver generate a legend "on the fly" for a varying number of classes
(class names from a database)?


The Long story:
---
  I'm storing feature geometry in a database and I'd like to store symbology
too.  In theory, this would allow a users/admins to add layers and classes in an
adhoc manner, and I'd like mapserver (in std CGI mode, I'd like to avoid
MapScript if possible) to automatically render the features AND produce a
meaningful standard graphic legend.

   So my database tables would look like:

Tables for storing things:
--
Geom Table (lots of rows, one per feature):
 pkGeomIDThe primary key
 WKT The WKT/WKB geometry of a feature
 fkClassID   Foreign key to Class table

Class Table (a few rows, for unique symbology):
 pkClassid
 ClassName   A nice name to put in the legend
 fkLayerID   Foreign key to Layer table
 Color   The color of the line (eg "255 0 0")

Layer Table (only a couple of rows, just for organizing the classes):
 pkLayerID
 LayerName   A nice name to put in the legend


And a view, joining the above tables,
so Mapserver can render the features:
--
Render View:
 pkGeomID  WKT   LayerName  ClassName   Color

While this will likely work for rendering the features, I'm doubtful that
mapserver will be able to keep track of the class names for a legend.  While I
can set the color from a database attribute:

CLASS
   NAME 'SetByCGI?'
   STYLE
 COLOR [Color]
   END  # Style
END # Class

it is not possible to set the CLASS NAME that way.  It is possible (I think) to
set it with a CGI variable (something like
&map.layer[0].Class[0]=NAME+"Trails") but that would not allow for the
dynamic number of classes.  Or would it?  If I put 10 class defs in my map file,
then pass as many names as needed (up to 10) in the URL perhaps I could get a
meaningful legend.

Or maybe WFS is the answer... Or I'll likely need to switch to MapScript.  If
there's any interest in doing this via CGI, perhaps we could collaborate on an
enhancement.

Thanks!
Brent Fraser

___
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://

Re: [mapserver-users] Status of ticket 2181 (Fix handling of NODATA values (for DTED files))

2010-03-26 Thread Jason Beverage
Sweet, thanks Frank!

Jason

On Thu, Mar 25, 2010 at 3:37 PM, Frank Warmerdam  wrote:
> Jason Beverage wrote:
>>
>> Hi all,
>>
>> I was wondering what the status was of ticket 2181
>> (http://trac.osgeo.org/mapserver/ticket/2181), specifically the patch
>> that is supposed to fix the handling of NODATA values when using
>> average or bilinear resampling.  I'm using the mapserver 5.6.1 and am
>> running into that resampling issue.  Is this something that is planned
>> to be merged at some point?
>
> Jason,
>
> I have some funded time to work on MapServer raster bugs. I'll try and
> take a crack at it in the next day or so.
>
> Best regards,
> --
> ---+--
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmer...@pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] php mapscript

2010-03-26 Thread Worth Lutz
This problem is due to the new single pass query in 5.6.

 

I have marked your code with what I am using.

 

Try these mods marked with "*":

 

 

@$datQuery = $query_layer->queryByRect($qRect);

 

 //number of objects

 $resnum = $query_layer->getNumResults();  echo "number of objects:
".$resnum."";

 

 //if query success

if ($datQuery == MS_SUCCESS) {

//  $query_layer->open();  // getShape($result->tileindex,$result->shapeindex);

  // resultsGetShape is now the way to get the shape object
***

  // note: change of order in arguments


  $shpobj = $query_layer->resultsGetShape($result->shapeindex,
$result->tileindex);

 

 

  //read attribute

  $attr = $shpobj->values;

 

  //write headline

  echo '';

  foreach($attr as $name=>$wert) {

   echo ''.$name.'';

  }

  echo '';

 

  //write datasets

  for ($j=0; $j<$query_layer->getNumResults(); $j++) {

   $result = $query_layer->getResult($j);

 

 

   //$shpobj =
$query_layer->getShape($result->tileindex,$result->shapeindex);

   // see note above
**

   $shpobj = $query_layer->resultsGetShape($result->shapeindex,
$result->tileindex);

 

 

   $ri = $result->tileindex;

   $si = $result->shapeindex;

   $attr = $shpobj->values;

   echo '';

   foreach($attr as $name=>$wert) {

echo ''.$wert.'';

   }

   echo '';

   $shpobj->free();

  }

//  $query_layer->close();  // <';

 

} // end success

...

 

 

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Sven Schroeter
Sent: Thursday, March 25, 2010 10:52 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] php mapscript

 

Alan,

thanks for the reply, I tried it with getFeature(), but there comes the same


error.

nextShape() works only after msWhichShapes and here I need a rectobj.

But I want to use the script for queryByShape and queryByAttributes too.

Why there comes no array in $attr = $shpobj->values; ?

Any idea?

Sven

 

- Original Message - 

From: "Alan Boudreault" 

To: 

Cc: "Sven Schroeter" 

Sent: Thursday, March 25, 2010 2:32 PM

Subject: Re: [mapserver-users] php mapscript

 

 

> Sven,

> 

> getShape() is deprecated. Use rather getFeature(). I suggest to also take 

> a

> look at the nextShape() function:

> http://mapserver.org/mapscript/php/index.html#layerobj-class

> 

> Alan

> 

> On March 25, 2010 09:18:50 am Sven Schroeter wrote:

>> Hi,

>> I have an old php mapscript code that works fine with mapserver 5.02 or

>>  5.2, but not with 5.6.1.

>> The code runs an attribute tabe from a postgis layer and different querys

>> i.e. queryByRect:

>> 

>> ...

>> @$datQuery = $query_layer->queryByRect($qRect);

>> 

>>  //number of objects

>>  $resnum = $query_layer->getNumResults();

>>  echo "number of objects: ".$resnum."";

>> 

>>  //if query success

>> if ($datQuery == MS_SUCCESS) {

>>   $query_layer->open();

>> 

>>   //first row

>>   $result = $query_layer->getResult(0);

>>   $shpobj = 

>> $query_layer->getShape($result->tileindex,$result->shapeindex);

>>   //read attribute

>>   $attr = $shpobj->values;

>> 

>>   //write headline

>>   echo '';

>>   foreach($attr as $name=>$wert) {

>>echo ''.$name.'';

>>   }

>>   echo '';

>> 

>>   //write datasets

>>   for ($j=0; $j<$query_layer->getNumResults(); $j++) {

>>$result = $query_layer->getResult($j);

>>$shpobj =

>>  $query_layer->getShape($result->tileindex,$result->shapeindex); $ri =

>>  $result->tileindex;

>>$si = $result->shapeindex;

>>$attr = $shpobj->values;

>>echo '';

>>foreach($attr as $name=>$wert) {

>> echo ''.$wert.'';

>>}

>>echo '';

>>$shpobj->free();

>>   }

>>   $query_layer->close();

>>   echo '';

>> 

>> } // end success

>> ...

>> 

>> In ms 5.6.1 the query is also successful (I get the correct number of

>> objects) but there comes following warning:

>> Invalid argument supplied for foreach() in ... Fatal error: Call to a

>>  member function free() on a non-object in ...

>> No object? Why? What has changed?

>> Thanks

>> Sven

>> 

>> 

>> 

>> ___

>> mapserver-users mailing list

>> mapserver-users@lists.osgeo.org

>> http://lists.osgeo.org/mailman/listinfo/mapserver-users

>> 

> 

> -- 

> Alan Boudreault

> Mapgears

> http://www.mapgears.com

> 

> 

 

 

 

___

mapserver-users mailing list

mapserver-users@lists.osgeo.org

http://lists.osgeo.org/mailman/listinfo/mapserver-users

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