Re: [mapserver-users] problem with INTERSECTS query from OpenLayers to mapserver

2013-09-13 Thread Yves Jacolin (Free)
Sally,

Le vendredi 13 septembre 2013 11:53:33 Sally Buechel a écrit :
> [..]
> I'm using mapserver 6.2.1 and the current OpenLayers.js.  I can run the
> wfs.map file using shp2img and get a valid response from mapserver, I can
> run non-spatial filters using my OpenLayers WFS call to mapserver.  The POST
> request sent to mapserver with the spatial query looks fine, but I simply
> get  the not very helpful "premature end of script headers : mapserv" in
> response.  The spatial input is a hand-drawn polygon in OpenLayers and the
> intersection at the mapserver end is a postgis table containing a polygon
> field.  The table is large, but a spatial restriction should always yield a
> manageable number of records.  Without a spatial restriction in the filter,
> I've noticed that mapserver tried to load all the data, so have currently
> restricted it to 100 records for testing/debugging.  I'm assuming once I
> get the spatial filter that this will restrict the number of records
> retrieved on the server side.  I have some assumptions, but as I said I've
> not been able to find a working example of this online, maybe because its
> too simple and everyone but me has it working?
> 
> 
> 
> Should what I'm trying to do work or am I just beating my head against the
> wall?  It doesn't seem that this should be so hard.
Before beating your head against the wall, which can hurt you, try to enable 
debug mode in MapServer and have a look to the log. MapServer can give 
interesting information about what he is doing before the "premature end of 
script".

Hope it helps you.

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


Re: [mapserver-users] [Cluster:FeatureCount] is string?

2013-09-13 Thread Lime, Steve D (MNIT)
Really need Tamas to comment on the clustering specifics but to clarify, 
MapServer stores all attributes as strings. Then they are cast as necessary 
when referenced in an expression. 

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jörg Thomsen
Sent: Friday, September 13, 2013 6:25 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] [Cluster:FeatureCount] is string?

Hi,

I wonder if the [Cluster:FeatureCount] value is a string?
I have a mapfile with three classes like

> EXPRESSION "1"
> EXPRESSION (("[Cluster:FeatureCount]" > "1") and 
> ("[Cluster:FeatureCount]" < "51") EXPRESSION ("[Cluster:FeatureCount]" 
> > "50" )

As result I get mixed symbols, each feature that has a cluster:featurecount 
beginning with 2,3,4,or 5 is symbololized with the styel of the 2nd class (even 
101 or 455) and each feature that has a cluster:featurecount beginning with 
6,7,8,or 9 is symbololized with the styel of the 3. class (even 7 or 9).
An Expression like
> EXPRESSION ("[Cluster:FeatureCount]" > 50 )
(no quotes) does not work.

For a better understanding, here is the resulting image:
http://mapmedia.de/tmp/mapserv.png)

Furthermore it is not posible to calculate with it, sth. like
> SIZE [Cluster:FeatureCount] / 10
does not work.

Thats why I think mapserver treats featurecount as string.
Or am I doing it wrong?

Jörg


-- 

~~~
Aufwind durch Wissen!

Qualifizierte Open Source Schulungen bei der http://www.foss-akademie.de/ 
~~~

_

MapMedia
Kartographie und raumbezogene Informationssysteme

Gillweg 3, 14193 Berlin
fon: +49 30 89 06 82-70
fax: +49 30 89 09 53-21
mail: j...@mapmedia.de
net:  www.mapmedia.de
_


Geschäftsführer: G. v. Tschirnhaus, J. Thomsen, P. Stamm Registergericht, 
Berlin - Amtsgericht Charlottenburg, HRB 89625, Umsatzsteuer-Identnummer: DE 
813794062 ___
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] Labels stopped working after update

2013-09-13 Thread Lime, Steve D (MNIT)
Depends on how big of a jump in version you made. 6.2 now features multiple 
labels per class. I think you need to do something like:

$label  = $oAirportsClass->getLabel(0);
$label->color->setRGB(0,0,0);
$label->set("font", "verdana");
$label->set("size", MS_LARGE);
$label->set("position", MS_AUTO);
$label->set("antialias", MS_TRUE);

Steve

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Michael McInnis
Sent: Friday, September 13, 2013 4:20 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Labels stopped working after update

This was working yesterday but I applied an update for ubuntu 12.04 today that 
had some mapserver items
and now my php file only works if I comment out the labels portion below so I 
get points without labels.

Did something change recently related to php mapscript labels?

// Layer 3 airports

