Re: [mapserver-users] WFS Filter Encoding and resulting DB-queries

2011-02-23 Thread Yewondwossen Assefa

On 23/02/2011 8:06 AM, Stephan Holl wrote:

Hello Assefa,

Yewondwossen Assefa, [20110223 - 07:26:34]


Hi Stephan,

On 22/02/2011 3:44 AM, Stephan Holl wrote:

Hello list,

while playing with MapServer WFS Filter Encoding capabilities I
found some strange things when it comes to form the DB-queries (the
requested layer is PostGIS-driven).

It seems that there will always be a full table-scan and later on
the FE will be applied. Is this done by design?


   Filters that do include spatial filters end up using the mapserver
experssions. 'Simple' filters should end be using traslated into the
layer's filter expression and end up being used by postgis as part of
the data selection. What does the filter encoding looks like?

It is not a spatial-filter we use currently. It is an attribute-based
IsLike-Filter like seen here[1], but we use it with POST. So adding a
BBOX-related filter as another AND-filter will result in optimized
SQL-Query with only the subset fetched from the database? If so, this
seems worth to document though.

 The filter you sent as example should use the layer's filter element 
and that  should be used when retrieving the data at the postgis level. 
When the layer is in debug mode,  MapServer 5.6.x logs in this case 
shows something like (which indicates that the filter is used at the 
postgis level)

...
msPostGISLayerWhichShapes  query: select  and ( (NAME like 'Syd%' 
escape '!') )

...

Don't you get similar logs?




Best

Stephan

[1]
http://demo.mapserver.org/cgi-bin/wfs?&VERSION=1.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=cities&Filter=%3CFilter%3E%3CPropertyIsLike%20wildcard=%27*%27%20singleChar=%27.%27%20escape=%27!%27%3E%3CPropertyName%3ENAME%3C/PropertyName%3E%3CLiteral%3ESyd*%3C/Literal%3E%3C/PropertyIsLike%3E%3C/Filter%3E




--

Assefa Yewondwossen
Software Analyst

Email: yass...@dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925



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


Re: [mapserver-users] Heatmap / choropleth from points attributes

2011-02-23 Thread Daniel Cole
So much good information.  Thank you all so much for these responses.  I
will take the later part of this week digging through all of the suggestions
and trying the methods.  I guess what I am trying to do seems to be more
choropleth than heatmap, due to the fact that I don't want any areas without
color, I want it to be interpolated off of the nearest point. I am sure I
will be back on here asking more about this, but for the time being I have
been given some great code and directions.  Thanks again Tamas, Brent, and
all of the others.  What a great bunch of help.

Thanks,

Daniel



On Wed, Feb 23, 2011 at 12:41 PM,  wrote:

