Re: [mapserver-users] ‘mode=map’ with WMC of dyn amic Layer failing with getString() error

2010-12-13 Thread Wim Vanbelle
I haven't done something similar to what you are trying to do, but at first
glance i see a space standing between vector’  and END.

Did  you try replacing the space with %20?

Just a thought :).

On 11 December 2010 14:49, Jeff McKenna jmcke...@gatewaygeomatics.comwrote:

 On 10-12-10 5:57 PM, myOpenLayersUName wrote:


 And, maybe I have, but now I’m completely stuck. At this point, I have the
 following URL:


 http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/testing/dynamic.mapmap.layer[line]=DATA
 ‘id3/vector’ ENDlayers=linemode=map


 And it is giving me this error: getString(): Symbol definition error.
 Parsing error near (‘):(line 1)


 Quick note:

 That error usually occurs when there is a problem with the syntax of your
 CGI query string.  There are notes on that at:
 http://www.mapserver.org/cgi/controls.html#changing-map-file-parameters-via-a-form-or-a-url

 My experience is that that error doesn't refer to a problem in your
 mapfile, but refers to a problem with the way you are calling mapserv.exe

 Others can hopefully assist you more thoroughly :)

 -jeff

 --
 Jeff McKenna
 MapServer Consulting and Training Services
 http://www.gatewaygeomatics.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


[mapserver-users] MyGIS problem after upgrading 5.2.1 - 5.6.5

2010-12-13 Thread Toomas Aas

Hello!

I have read about MyGIS being deprecated, but I'm hoping for a quick  
fix for this particular problem, which wouldn't involve rewriting a  
lot of queries.


We have a MyGIS layer which stopped working after upgrading Mapserver  
from 5.2.1 to 5.6.5.


The data definition is:
DATA 'geometry from (select * from koht where omavalitsus_id=-1)  
feature, koht_bin geometry'


When this layer is accessed from PHP/Mapscript, the following errors  
are logged by PHP:


[MapServer Error]: msQueryByPoint(): No matching record(s) found.
 in source_file.php on line 35
[MapServer Error]: msMYGISLayerGetShapeRandom(): GetShape called on  
MYGIS layer with invalid DB query results.

 in source_file.php on line 35
[MapServer Error]: SELECT feature.id,  
feature.vertices,geometry.WKB_GEOMETRY , fe:  mysql query failed

 in source_file.php on line 35