// Point Symbol
$nSymbolId = ms_newSymbolObj($oMap, "circle");
$oSymbol = $oMap->getsymbolobjectbyid($nSymbolId);
$oSymbol->set("type", MS_SYMBOL_ELLIPSE);
$oSymbol->set("filled", MS_TRUE);
$aPoints[0] = 1;
$aPoints[1] = 1;
$oSymbol->setpoints($aPoints);

// Layer
$oLayerAirports = ms_newLayerObj($oMap);
$oLayerAirports->setConnectionType(MS_POSTGIS);
$oLayerAirports->set("name", "airports");
$oLayerAirports->set("type", MS_LAYER_POINT); # This is crucial
$oLayerAirports->set("status", MS_DEFAULT);
$oLayerAirports->set("labelitem", "icao");
//$oLayerAirports->set("classitem", "MyAirports");
$oLayerAirports->set("connection", "host= port= dbname= user= 
password=");
$oLayerAirports->set("data", "geom From (select a.icao, geom From airports a 
left join airportdata e on a.icao = e.icao where e.icao Is Not Null) as 
subquery using unique icao using srid=4326");

// Class with Labels
$oAirportsClass = ms_newClassObj($oLayerAirports);
$oAirportsClass->set("name","MyAirports");

// Style
$airportsStyle = ms_newStyleObj($oAirportsClass);
$airportsStyle->color->setRGB(255, 22, 22);
$airportsStyle->set("symbolname", "circle");
$airportsStyle->set("size", "3");

/* ONLY WORKS NOW IF THIS IS COMMENTED
// Label
$oAirportsClass->label->color->setRGB(0,0,0);
$oAirportsClass->label->set("font", "verdana");
$oAirportsClass->label->set("size", MS_LARGE);
$oAirportsClass->label->set("position", MS_AUTO);
$oAirportsClass->label->set("antialias", MS_TRUE);
*/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Labels stopped working after update

2013-09-13 Thread Michael McInnis
This was working yesterday but I applied an update for ubuntu 12.04 today that 
had some mapserver items
and now my php file only works if I comment out the labels portion below so I 
get points without labels.

Did something change recently related to php mapscript labels?

// Layer 3 airports

// Point Symbol
$nSymbolId = ms_newSymbolObj($oMap, "circle");
$oSymbol = $oMap->getsymbolobjectbyid($nSymbolId);
$oSymbol->set("type", MS_SYMBOL_ELLIPSE);
$oSymbol->set("filled", MS_TRUE);
$aPoints[0] = 1;
$aPoints[1] = 1;
$oSymbol->setpoints($aPoints);

// Layer
$oLayerAirports = ms_newLayerObj($oMap);
$oLayerAirports->setConnectionType(MS_POSTGIS);
$oLayerAirports->set("name", "airports");
$oLayerAirports->set("type", MS_LAYER_POINT); # This is crucial
$oLayerAirports->set("status", MS_DEFAULT);
$oLayerAirports->set("labelitem", "icao");
//$oLayerAirports->set("classitem", "MyAirports");
$oLayerAirports->set("connection", "host= port= dbname= user= 
password=");
$oLayerAirports->set("data", "geom From (select a.icao, geom From airports a 
left join airportdata e on a.icao = e.icao where e.icao Is Not Null) as 
subquery using unique icao using srid=4326"); 

// Class with Labels
$oAirportsClass = ms_newClassObj($oLayerAirports);
$oAirportsClass->set("name","MyAirports");

// Style
$airportsStyle = ms_newStyleObj($oAirportsClass);
$airportsStyle->color->setRGB(255, 22, 22);
$airportsStyle->set("symbolname", "circle");
$airportsStyle->set("size", "3");

/* ONLY WORKS NOW IF THIS IS COMMENTED
// Label
$oAirportsClass->label->color->setRGB(0,0,0);
$oAirportsClass->label->set("font", "verdana");
$oAirportsClass->label->set("size", MS_LARGE);
$oAirportsClass->label->set("position", MS_AUTO);
$oAirportsClass->label->set("antialias", MS_TRUE);
*/

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

[mapserver-users] FW: problem with INTERSECTS query from OpenLayers to mapserver

2013-09-13 Thread Fawcett, David (MNIT)


From: Sally Buechel [mailto:swbuec...@comcast.net]
Sent: Friday, September 13, 2013 3:39 PM
To: Fawcett, David (MNIT)
Subject: RE: [mapserver-users] problem with INTERSECTS query from OpenLayers to 
mapserver

Here are the POST queries output by OpenLayers and the wfs part of the mapfile 
its using if that helps (am also interested in confirming just that this 
general concept works, that someone is actually doing it successfully):


Example of the POST request for a non-spatial query which works

http://www.opengis.net/wfs"; service="WFS" 
version="1.0.0" maxFeatures="50" xsi:schemaLocation="http://www.opengis.net/wfs 
http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

http://www.opengis.net/ogc";>


attr2
5


attr3
78008






Example of the POST for the spatial INTERSECTS query which fails:

http://www.opengis.net/wfs"; service="WFS" 
version="1.0.0" maxFeatures="50" xsi:schemaLocation="http://www.opengis.net/wfs 
http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

http://www.opengis.net/ogc";>


attr1
http://www.opengis.net/gml"; srsName="EPSG:4326">


-166.8375,69.723751831055 
-168.75,63.311251831055 -166.3875,60.273751831055 -160.3125,57.573751831055 
-155.5875,59.036251831055 -153.5625,62.748751831055 -156.6,66.911251831055 
-166.8375,69.723751831055





attr2
5






Response from failed Spatial query:



500 Internal Server Error

Internal Server Error
The server encountered an internal error or
misconfiguration and was unable to complete
your request.
Please contact the server administrator,
root@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.
More information about this error may be available
in the server error log.

Apache Server at localhost Port 80


Apache error log:
[Fri Sep 13 01:49:34 2013] [error] [client 127.0.0.1] Premature end of script 
headers: mapserv, referer: http://localhost/testol6_7w.html

WFS part of Mapfile (note this mapfile works using shp2img when a FILTER is 
added to it):

MAP


#
# Set up WFS layer for feeding data to OpenLayers front-end
LAYER
   NAME "mytable"
   TYPE Polygon
   STATUS ON
   DUMP true #added 8/13 can't remember if needed...
   CONNECTIONTYPE postgis
   CONNECTION "host='localhost' dbname='test' user='user1' port=5432"
   PROCESSING "CLOSE_CONNECTION=DEFER"
   # need geometry, doesn't work for geography trying to cast it
   # this worked for mapserver
   DATA "attr1 from mytable USING UNIQUE gid USING srid=4326"
   METADATA
 "wfs_title"   "My_WFS"
 "wfs_version" "1.0.0"
 "wfs_extent" "-180.00 -89.99 180.00 89.99"
 "gml_include_items" "all"
 "gml_featureid" "gid"
 "wfs_enable_request"  "*"
   END
   CLASS
  NAME 'Attr1'
  STYLE
  COLOR -1 -1 -1
  OUTLINECOLOR 0 255 0
  END
   END # end attr1 class
   PROJECTION
   "init=epsg:4326"
   END
END #query layer

END #end map


From: Fawcett, David (MNIT) [mailto:david.fawc...@state.mn.us]
Sent: Friday, September 13, 2013 12:15 PM
To: Sally Buechel; 
mapserver-users@lists.osgeo.org
Subject: RE: [mapserver-users] problem with INTERSECTS query from OpenLayers to 
mapserver

Sally,

To make it easier for people to help you figure this out, I would suggest 
including the request string produced by OpenLayers and your mapfile text.

David.

From: 
mapserver-users-boun...@lists.osgeo.org
 
[mailto:mapserver-users-boun...@lists.osgeo.org]
 On Behalf Of Sally Buechel
Sent: Friday, September 13, 2013 1:54 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] problem with INTERSECTS query from OpenLayers to 
mapserver

Am hoping someone can help or at least point me in the right direction 
regarding a problem I'm having trying to send a spatial filter produced in 
OpenLayers to mapserver.  What I'm trying to do is so basic, I'm sure that many 
have done this, yet I've been unsuccessful.  I thought this would be easy.  
With much searching I have found similar questions, but nothing actually 
answering or showing a working example of this.

I'm using mapserver 6.2.1 and the current OpenLayers.js.  I can run the wfs.map 
file using shp2img and get a valid response from mapserver, I can run 
non-spatial filters using my OpenLayers WFS call to mapserver.  The POST 
request sent to mapserver with the spatial query looks fine, but I simply get  
the not very helpful "premature end of script headers : mapserv" in response.  
The spatial input is a hand-drawn polygon in OpenLayers and the intersection at 

Re: [mapserver-users] problem with INTERSECTS query from OpenLayers to mapserver

2013-09-13 Thread Fawcett, David (MNIT)
Sally,

To make it easier for people to help you figure this out, I would suggest 
including the request string produced by OpenLayers and your mapfile text.

David.

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Sally Buechel
Sent: Friday, September 13, 2013 1:54 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] problem with INTERSECTS query from OpenLayers to 
mapserver