> Hi Daniel,
>
> Points to voronoi for mapping is surely a chloropleth more than a heatmap?
> Colouring polygons by value? A heat map is generally done by rendering a
> surface generated from point data.
>
> From the original question I'm not sure if simply plotting coloured points
> on the map is required, or some sort of aggregation of the point data by
> polygon.
>
> I _think_ the intent is to take sets of points, each within a polygon
> (field), generate a surface within each polygon based on the point values,
> then render each surface to form a heatmap (the rendered map thus comprising
> a set of polygons, each of which is represented by its own heat map) ???
>
>
> For a more elegant GIS based approach, I'd use GMT to render a static map
> for a web page, which was the intent behind original question. Mapserver is
> more for dynamic/interactive web mapping.
>
> See: http://gmt.soest.hawaii.edu/gmt/doc/gmt/pdf/GMT_Docs.pdf
>
> For different ways of showing the values of points on a map see the
> examples on pages 120, 121, 138, 141, 144, etc. And there are many others
> with a tool this powerful (& complex) including generating & plotting
> surfaces derived from point data (for heat maps)
>
> You write a script to build the map, much as in the p141 example, which
> shows how GMT can create a complex legend automatically as well, and run the
> script whenever a new or updated map is required.
>
> The GMT list (IMHO) is a helpful & supportive as any mailing list I've
> encountered, even this one!!
>
> A script which iterates through each field (set of points) generating each
> constrained surface and inserting it to a grid, then rendering the entire
> grid for your map output would do this pretty easily.
>
> See the GMT docs for the commands surface for one way to generate each
> field of points as a grid, grdmath for how to merge these into one grid, &
> grdimage for how to generate the map from these gridded data. Or you could
> just render each field separately with grid points outside the field polygon
> set to NAN & rendered transparent.
>
> Or throw all the points into a surface, render this as a single heat map &
> overlay the fields as transparent polygons (optionally labelled) with
> perhaps the regions between polygons masked if appropriate?
>
> Lots of ways of generating such maps :-)
>
> If you'd like some help going down this path, contact me off list.
>
> Cheers,
>
>   Brent Wood
>
>
>
>
> --- On *Thu, 2/24/11, Puneet Kishor * wrote:
>
>
> From: Puneet Kishor 
> Subject: Re: [mapserver-users] Heatmap / choropleth from points attributes
> To: "Milo van der Linden" 
> Cc: mapserver-users@lists.osgeo.org
> Date: Thursday, February 24, 2011, 6:23 AM
>
>
> On Wed, Feb 23, 2011 at 04:28:31PM +0100, Milo van der Linden wrote:
> > Turning points into polygons (or voronois) is the "thinking like a GIS
> > professional" approach. This is valid, but not as good as it can get.
> > Basically, using imaging techniques would be a better approach.
>
> Very well put.
>
> >
> > Perhaps you can take this: http://www.sethoscope.net/heatmap/ as a
> starting
> > point? The author has created a nice python script to generate a heatmap.
>
> And here is a Perl-based approach
> [http://blog.imtrevor.com/2009/07/16/generating-heat-maps-using-perl/]
>
>
> >
> > 2011/2/23 Josh Jordan 
> > http://mc/compose?to=outerspacema...@yahoo.com>
> >
> >
> > > First, you have to turn your points into shapes, theres some algorithm
> that
> > > will turn points into polygons with borders midway between each point.
> > >  Then, you have to add classes to the mapfile.  Add one class per
> color.
> > >  You have to calculate the bounds and color for each class like this:
> > >
> > > CLASS
> > > EXPRESSION(([POPULATION] gt 90457) AND ([POPULATION] le 108397))
> > > STYLE
> > >   COLOR 10 20 50
> > > END
> > > END
> > >
> > > If your CSV data isnt joined to the mapserver data, you have to
> calculate
> > > what shapes are in each bucket like this-
> > >
> > > CLASS
> > > EXPRESSION(([NAME] = "Shape1") OR ([NAME] = "Shape2"))
> > > STYLE
> > >   COLOR 10 20 50
> > > END
> > > END
> > >
> > > --- On *Tue, 2/22/11, Daniel Cole 
> > > http://mc/compose?to=dan...@southernsolutionsms.com>>*
> wrote:
> > >
> > >
> > > From: Daniel Cole 
> > > http://mc/compose?to=dan...@southernsolutionsm

Re: [mapserver-users] PHP Mapscript, label with self created text

2011-02-23 Thread Milo van der Linden
Sorry! Found it by scroogling a bit:

Set PROCESSING "LABEL_NO_CLIP=ON" per layer. Everything works now!



2011/2/23 Milo van der Linden 

> Hi Nicol,
>
> Excellent! It works! Now I only have one more issue:
>
>
> http://www.dogomaps.net/bikkels/index.html?zoom=9&lat=385827.82031&lon=174867.38281&layers=B
>
> The label is duplicated due to the fact that I am retrieving tiles. Any
> experience with that?
>
> 2011/2/23 Nicol Hermann 
>
> Hi Milo,
>>
>> Try:
>> $theme_class[$i]->settext($v);
>>
>> http://mapserver.org/mapscript/php/index.html#classobj
>>
>> HTH
>> Nicol
>>
>>
>> Am Mittwoch, den 23.02.2011, 16:19 +0100 schrieb Milo van der Linden:
>> > Hello people,
>> >
>> > I have created a piece of mapscript that takes a key/value pair and
>> > creates class-coloring according to this. This works perfectly well
>> > except for one tiny little thing:
>> >
>> > I want to add $v as a label to my classes.
>> >
>> > My question is: Is it possible to assign static text to a label?
>> > Because if it is not; I would have to query the underlying layer for
>> > it's centroid and create a text label on top of that layer.
>> >
>> > For instance something like:
>> > $theme_label[$i]->set("labeltext", $v);
>> >
>> >
>> >
>> > foreach ($mycollection as $k=>$v) {
>> > $theme_class[$i]=ms_newClassObj($theme_layer);
>> > $theme_class[$i]->setExpression($k);
>> > $theme_class[$i]->set("name",
>> > $theme_class[$i]->getExpressionString());
>> > $theme_style[$i]=ms_newStyleObj($theme_class[$i]);
>> > $tc = $theme->getColourValue($v);
>> > $theme_style[$i]->color->setRGB($tc[0],$tc[1],$tc[2]);
>> > $theme_style[$i]->outlinecolor->setRGB(255,255,255);
>> > //$theme_label[$i]=ms_newLabelObj($theme_class[$i]);
>> > //$theme_label[$i]->set("font", "sans");
>> > //$theme_label[$i]->set("type", "truetype");
>> > //$theme_label[$i]->set("size", 10);
>> > //$theme_label[$i]->set("labeltext", $v);
>> > $i++;
>> > }
>> >
>> > ___
>> > mapserver-users mailing list
>> > mapserver-users@lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
>>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] PHP Mapscript, label with self created text