[MapServer Error]: describe (select:  mysql query failed
 in source_file.php on line 35

I turned on query logging in MySQL, and the log shows that the query  
being sent to MySQL is:


describe (select

which certainly *should* fail.

It seems that if I use a subquery in data definition, DESCRIBE is  
being done only on first word of the subquery. If I replace the  
subquery with a table name, things do not break, but this way I can't  
get the result that I actually need. Can anyone suggest a workaround?


--
Toomas Aas

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


[mapserver-users] problems with relative path in mapfile

2010-12-13 Thread Fco . Javier García Ricca
Hello,

I have an application with mapserver and pmapper. All work fine with
relative path in mapfile but when I try to export the map to geotiff I get
the next error:

[13-Dec-2010 10:37:20] PHP Warning:
readfile(../../../ms_tmp/18c6hpup5imb6vqlva3f950585.tif) [a
href='function.readfile'function.readfile/a]: failed to open stream

If I change the relative path by the fullpath I can export to geotiff
correctly.

Is possible to solve this problem?

Thanks


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


[mapserver-users] Re: ‘mode=map’ with WMC of dynamic Layer failing with getString() error

2010-12-13 Thread myOpenLayersUName

That error usually occurs when there is a problem with the syntax of your
CGI query string.

That is consistent with the post I found at:
http://osgeo-org.1803224.n2.nabble.com/Clarification-on-RFC-44-changes-td2585073.html
which suggests that there may be a problem with the syntax of
“map.layer[line]=DATA ‘id3/vector’ END” in my URL but I don’t know what an
alternative correct way to send this information would be that would work
for both the WMS GetMap requests and the “mode=map” method. I haven’t been
able to get either the WMS GetMap request or the “mode=map” request to work
trying to guess. 

Is there anyone out there who can provide any help with this? I have
reviewed the URL Jeff provided and tried using an underscore rather than the
dot notation but continue to receive the getString() error. Is there some
alternative syntax to try for specifying the DATA parameter that would work
for both a getMap request and using “mode=map”? I don't see anything else in
my URL that could be wrong...but maybe I've been looking at it too long.



Also, to respond to Ophidian, I have tried inserting %20 and '+' in the
blanks and tried replacing the single quotes as shown below. All to no
effect. Thanks for the suggestion though.

http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/testing/dynamic.mapmap.layer[line]=DATA%20%91id3/vector%92%20ENDlayers=linemode=map

-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/mode-map-with-WMC-of-dynamic-Layer-failing-with-getString-error-tp5824774p5831237.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] publish raster with integer pixel values

2010-12-13 Thread Alexander Petkov
Hi Simo:

The table snippet you posted below looks like a histogram (ie how many
pixels for each value), and in its form is not sufficient for a map
display. Do you also have the geolocations for these pixels?

Alex

On Fri, Dec 10, 2010 at 2:26 AM, Simone Frigerio
simone.frige...@univie.ac.at wrote:
  Hi all!
 I have some raster (e.g. DTM) to publish but I have problem on pixel value.

 e.g.: an img raster file  classified. The attribute  table could be as
 following:

 OID    VALUE    COUNT
 0        944           3
 1        945           7
 ...                     
 2014  3008        4

 Briefly: first record copes with an elevation on 944 m present in 3 pixels.
 Last record has an elevation of 3008 m in 4 pixels.
 How can I visualized continuously this layer with all his 2014 values? How
 can I define automatically all these classes?
 Can you suggest me an idea?

 Thanks!
 Simo
 ___
 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] Re: ‘mode=map’ with WMC of dynamic Layer - Solved!

2010-12-13 Thread myOpenLayersUName

After preparing my last post, I noticed the strange numbers (really the fact
that I got two different ones) for the single quotes when I encoded the URL
(%91 and %92) that was failing:

http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/testing/dynamic.mapmap.layer[line]=DATA%20%91id3/vector%92%20ENDlayers=linemode=map
 


And, after looking closer, I realized there were smart rather than regular
(as in %27) single quotes. Once I changed them the following URL worked fine
in the browser after all:

http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/testing/dynamic.mapmap.layer[line]=DATA
'id3/vector' ENDlayers=linemode=map



So, I thought, my attempts at trying to figure out what the bigger problem I
was having had failed to this point. I did not have smart quotes in the
WMC for that Layer definition (as shown in the original post) but I was
unable to create an output image with it. 


Then, I thought of Obsidian's suggestion and changed the LayerListLayer
definition as follows (see the blanks replaced with %20 in the
OnlineResource values): 

Layer queryable=0 hidden=0 clid=id3vector
  Server service=OGC:WMS version=1.1.1 title=Id3 Vector
OnlineResource xlink:type=simple
xlink:href=http://domain/ogc/printVecWms_en?map.layer[line]=DATA%20'id3/vector'%20END/
  /Server
  Nameline/Name
  Titleid3 vector/Title
  SRSEPSG:42304/SRS
  FormatList
Format current=1image/png/Format
  /FormatList
  StyleList
Style current=1
  Namedefault/Name
  Titledefault/Title
  LegendURL format=image/png width=47 height=294
 OnlineResource xlink:type=simple
xlink:href=http://domain/ogc/printVecWms_en?version=1.1.1service=WMSrequest=GetLegendGraphicmap.layer[line]=DATA%20'id3/vector'%20ENDlayer=lineformat=image/pngSTYLE=default/
  /LegendURL
/Style
  /StyleList
  Extension
ol:maxExtent minx=-2903297 miny=-789911 maxx=3431059
maxy=3959683/
ol:transparenttrue/ol:transparent
ol:isBaseLayerfalse/ol:isBaseLayer
ol:displayInLayerSwitchertrue/ol:displayInLayerSwitcher
  /Extension
/Layer 


And, low and behold, I have an image with the dynamic shapefile's contents
included. Yay!!!