Am hoping someone can help or at least point me in the right direction 
regarding a problem I'm having trying to send a spatial filter produced in 
OpenLayers to mapserver.  What I'm trying to do is so basic, I'm sure that many 
have done this, yet I've been unsuccessful.  I thought this would be easy.  
With much searching I have found similar questions, but nothing actually 
answering or showing a working example of this.

I'm using mapserver 6.2.1 and the current OpenLayers.js.  I can run the wfs.map 
file using shp2img and get a valid response from mapserver, I can run 
non-spatial filters using my OpenLayers WFS call to mapserver.  The POST 
request sent to mapserver with the spatial query looks fine, but I simply get  
the not very helpful "premature end of script headers : mapserv" in response.  
The spatial input is a hand-drawn polygon in OpenLayers and the intersection at 
the mapserver end is a postgis table containing a polygon field.  The table is 
large, but a spatial restriction should always yield a manageable number of 
records.  Without a spatial restriction in the filter, I've noticed that 
mapserver tried to load all the data, so have currently restricted it to 100 
records for testing/debugging.  I'm assuming once I get the spatial filter that 
this will restrict the number of records retrieved on the server side.  I have 
some assumptions, but as I said I've not been able to find a working example of 
this online, maybe because its too simple and everyone but me has it working?

Should what I'm trying to do work or am I just beating my head against the 
wall?  It doesn't seem that this should be so hard...