2011-02-23 Thread Milo van der Linden
Hi Nicol,

Excellent! It works! Now I only have one more issue:

http://www.dogomaps.net/bikkels/index.html?zoom=9&lat=385827.82031&lon=174867.38281&layers=B

The label is duplicated due to the fact that I am retrieving tiles. Any
experience with that?

2011/2/23 Nicol Hermann 

> Hi Milo,
>
> Try:
> $theme_class[$i]->settext($v);
>
> http://mapserver.org/mapscript/php/index.html#classobj
>
> HTH
> Nicol
>
>
> Am Mittwoch, den 23.02.2011, 16:19 +0100 schrieb Milo van der Linden:
> > Hello people,
> >
> > I have created a piece of mapscript that takes a key/value pair and
> > creates class-coloring according to this. This works perfectly well
> > except for one tiny little thing:
> >
> > I want to add $v as a label to my classes.
> >
> > My question is: Is it possible to assign static text to a label?
> > Because if it is not; I would have to query the underlying layer for
> > it's centroid and create a text label on top of that layer.
> >
> > For instance something like:
> > $theme_label[$i]->set("labeltext", $v);
> >
> >
> >
> > foreach ($mycollection as $k=>$v) {
> > $theme_class[$i]=ms_newClassObj($theme_layer);
> > $theme_class[$i]->setExpression($k);
> > $theme_class[$i]->set("name",
> > $theme_class[$i]->getExpressionString());
> > $theme_style[$i]=ms_newStyleObj($theme_class[$i]);
> > $tc = $theme->getColourValue($v);
> > $theme_style[$i]->color->setRGB($tc[0],$tc[1],$tc[2]);
> > $theme_style[$i]->outlinecolor->setRGB(255,255,255);
> > //$theme_label[$i]=ms_newLabelObj($theme_class[$i]);
> > //$theme_label[$i]->set("font", "sans");
> > //$theme_label[$i]->set("type", "truetype");
> > //$theme_label[$i]->set("size", 10);
> > //$theme_label[$i]->set("labeltext", $v);
> > $i++;
> > }
> >
> > ___
> > 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] webgis application is not opening

2011-02-23 Thread ahmet temiz
hello

I used java-mapscript, tomcat, jsf.

In production stage, my webgis application is going to localhost
and finding nothing

do I have to change  something  in my map file?
such as
do I have to change  :
~~~
CONNECTIONTYPE postgis
CONNECTION "dbname='bzk2' host=localhost
~~~
 in first try it goes to localhost.
only in second try it opens the page

if you want to look at the page:
"http://www.deprem.gov.tr:8080/pro1/bir.jsf";
-- 
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı
Bilgi ve CBS grubu
Eskişehir Yolu 10. km.
Lodumlu / Ankara
Tel : 0 312 2872680 / 1535
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Heatmap / choropleth from points attributes

2011-02-23 Thread pcreso
Hi Daniel,

Points to voronoi for mapping is surely a chloropleth more than a heatmap? 
Colouring polygons by value? A heat map is generally done by rendering a 
surface generated from point data.

>From the original question I'm not sure if simply plotting coloured points on 
>the map is required, or some sort of aggregation of the point data by polygon.

I _think_ the intent is to take sets of points, each within a polygon (field), 
generate a surface within each polygon based on the point values, then render 
each surface to form a heatmap (the rendered map thus comprising a set of 
polygons, each of which is represented by its own heat map) ???


For a more elegant GIS based approach, I'd use GMT to render a static map for a 
web page, which was the intent behind original question. Mapserver is more for 
dynamic/interactive web mapping.

See: http://gmt.soest.hawaii.edu/gmt/doc/gmt/pdf/GMT_Docs.pdf

For different ways of showing the values of points on a map see the examples on 
pages 120, 121, 138, 141, 144, etc. And there are many others with a tool this 
powerful (& complex) including generating & plotting surfaces derived from 
point data (for heat maps)

You write a script to build the map, much as in the p141 example, which shows 
how GMT can create a complex legend automatically as well, and run the script 
whenever a new or updated map is required.

The GMT list (IMHO) is a helpful & supportive as any mailing list I've 
encountered, even this one!!

A script which iterates through each field (set of points) generating each 
constrained surface and inserting it to a grid, then rendering the entire grid 
for your map output would do this pretty easily.

See the GMT docs for the commands surface for one way to generate each field of 
points as a grid, grdmath for how to merge these into one grid, & grdimage for 
how to generate the map from these gridded data. Or you could just render each 
field separately with grid points outside the field polygon set to NAN & 
rendered transparent.