Thank you, Jeff and Obsidian, for your pointers towards things to look more
closely at. 
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/mode-map-with-WMC-of-dynamic-Layer-failing-with-getString-error-tp5824774p5831449.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Boundary overlay shift

2010-12-13 Thread Varun saraf
Hello,

I have been using Mapserver with Tilecache and Google maps to display
polygon boundary overlays for some time now. However, the users
complain that the overlay is not accurate if they zoom in to the map
(zoom level 14 onwards). Is this a problem with the projection scheme
being used? I think my data is in epsg 4326 format. What projection
scheme does google maps use? Its strange that everything looks fine at
the higher levels but when I zoom in beyond level 13, the boundary
gets misaligned though the shape of the boundaries is accurate. Has
anyone solved this problem? If yes, it would be great if you can point
me in the correct direction.

BTW, I use ms4w for windows and the GtileOverlay method with tilecache
to render the boundary overlays.

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


Re: [mapserver-users] MyGIS problem after upgrading 5.2.1 - 5.6.5

2010-12-13 Thread Toomas Aas

E, 13 dets  2010 kirjutas Toomas Aas toomas@raad.tartu.ee:



We have a MyGIS layer which stopped working after upgrading  
Mapserver from 5.2.1 to 5.6.5.




Moving back to 5.4.2 (which as I understand is the earliest version  
supporting PHP 5.3) solved the problem for now, until we can re-work  
our application.


--
Toomas Aas

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


Re: [mapserver-users] publish raster with integer pixel values

2010-12-13 Thread Alexander Petkov
On Mon, Dec 13, 2010 at 11:16 AM, Simone Frigerio
simone.frige...@univie.ac.at wrote:
 Yes of course Alex,
 sorry I didn't include in the example. I can generate pixel geolocation,
 of course.
 Suggestion?

You can use classes in your map file's layer declaration, where values
within a certain range are given a color range, as in below:
==
...
CLASS
  NAME [-200..-175]
  EXPRESSION ([pixel] -255 AND [pixel] =-175)
  KEYIMAGE class2.gif
  STYLE
  COLORRANGE 128 0 0 192 64 0
  DATARANGE -255 -175
  OUTLINECOLOR 0 0 0
END
  END

  CLASS
  NAME [-175..-100]
  EXPRESSION ([pixel] =-175 AND [pixel] =-100)
  KEYIMAGE class3.gif
  STYLE
  COLORRANGE 192 64 0 255 150 0
  DATARANGE -175 -100
  OUTLINECOLOR 0 0 0
END
  END
...
===

In the example above, values start from -200, but you can adapt it to
your case for values b/n 0 and 3008. class2.gif, class3.gif, etc are
small images created by hand to show up in the legend with the color
gradient.

Using COLORRANGE will cut down significantly on the number of CLASS
objects declared for your LAYER.

Does this help? I hope I understand your problem correctly...

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


RE: [mapserver-users] get the closest feature in a point query

2010-12-13 Thread Lime, Steve D (DNR)
For mode=query (e.g. a standard point query) the closet feature is found. A 
layer's tolerance is used to select candidate features and then distances are 
computed for each candidate feature. If no feature is found in one layer then 
the process moves to the next layer. The computed distance doesn't persist 
across layers...

Does this make sense or are you seeing something different?

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Andy Colson
Sent: Thursday, December 09, 2010 11:17 AM
To: Mark Volz
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] get the closest feature in a point query

On 12/9/2010 11:07 AM, Mark Volz wrote:
 Hello,

 I know we can use tolerance/ toleranceusnitsto control the sensitivity
 forspatial queries. Is there a way tofurthercontrol queries by getting
 the nearest feature, or the first feature found?

 Thanks

 Mark Volz

 GIS Specialist

 Lyon County, MN



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

Not sure if this'll help, but I use PostGIS for that, here is the query 
I use to find the nearest road from a click point:


select roads, distance(the_geom, GeomFromText(point, -1)) as distance
from cadastralLine, ST_Buffer(GeomFromText(point, -1), 100) as g
where the_geom  g and roads is not null
order by distance
limit 1

point here is a text variable, like: POINT(1 100)

-Andy
___
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