#MAPSERVER IRC Log - 2009-11-09

For logs after Feb 3, 2007, all times are GMT-8. Prior logs are GMT-9.
Back to Logs
01:59:05 Peut: hey, i'm trying to use a parameter in my mapfile like this: FILTER ( "g.geometry_id = bp.geometry_id AND bp.id = [bpid]" )
01:59:22 Peut: but it returns: ERROR: column "bpid" does not exist
02:01:41 strk: what's that bpid supposed to come from ?
02:01:52 strk: cgi query string ?
02:02:29 Peut: jep
02:03:01 strk: I guess mapserver is not replacing it as being inside the quotes
02:03:11 strk: as that ERROR looks like coming from postgresql
02:03:26 Peut: i figured
02:03:43 Peut: the example in the mapfile documentation isn't really helping tho
02:03:50 Peut: FILTER ( "multimedia='[multimedia]' and seats >= [nseats] and Sound= '[sound]' )
02:04:06 strk: oh
02:04:15 strk: so maybe mapserver DOES replace
02:04:19 Peut: doesn't even look right, since it starts with a double quote, and doesn't end with one
02:04:21 strk: only you need the single-quote
02:04:35 strk: yeah, but literals are in single-quote, as required by pgsql
02:04:41 strk: try '[bpid]'
02:04:47 Peut: tried that, same result
02:04:48 strk: and I bet you'll be fine
02:05:03 strk: can't be same result
02:05:10 Peut: yes it can
02:05:13 strk: FILTER ( "g.geometry_id = bp.geometry_id AND bp.id = '[bpid]'" )
02:05:14 Peut: since that id is an integer
02:05:23 Peut: it doesn't matter if you use quotes or not
02:05:27 Peut: so the error i get is the same
02:05:36 Peut: only the query is slightly different
02:05:46 strk: the only reason for you to get the same error is if mapserver strips the single quote too
02:06:10 Peut: it doesn't strip the single quote, it just refuses to replace [bpid]
02:06:37 strk: ah, now I get it
02:06:48 strk: the ERROR might come from a query that mapserver does in order to do the replacement
02:07:00 strk: so mapserver is taking bpid as a table attribute ?
02:07:10 : * strk is just guessing, doesn't konw the internals of mapserver
02:07:15 Peut: = )
02:07:43 Peut: well, i have the idea that mapserver just does not replace it, and postgresql comes up with the error
02:07:47 strk: you should check the postgresql logs enabling statements logging
02:07:50 Peut: i'm quite sure about that actually
02:07:59 Peut: because mapserver ouputs the query it sent to postgresql
02:08:11 strk: if it didn't replace it mapserver would get '[bpid]' as a litteral, so would never say "no bpid column exists"
02:08:14 Peut: in which the [bpid] is not replaced
02:08:31 Peut: that's a good point
02:08:46 Peut: yet, the query it outputs looks like this:
02:08:47 Peut: WHERE ( "g.geometry_id = bp.geometry_id AND bp.id = '[bpid]'" )
02:08:59 Peut: still saying that the column does not exist
02:09:03 strk: those double quotes are bogus
02:09:11 strk: if that's what get sent to the backend
02:09:14 strk: drop the double quotes
02:09:15 Peut: true
02:09:32 strk: the bug in the example must be an extra doublequote, not a missing one..
02:09:56 Peut: well, it sounds like a really reasonable explanation, but no succes :(
02:10:06 strk: show the queries sent again
02:10:20 Peut: i'll copy the query that mapserver generates, and try running it in postgresql, see what it comes up with
02:10:34 strk: I've always had trouble with mapserver and quotes, since 2001 when I tried using mixedCased columns ; )
02:10:44 Peut: WHERE ( g.geometry_id = bp.geometry_id AND bp.id = '[bpid]' )
02:10:49 strk: much better
02:11:15 strk: now you need to figure how bpid should be replaced. first of all make sure bpid=xx gets passed by query string
02:11:22 strk: then try w/out the single quotes
02:11:26 Peut: i'm going after that
02:11:42 Peut: thanks so far!
03:00:04 Peut: strk, i seem to have fixed it : )
03:00:21 Peut: FILTER ( g.geometry_id = bp.geometry_id AND bp.id = '%bpid%' )
04:29:14 strk: Peut: oh, so [] was plan wrong ? or version specific ?
04:30:02 Peut: i think the version was not the issue, the example seemed wrong
04:30:19 Peut: i found the %% on a mailinglist and decided to give it a try, since i had no clue what to do otherwise
05:35:59 CIA-6: aboudreault * r9533 /trunk/mapserver/ ( HISTORY.TXT mapfile.c ): Fixed when saving a map, layer->transform isn't written properly in all cases. ( #3198 )
06:05:37 strk: is it intentional for the mapserv cgi to NOT send Content-Length ?
06:05:43 strk: or, configurable ?
06:13:15 strk: talking about 5.4.2
06:26:55 verse: hallo good people...
06:27:15 verse: am a newbie in mapserver...
06:27:22 jmckenna: well welcome : )
06:27:32 verse: thank you so much..
06:27:41 verse: am looking for help actually
06:28:21 jmckenna: just ask your questions and someone can maybe answer. if you get no answer here you can try the mapserver-users email list
06:28:24 verse: i've been building a web application for my project
06:28:33 verse: ok...
06:29:15 verse: am building a web application in mapserver.. which i have been learning heavily off the workshop demo.
06:29:46 jmckenna: which workshop demo?
06:30:18 verse: the one based on itasca county
06:30:29 verse: so am trying to put in a search funcntion but my head has gone blank.. any help
06:32:16 jmckenna: i don't have your answer...but to get more help you should describe in detail what you mean by "search function", so others can help you
06:32:32 verse: oh okey...
06:34:33 verse: i want a use to type in a name of a feature and is that feature exists, the application should refresh the map, and zoom in to the queried feature
06:35:50 mdev: this sounds interesting, I would be interested to hear how to program that
06:42:37 strk: does GIF output support transparency ?
06:43:19 tbonfort: strk: only a single color, yes
06:43:28 tbonfort: i.e. no antialiasing
06:43:54 strk: the idea is to render overlapping features so to get an automatic thematization based on number of overlaps
06:44:22 strk: I've added TRANSPARENCY 10 in the layer specification but I don't see ( with qgis ) any difference in color
06:44:28 tbonfort: you can do that in single map request with the agg renderer
06:44:40 tbonfort: add opacity 10, but at the STYLE level
06:44:55 strk: yeah, a single map request is what I'm after
06:45:03 strk: STYLE is in LAYER ?
06:45:09 strk: ah, in CLASS
06:45:35 strk: still no transparency
06:45:59 strk: not sure I'm using agg though, how do I tell ?
06:46:01 tbonfort: *agg only*
06:46:02 strk: or set
06:46:22 tbonfort: format=aggpng24 in your request url
06:46:41 strk: can be specified in mapfile ?
06:47:03 tbonfort: yes.
06:52:09 mimetype: how can i provide a user the facility fo search for a feature and zoom in to that feature
06:52:35 strk: argh, no agg configured in
07:29:54 mdev: Good day everyone
07:30:19 mdev: I am wondering how to be able to make a dot with city name label on a map if I know the geo coordinates of the city
07:31:44 mdev: these would be arbitrary cities that would need to be plotted in real time and change around rather than making a one time map file or dbf alteration
07:31:55 mdev: any ideas?
07:33:16 tbonfort: postgis ?
07:34:44 mdev: what if I'm just using shapefiles?
08:35:54 jlivni: mdev: you could use variable substitution to pass in the city ids ( if theres not that many ) or some filter that matches the cities you want to render
08:36:19 jlivni: mdev: probably some other reasonable options, but w/o knowing more about what yuo're trying to do it's hard to say
09:30:11 mdev: jlivni: what if I want user to be able to enter an arbitrary home city and coordinates and then show it on my world map?
10:59:55 mdev: hey, anyone know how to make a lat/long grid on top of a map?
11:03:04 FrankW: mdev: http://mapserver.org/mapfile/grid.html?highlight=grid
11:03:05 sigabrt: Title: GRID MapServer 5.4.2 documentation ( at mapserver.org )
11:03:34 mdev: cool, thanks
11:12:47 CIA-6: assefa * r9534 /trunk/mapserver/ ( HISTORY.TXT mapows.h mapwfs.c ): Parse PropertyName parameter for wfs requests ( #675 )
11:13:41 CIA-6: assefa * r9535 /trunk/msautotest/wxs/expected/wfs_get_feature_propertyname.xml: property name test
11:18:05 CIA-6: assefa * r9536 /trunk/msautotest/wxs/wfs_simple.map: property name test ( #675 )
12:04:07 mdev: Hi, I'm having some trouble understanding how to work with symbols
12:04:17 mdev: I read the tutorials on how to make a symbol
12:04:28 mdev: I'm confused about how to call it and place it somewhere
12:04:47 mdev: lots of examples of defining symbols but haven't seen an example of how to make use of one
12:44:27 leifer: anyone have success enabling fastcgi with the FGS installer?
13:41:38 mdev: Hi, how do you define a point on a map?
14:02:15 jlivni: mdev: lots of ways. please be more specific about yuor setup.
14:02:29 jlivni: if you're using openlayers, i'd suggest using client side vector features
14:02:39 jlivni: or you can define a point in a mapfile
14:02:41 jlivni: or in a shapefile
14:02:43 jlivni: or in postgis
14:02:51 mdev: shapefile with mapfile
14:02:53 mdev: is what im using
14:03:03 mdev: what if I want to put a star on a certain city
14:03:10 mdev: I know the geographic coordinates of it
14:03:24 jlivni: so .. you are not using openlayers, correct?
14:03:31 mdev: correct
14:04:05 jlivni: 09:41 < jlivni> mdev: you could use variable substitution to pass in the city ids ( if theres not that many ) or some filter that matches the cities you want to render
14:04:41 jlivni: so, based on waht you just said. it sounds like you want to just display/hight one city. since 1 == not many, that above comment of mine might apply?
14:05:05 mdev: in the long run I want to have many cities
14:05:13 mdev: I'm just experimenting with the system now
14:05:19 mdev: so I'm just trying to do one for starters
14:05:40 mdev: what If I want users on a website to be able to input the coordinates of their hometown and that to add a point to map of all visitors?
14:05:51 mdev: on a world map
14:06:16 mdev: so it may be some little village no one has heard of but if they entered the name of it and coordinates, it should be able to show
14:06:44 mdev: how to make that happen with shapefile, mapfile, and mapscript... I'm starting to figure out shape and map file... mapscript I will work on later
14:07:43 jlivni: generally when you have users store data for later display on a website, you might use a database
14:07:53 jlivni: in which case you could query the database for the point locations and render with mapserver
14:07:58 jlivni: if it were me, and you just want to use a shapefile
14:08:03 jlivni: then i would use featureserver as middleware
14:08:21 mdev: what is featureserver/middleware?
14:08:34 mdev: yeah, I would store in mysql database along with other user data
14:08:35 jlivni: and then when a user enters something in the db, i wuold post an update to yuor featureserver layer ( which has the shapefile as a datasource ), and update the shapefile so the "highlight" column = 1, or whatever
14:08:53 jlivni: then your mapfile would just have a layer that rendered all cities where highlight=1
14:09:11 jlivni: ok .. so now you are adding more info all the time. first it was just a point. then lots of points. now there's a database : )
14:09:15 mdev: that's assuming you have DB of cities ahead of time though
14:09:22 jlivni: its really hard to suggest advice when you dont actually say upfront what you are doing : )
14:09:41 mdev: ok... letting users enter coordinates of their hometown and name of it
14:09:49 mdev: so that little villages could be input
14:09:55 mdev: that might not be in a world DB
14:10:08 mdev: so I have database with coordinates of user entered locations
14:10:15 mdev: how do I get them on my shapefile based map?
14:10:23 mdev: am I making it clear now?
14:10:33 jlivni: slightly more clear.
14:10:36 jlivni: so now you have two datasources
14:10:37 jlivni: a shapefile
14:10:38 jlivni: and a db
14:10:43 jlivni: and you want to display both on a map
14:10:47 mdev: exactly
14:11:11 jlivni: easiest is use postgis instead of mysql, and then just have mapserver read from postgis to render the db-based points
14:11:37 mdev: I'm really just unfamiliar with postgres and postgis
14:11:38 jlivni: but you can also make a VRT that points to your mysql datasource, and mapserver can render tht
14:11:41 mdev: only have mysql background
14:11:59 jlivni: for example first link on this page: http://www.google.com/search?hl=en&q=mapserver+mapfile+mysql
14:12:03 sigabrt: Title: mapserver mapfile mysql - Google Search ( at www.google.com )
14:13:38 mdev: would it be stupid to just use PHP to update features in a mapfile to add each new point?
14:14:55 mdev: I'm looking at the mysql documentation file... looks understandable. Is this just as good as usnig postgis? Or is something limited by comparison?
14:15:10 mdev: Is there a reason postgis is preferred or is it just a matter of preference?
14:15:10 jlivni: not limited for your use case ( as you described it, anyway )
14:15:50 mdev: ah ok... so at least for this kind of stuff it is interchangeable
14:15:53 mdev: just another means of storing data
14:16:33 mdev: that is very good, cause I already use a lot of mysql DBs... but how do I change lat/long coordinates into xy feature coordinates? Or I don't have to do that?
14:17:02 mdev: I'm sorry for all the stupid questions... I try to make sense of it from the docs but sometimes I get confused
17:47:31 mdev: hey, is there a way to define the value of a label inline on a mapfile?
17:49:43 FrankW: mdev: yes, I'll dig for an example.
17:50:08 FrankW: http://svn.osgeo.org/mapserver/trunk/msautotest/misc/label_pc256.map