Or throw all the points into a surface, render this as a single heat map & 
overlay the fields as transparent polygons (optionally labelled) with perhaps 
the regions between polygons masked if appropriate?

Lots of ways of generating such maps :-)

If you'd like some help going down this path, contact me off list.

Cheers,

  Brent Wood




--- On Thu, 2/24/11, Puneet Kishor  wrote:

From: Puneet Kishor 
Subject: Re: [mapserver-users] Heatmap / choropleth from points attributes
To: "Milo van der Linden" 
Cc: mapserver-users@lists.osgeo.org
Date: Thursday, February 24, 2011, 6:23 AM

On Wed, Feb 23, 2011 at 04:28:31PM +0100, Milo van der Linden wrote:
> Turning points into polygons (or voronois) is the "thinking like a GIS
> professional" approach. This is valid, but not as good as it can get.
> Basically, using imaging techniques would be a better approach.

Very well put.

> 
> Perhaps you can take this: http://www.sethoscope.net/heatmap/ as a starting
> point? The author has created a nice python script to generate a heatmap.

And here is a Perl-based approach
[http://blog.imtrevor.com/2009/07/16/generating-heat-maps-using-perl/]


> 
> 2011/2/23 Josh Jordan 
> 
> > First, you have to turn your points into shapes, theres some algorithm that
> > will turn points into polygons with borders midway between each point.
> >  Then, you have to add classes to the mapfile.  Add one class per color.
> >  You have to calculate the bounds and color for each class like this:
> >
> > CLASS
> >     EXPRESSION(([POPULATION] gt 90457) AND ([POPULATION] le 108397))
> >     STYLE
> >       COLOR 10 20 50
> >     END
> > END
> >
> > If your CSV data isnt joined to the mapserver data, you have to calculate
> > what shapes are in each bucket like this-
> >
> > CLASS
> >     EXPRESSION(([NAME] = "Shape1") OR ([NAME] = "Shape2"))
> >     STYLE
> >       COLOR 10 20 50
> >     END
> > END
> >
> > --- On *Tue, 2/22/11, Daniel Cole * wrote:
> >
> >
> > From: Daniel Cole 
> > Subject: [mapserver-users] Heatmap / choropleth from points attributes
> > To: mapserver-users@lists.osgeo.org
> > Date: Tuesday, February 22, 2011, 10:06 PM
> >
> > I am a new mapserver user and have spent countless hours over the last
> > month reading, trying code, etc. before posting here for help.  I am trying
> > to generate an image (non-interactive) on a webpage based off of attribute
> > data in a points file.  For example, 20 different points equally distributed
> > in a field contain data about the moister level of the soil.  I want to make
> > the lowest levels blue and the highest levels yellow, or something like that
> > with some gradients in between.  If possible I want it to have interpolated
> > data between them to show the gradual change, but that isn't a must.   I
> > also want to wrap it in a polygon that trims the edges.
> >
> > I found some python code that I thought might do the trick , but it seems
> > lots of heat maps are based off of how ma

Re: [mapserver-users] ogr connection trouble

2011-02-23 Thread Frank Warmerdam

On 11-02-23 09:08 AM, Josh Jordan wrote:

I am trying to get mapserver to draw an OGR layer, was wondering what this
means in the OGRINFO readout, I get a series of fields with String (0.0), was
wondering what (0.0) means or if its the problem?

POPULATION: String (0.0)
MALE: String (0.0)
FEMALE: String (0.0)


Josh,

It indicates that the field width is variable.  If it used "(8.0)" that would
indicate a field width of at most 8 characters.  For floating point fields
the part following the decimal will be the number of decimal places in the
value.

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] Heatmap / choropleth from points attributes

2011-02-23 Thread Puneet Kishor
On Wed, Feb 23, 2011 at 04:28:31PM +0100, Milo van der Linden wrote:
> Turning points into polygons (or voronois) is the "thinking like a GIS
> professional" approach. This is valid, but not as good as it can get.
> Basically, using imaging techniques would be a better approach.

Very well put.

> 
> Perhaps you can take this: http://www.sethoscope.net/heatmap/ as a starting
> point? The author has created a nice python script to generate a heatmap.