Sally


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

[mapserver-users] problem with INTERSECTS query from OpenLayers to mapserver

2013-09-13 Thread Sally Buechel
Am hoping someone can help or at least point me in the right direction
regarding a problem I'm having trying to send a spatial filter produced in
OpenLayers to mapserver.  What I'm trying to do is so basic, I'm sure that
many have done this, yet I've been unsuccessful.  I thought this would be
easy.  With much searching I have found similar questions, but nothing
actually answering or showing a working example of this.

 

I'm using mapserver 6.2.1 and the current OpenLayers.js.  I can run the
wfs.map file using shp2img and get a valid response from mapserver, I can
run non-spatial filters using my OpenLayers WFS call to mapserver.  The POST
request sent to mapserver with the spatial query looks fine, but I simply
get  the not very helpful "premature end of script headers : mapserv" in
response.  The spatial input is a hand-drawn polygon in OpenLayers and the
intersection at the mapserver end is a postgis table containing a polygon
field.  The table is large, but a spatial restriction should always yield a
manageable number of records.  Without a spatial restriction in the filter,
I've noticed that mapserver tried to load all the data, so have currently
restricted it to 100 records for testing/debugging.  I'm assuming once I get
the spatial filter that this will restrict the number of records retrieved
on the server side.  I have some assumptions, but as I said I've not been
able to find a working example of this online, maybe because its too simple
and everyone but me has it working?

 

Should what I'm trying to do work or am I just beating my head against the
wall?  It doesn't seem that this should be so hard.

 

Sally

 

 

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

[mapserver-users] [Cluster:FeatureCount] is string?

2013-09-13 Thread Jörg Thomsen
Hi,

I wonder if the [Cluster:FeatureCount] value is a string?
I have a mapfile with three classes like

> EXPRESSION "1"
> EXPRESSION (("[Cluster:FeatureCount]" > "1") and ("[Cluster:FeatureCount]" < 
> "51")
> EXPRESSION ("[Cluster:FeatureCount]" > "50" )

As result I get mixed symbols, each feature that has a
cluster:featurecount beginning with 2,3,4,or 5 is symbololized with the
styel of the 2nd class (even 101 or 455) and each feature that has a
cluster:featurecount beginning with 6,7,8,or 9 is symbololized with the
styel of the 3. class (even 7 or 9).
An Expression like
> EXPRESSION ("[Cluster:FeatureCount]" > 50 )
(no quotes) does not work.

For a better understanding, here is the resulting image:
http://mapmedia.de/tmp/mapserv.png)

Furthermore it is not posible to calculate with it, sth. like
> SIZE [Cluster:FeatureCount] / 10
does not work.

Thats why I think mapserver treats featurecount as string.
Or am I doing it wrong?

Jörg


-- 

~~~
Aufwind durch Wissen!

Qualifizierte Open Source Schulungen bei der
http://www.foss-akademie.de/
~~~

_

MapMedia
Kartographie und raumbezogene Informationssysteme

Gillweg 3, 14193 Berlin
fon: +49 30 89 06 82-70
fax: +49 30 89 09 53-21
mail: j...@mapmedia.de
net:  www.mapmedia.de
_


Geschäftsführer: G. v. Tschirnhaus, J. Thomsen, P. Stamm
Registergericht, Berlin - Amtsgericht Charlottenburg,
HRB 89625, Umsatzsteuer-Identnummer: DE 813794062
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users