And here is a Perl-based approach
[http://blog.imtrevor.com/2009/07/16/generating-heat-maps-using-perl/]


> 
> 2011/2/23 Josh Jordan 
> 
> > First, you have to turn your points into shapes, theres some algorithm that
> > will turn points into polygons with borders midway between each point.
> >  Then, you have to add classes to the mapfile.  Add one class per color.
> >  You have to calculate the bounds and color for each class like this:
> >
> > CLASS
> > EXPRESSION(([POPULATION] gt 90457) AND ([POPULATION] le 108397))
> > STYLE
> >   COLOR 10 20 50
> > END
> > END
> >
> > If your CSV data isnt joined to the mapserver data, you have to calculate
> > what shapes are in each bucket like this-
> >
> > CLASS
> > EXPRESSION(([NAME] = "Shape1") OR ([NAME] = "Shape2"))
> > STYLE
> >   COLOR 10 20 50
> > END
> > END
> >
> > --- On *Tue, 2/22/11, Daniel Cole * wrote:
> >
> >
> > From: Daniel Cole 
> > Subject: [mapserver-users] Heatmap / choropleth from points attributes
> > To: mapserver-users@lists.osgeo.org
> > Date: Tuesday, February 22, 2011, 10:06 PM
> >
> > I am a new mapserver user and have spent countless hours over the last
> > month reading, trying code, etc. before posting here for help.  I am trying
> > to generate an image (non-interactive) on a webpage based off of attribute
> > data in a points file.  For example, 20 different points equally distributed
> > in a field contain data about the moister level of the soil.  I want to make
> > the lowest levels blue and the highest levels yellow, or something like that
> > with some gradients in between.  If possible I want it to have interpolated
> > data between them to show the gradual change, but that isn't a must.   I
> > also want to wrap it in a polygon that trims the edges.
> >
> > I found some python code that I thought might do the trick , but it seems
> > lots of heat maps are based off of how many points exist in a certain area,
> > and thats now what I am doing.
> >
> > My points contain numbers in the attributes, 5, 25, 92, 71, etc.   I feel
> > like I am missing some easy way to do this right in front of me with gdal or
> > something.  If someone has any direction or even demo code that would be
> > greatly appreciated.
> >
> > Thanks,
> >
> > Daniel
> >
> > -Inline Attachment Follows-
> >
> > ___
> > mapserver-users mailing list
> > mapserver-users@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> >
> >
> > ___
> > mapserver-users mailing list
> > mapserver-users@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> >

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

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


Re: [mapserver-users] Heatmap / choropleth from points

2011-02-23 Thread Tom van der Putte
Hi
Daniel,
 So if I undestand correctly you want to display you points and the
colour the areas around them according to the nearest point (1), or if
possible make a continous interpolated map that shows the gradients
(2)?
 OK, this is not in the MapServer-topic, because MapServer has no way
to do this. So I suggest we move this conversation private, but I'll
try to give you an answer for future reference. If you have any
questions, mail me directly.
 If this is indeed as you say non-dynamic, things are easy; with any
respectable GIS package, you can create option (1) by making a Voronoi
diagram. This makes polygons around yout points in which every
location in its interior of the polygon is closer to its center point
than it is to other points. The result is a vector image (shapefile).
 To create option (2) you have to interpolate these points into a
(continuous) raster through any interpolation method. Simplest is
nearest neighbour which in essence creates a Voronoi Diagram in raster
 format. If you want to go more pro, there is Inverse Distance
Weighted (which I do not encourage people using because the options
have huge influence on the outcome and are note really exact). Then
there is Kriging, but you need to be into statistics quite a bit to be
able to get a good outcome -- if not, leave it alone. Then there is
also Natural Neighbour interpolation, which uses a Voronoi Diagram as
its basis, and is thus quite well suited for using points that are
anisotropically distributed, and when kriging is not an option.
 If you do want these things programatically, there are a couple of
python scripts I have that you could use for create Nearest Neighbour
and Natural Neighbour interpolations. You will need to adjust those
quite a bit.
 Tom

---
  Date: Wed, 23 Feb 2011 04:56:43 -0800 (PST)
 From: Josh Jordan 
 Subject: Re: [mapserver-users] Heatmap / choropleth from points
 attributes
 To: Daniel Cole 
 Cc: mapserver-users@lists.osgeo.org [3]
 Message-ID: 
 Content-Type: text/plain; charset="iso-8859-1"
 First, you have to turn your points into shapes, theres some
algorithm that will turn points into polygons with borders midway
between each point. 
 CLASS
 If your CSV data isnt joined to the mapserver data, you have to
calculate what shapes are in each bucket like this-
 CLASS
 --- On Tue, 2/22/11, Daniel Cole  wrote:
 From: Daniel Cole 
 Subject: [mapserver-users] Heatmap / choropleth from points
attributes
 To: mapserver-users@lists.osgeo.org [7]
 Date: Tuesday, February 22, 2011, 10:06 PM
 I am a new mapserver user and have spent countless hours over the
last month reading, trying code, etc. before posting here for help. 
 I found some python code that I thought might do the trick , but it
seems lots of heat maps are based off of how many points exist in a
certain area, and thats now what I am doing. 
 My points contain numbers in the attributes, 5, 25, 92, 71, etc. 
 Thanks,
 Daniel
 -Inline Attachment Follows-
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org [8]
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 -- next part --
 An HTML attachment was scrubbed...
 URL:
http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110223/fe139556/attachment-0001.html
 --
 

Links:
--
[1] mailto:outerspacema...@yahoo.com
[2] mailto:dan...@southernsolutionsms.com
[3] mailto:mapserver-users@lists.osgeo.org
[4] mailto:428818.75172...@web111314.mail.gq1.yahoo.com
[5] mailto:dan...@southernsolutionsms.com
[6] mailto:dan...@southernsolutionsms.com
[7] mailto:mapserver-users@lists.osgeo.org
[8] mailto:mapserver-users@lists.osgeo.org
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Heatmap / choropleth from points attributes

2011-02-23 Thread Milo van der Linden
Turning points into polygons (or voronois) is the "thinking like a GIS
professional" approach. This is valid, but not as good as it can get.
Basically, using imaging techniques would be a better approach.

Perhaps you can take this: http://www.sethoscope.net/heatmap/ as a starting
point? The author has created a nice python script to generate a heatmap.

2011/2/23 Josh Jordan 

> First, you have to turn your points into shapes, theres some algorithm that
> will turn points into polygons with borders midway between each point.
>  Then, you have to add classes to the mapfile.  Add one class per color.
>  You have to calculate the bounds and color for each class like this:
>
> CLASS
> EXPRESSION(([POPULATION] gt 90457) AND ([POPULATION] le 108397))
> STYLE
>   COLOR 10 20 50
> END
> END
>
> If your CSV data isnt joined to the mapserver data, you have to calculate
> what shapes are in each bucket like this-
>
> CLASS
> EXPRESSION(([NAME] = "Shape1") OR ([NAME] = "Shape2"))
> STYLE
>   COLOR 10 20 50
> END
> END
>
> --- On *Tue, 2/22/11, Daniel Cole * wrote:
>
>
> From: Daniel Cole 
> Subject: [mapserver-users] Heatmap / choropleth from points attributes
> To: mapserver-users@lists.osgeo.org
> Date: Tuesday, February 22, 2011, 10:06 PM
>
> I am a new mapserver user and have spent countless hours over the last
> month reading, trying code, etc. before posting here for help.  I am trying
> to generate an image (non-interactive) on a webpage based off of attribute
> data in a points file.  For example, 20 different points equally distributed
> in a field contain data about the moister level of the soil.  I want to make
> the lowest levels blue and the highest levels yellow, or something like that
> with some gradients in between.  If possible I want it to have interpolated
> data between them to show the gradual change, but that isn't a must.   I
> also want to wrap it in a polygon that trims the edges.
>
> I found some python code that I thought might do the trick , but it seems
> lots of heat maps are based off of how many points exist in a certain area,
> and thats now what I am doing.
>
> My points contain numbers in the attributes, 5, 25, 92, 71, etc.   I feel
> like I am missing some easy way to do this right in front of me with gdal or
> something.  If someone has any direction or even demo code that would be
> greatly appreciated.
>
> Thanks,
>
> Daniel
>
> -Inline Attachment Follows-
>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] PHP Mapscript, label with self created text

2011-02-23 Thread Milo van der Linden
Hello people,

I have created a piece of mapscript that takes a key/value pair and creates
class-coloring according to this. This works perfectly well except for one
tiny little thing:

I want to add $v as a label to my classes.

My question is: Is it possible to assign static text to a label? Because if
it is not; I would have to query the underlying layer for it's centroid and
create a text label on top of that layer.

For instance something like:
$theme_label[$i]->set("labeltext", $v);



foreach ($mycollection as $k=>$v) {
$theme_class[$i]=ms_newClassObj($theme_layer);
$theme_class[$i]->setExpression($k);
$theme_class[$i]->set("name",
$theme_class[$i]->getExpressionString());
$theme_style[$i]=ms_newStyleObj($theme_class[$i]);
$tc = $theme->getColourValue($v);
$theme_style[$i]->color->setRGB($tc[0],$tc[1],$tc[2]);
$theme_style[$i]->outlinecolor->setRGB(255,255,255);
//$theme_label[$i]=ms_newLabelObj($theme_class[$i]);
//$theme_label[$i]->set("font", "sans");
//$theme_label[$i]->set("type", "truetype");
//$theme_label[$i]->set("size", 10);
//$theme_label[$i]->set("labeltext", $v);
$i++;
}
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] colored legend for raster data

2011-02-23 Thread Georg Kaspar
Dear mapserver users,

i'm using mapserver to display scanned maps along with their respective
legends. When using the KEYIMAGE tag within the mapfile to assign a
layer's legend, the graphic returned by a GetLegendGraphic-Request will
be converted from color to a reduced color table (similar to greyscale
though not fully desaturated).
Is this problem known to any of you? Is there any mistake in the way i'm
using this function?

Thank's for your help & best regards,

Georg



signature.asc
Description: OpenPGP digital signature
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] ogr connection trouble

2011-02-23 Thread Josh Jordan
I am trying to get mapserver to draw an OGR layer, was wondering what this 
means in the OGRINFO readout, I get a series of fields with String (0.0), was 
wondering what (0.0) means or if its the problem?
POPULATION: String (0.0)MALE: String (0.0)FEMALE: String (0.0)




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


Re: [mapserver-users] Status of Java MapScript?

2011-02-23 Thread Stephan Holl
Hello Umberto,

Umberto Nicoletti , [20110222 - 20:22:59]

> Hi Stephan,
> I'm the mantainer of java mapscript and while I have not been working
> on it for quite some time, I am stil successfully using it in a
> couple of projects (one is a fairly complex webgis).

OK, thanks for your input. It seems I have to play a little bit with it
and see how I can live with that.

Thanks anyway

Stephan

> On Tue, Feb 22, 2011 at 9:51 AM, Stephan Holl
> wrote:
> 
> > Hello list,
> >
> > is anybody able to share the current status of Java Mapscript?
> > Browsing the net mostly brings up PHP mapscript, C# or python
> > mapscript status.
> >
> > I would love to hear some user-feedback from happy (and of course
> > unhappy) Java mapscript-users. :-)
> >
> > TIA
> >
> >Stephan
> >
> > --
> > Stephan Holl  | Tel.: +49 (0)541-33 508
> > 3663 Intevation GmbH, Neuer Graben 17, 49074 OS  |  AG Osnabrück -
> > HR B 18998 Geschäftsführer:  Frank Koormann, Bernhard Reiter, Dr.
> > Jan-Oliver Wagner
> >
> > ___
> > mapserver-users mailing list
> > mapserver-users@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> >


-- 
Stephan Holl  | Tel.: +49 (0)541-33 508 3663
Intevation GmbH, Neuer Graben 17, 49074 OS  |  AG Osnabrück - HR B 18998
Geschäftsführer:  Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


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


Re: [mapserver-users] WFS Filter Encoding and resulting DB-queries

2011-02-23 Thread Stephan Holl
Hello Assefa,

Yewondwossen Assefa , [20110223 - 07:26:34]

> Hi Stephan,
> 
> On 22/02/2011 3:44 AM, Stephan Holl wrote:
> > Hello list,
> >
> > while playing with MapServer WFS Filter Encoding capabilities I
> > found some strange things when it comes to form the DB-queries (the
> > requested layer is PostGIS-driven).
> >
> > It seems that there will always be a full table-scan and later on
> > the FE will be applied. Is this done by design?
> >
>   Filters that do include spatial filters end up using the mapserver 
> experssions. 'Simple' filters should end be using traslated into the 
> layer's filter expression and end up being used by postgis as part of 
> the data selection. What does the filter encoding looks like?

It is not a spatial-filter we use currently. It is an attribute-based
IsLike-Filter like seen here[1], but we use it with POST. So adding a
BBOX-related filter as another AND-filter will result in optimized
SQL-Query with only the subset fetched from the database? If so, this
seems worth to document though.

> > Using URL-substitutions of the Search-keyword and apply it to a
> > FILTER-element the resulting SQL-query has the given WHERE-filter
> > set. But this opens the door for SQL-injections AFAIK. Setting the
> > validation pattern is a little prevention.
> >
> > Are there any other ways to realize a keyword-driven search with
> > MapServer beside FE IsLike or FILTER-substitution?
> >

Best

Stephan

[1]
http://demo.mapserver.org/cgi-bin/wfs?&VERSION=1.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=cities&Filter=%3CFilter%3E%3CPropertyIsLike%20wildcard=%27*%27%20singleChar=%27.%27%20escape=%27!%27%3E%3CPropertyName%3ENAME%3C/PropertyName%3E%3CLiteral%3ESyd*%3C/Literal%3E%3C/PropertyIsLike%3E%3C/Filter%3E

-- 
Stephan Holl  | Tel.: +49 (0)541-33 508 3663
Intevation GmbH, Neuer Graben 17, 49074 OS  |  AG Osnabrück - HR B 18998
Geschäftsführer:  Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


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


Re: [mapserver-users] Heatmap / choropleth from points attributes

2011-02-23 Thread Josh Jordan
First, you have to turn your points into shapes, theres some algorithm that 
will turn points into polygons with borders midway between each point.  Then, 
you have to add classes to the mapfile.  Add one class per color.  You have to 
calculate the bounds and color for each class like this:
CLASS    EXPRESSION(([POPULATION] gt 90457) AND ([POPULATION] le 108397))    
STYLE      COLOR 10 20 50    ENDEND
If your CSV data isnt joined to the mapserver data, you have to calculate what 
shapes are in each bucket like this-
CLASS    EXPRESSION(([NAME] = "Shape1") OR ([NAME] = "Shape2"))    STYLE      
COLOR 10 20 50    ENDEND
--- On Tue, 2/22/11, Daniel Cole  wrote:

From: Daniel Cole 
Subject: [mapserver-users] Heatmap / choropleth from points attributes
To: mapserver-users@lists.osgeo.org
Date: Tuesday, February 22, 2011, 10:06 PM

I am a new mapserver user and have spent countless hours over the last month 
reading, trying code, etc. before posting here for help.  I am trying to 
generate an image (non-interactive) on a webpage based off of attribute data in 
a points file.  For example, 20 different points equally distributed in a field 
contain data about the moister level of the soil.  I want to make the lowest 
levels blue and the highest levels yellow, or something like that with some 
gradients in between.  If possible I want it to have interpolated data between 
them to show the gradual change, but that isn't a must.   I also want to wrap 
it in a polygon that trims the edges.  

I found some python code that I thought might do the trick , but it seems lots 
of heat maps are based off of how many points exist in a certain area, and 
thats now what I am doing.  

My points contain numbers in the attributes, 5, 25, 92, 71, etc.   I feel like 
I am missing some easy way to do this right in front of me with gdal or 
something.  If someone has any direction or even demo code that would be 
greatly appreciated.  

Thanks,

Daniel

-Inline Attachment Follows-

___
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] WFS Filter Encoding and resulting DB-queries

2011-02-23 Thread Yewondwossen Assefa

Hi Stephan,

On 22/02/2011 3:44 AM, Stephan Holl wrote:

Hello list,

while playing with MapServer WFS Filter Encoding capabilities I found
some strange things when it comes to form the DB-queries (the
requested layer is PostGIS-driven).

It seems that there will always be a full table-scan and later on the FE
will be applied. Is this done by design?

 Filters that do include spatial filters end up using the mapserver 
experssions. 'Simple' filters should end be using traslated into the 
layer's filter expression and end up being used by postgis as part of 
the data selection. What does the filter encoding looks like?



Using URL-substitutions of the Search-keyword and apply it to a
FILTER-element the resulting SQL-query has the given WHERE-filter set.
But this opens the door for SQL-injections AFAIK. Setting the
validation pattern is a little prevention.

Are there any other ways to realize a keyword-driven search with
MapServer beside FE IsLike or FILTER-substitution?

I am using MS 5.6.5 on debian stable.

TIA

Stephan



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



--

Assefa Yewondwossen
Software Analyst

Email: yass...@dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925



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


[mapserver-users] Spherical Mercator Projection Problem

2011-02-23 Thread Sergey Kraev
Hi,



I’m running MS4W v3.0 (including MapServer 5.6.5) on Windows.



My data source are PostGIS multipolygon countries’ borders.



I have successfully got MapServer to render the world map in WGS84
projection using these settings:



Request:



http://127.0.0.1:8080/cgi-bin/mapserv.exe?map=world.map&mode=map&mapsize=256+256&mapext=-180+-90+180+90



world.map:



MAP

 EXTENT   -180 -90 180 90

  #EXTENT -20037508 -20037508 20037508 20037508

  SIZE   256 256

  IMAGECOLOR 153 179 204

  FONTSET"c:\MS4W\fonts\fonts.list"

  RESOLUTION96

  MAXSIZE5000



  PROJECTION

"init=epsg:4326"

#"init=epsg:3785"

  END

…





I would like MapServer to render the same data into a “Web (spherical)
Mercator” projected map (epsg:3785), but I don't know how to modify my
request and mapfile in order to get the correct map.



With the following settings I just receive a picture without any polygons.



\ms4w\proj\nad\epsg:



…

<3785> +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 +nadgrids=@null +wktext  +no_defs <>

…



Request (only mapext is different):



http://127.0.0.1:8080/cgi-bin/mapserv.exe?map=world.map&mode=map&mapsize=256+256&mapext=-20037508+-20037508+20037508+20037508



world.map (only EXTENT and PROJECTION are different):



MAP

  #EXTENT   -180 -90 180 90

  EXTENT -20037508 -20037508 20037508 20037508

  SIZE   256 256

  IMAGECOLOR 153 179 204

  FONTSET"c:\MS4W\fonts\fonts.list"

  RESOLUTION96

  MAXSIZE5000



  PROJECTION

#"init=epsg:4326"

"init=epsg:3785"

  END

…





I’m assuming that -20037508 -20037508 20037508 20037508 is correct extent
for the whole world map, since Google uses that and they also have Mercator
projection.



Thanks for your help.



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