[mapserver-users] Transform the style's angle
Hi, I have a shapefile containing an Angle attribute, but it seems that values are interpreted in a different way that I'd expected. My data uses 0⁰ = up and CW, but MS seems to use 0⁰ = right and CCW. I can't find any specific documentation about this, other than http://mapserver.org/mapfile/style.html Is there a way to transform the attribute, for instance: converting from radians to degrees, or adding 90 degrees to it? Something like this: 'ANGLE 360-[ROTATIONFIELD]' to flip the angle would be a nice enhancement. Berend ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] queryByAttributes syntax
Thanks, but that's exactly the kind of thing I'd like to prevent... On 1/24/10, Worth Lutz w...@mindspring.com wrote: I use the layer.connectiontype to adjust my query calls. Connection Types MS_INLINE, MS_SHAPEFILE, MS_TILED_SHAPEFILE, MS_SDE, MS_OGR, MS_TILED_OGR, MS_POSTGIS, MS_WMS, MS_ORACLESPATIAL, MS_WFS, MS_GRATICULE, MS_MYGIS, MS_RASTER, MS_PLUGIN For example: If layer.connectiontype == MS_SHAPEFILE) { layer.queryByAttributes(map, myfield, searchValue, mapscript.MS_MULTIPLE); } else { layer.queryByAttributes(map, null, myfield='searchValue', mapscript.MS_MULTIPLE); } _ From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Berend Veldkamp Sent: Friday, January 22, 2010 7:22 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] queryByAttributes syntax Hi, Where can I find more information about the queryByAttributes() function? I found http://mapserver.org/mapscript/php/index.html#layerobj-class , but it is not very detailed. By trial and error I found that for a PostGIS layer, I should use this syntax: layer.queryByAttributes(map, null, myfield='searchValue', mapscript.MS_MULTIPLE); but for shapefiles, it seems it should be: layer.queryByAttributes(map, myfield, searchValue, mapscript.MS_MULTIPLE); I am trying to write some generic code, but that's hard if there is no single way to call this method. Also, I haven't found a way yet to do a partial match on a shapefile (PostGIS supports 'LIKE') Regards, Berend Veldkamp No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.730 / Virus Database: 271.1.1/2640 - Release Date: 01/23/10 02:33:00 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] queryByAttributes syntax
Thanks, I'll try this. Berend On 1/22/10, Lime, Steve D (DNR) steve.l...@state.mn.us wrote: There's a single way to call the method, it's that you don't always have to supply the query item. The method signature is queryByAttributes (map (mapObj, qitem (string), qstring (string), mode (int)); The qstring is given in a format compatible with the underlying driver. For the database drivers it's basically a where-clause. For others you use MapServer expression syntax. Some expression types (e.g. string matches or regex) require the qitem. To do a partial match you could use a regex, for example: layer.queryByAttributes(map, myfield, /myregex/, mapscript.MS_MULTIPLE); Steve From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Berend Veldkamp Sent: Friday, January 22, 2010 6:22 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] queryByAttributes syntax Hi, Where can I find more information about the queryByAttributes() function? I found http://mapserver.org/mapscript/php/index.html#layerobj-class , but it is not very detailed. By trial and error I found that for a PostGIS layer, I should use this syntax: layer.queryByAttributes(map, null, myfield='searchValue', mapscript.MS_MULTIPLE); but for shapefiles, it seems it should be: layer.queryByAttributes(map, myfield, searchValue, mapscript.MS_MULTIPLE); I am trying to write some generic code, but that's hard if there is no single way to call this method. Also, I haven't found a way yet to do a partial match on a shapefile (PostGIS supports 'LIKE') Regards, Berend Veldkamp ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] queryByAttributes syntax
Hi, Where can I find more information about the queryByAttributes() function? I found http://mapserver.org/mapscript/php/index.html#layerobj-class , but it is not very detailed. By trial and error I found that for a PostGIS layer, I should use this syntax: layer.queryByAttributes(map, null, myfield='searchValue', mapscript.MS_MULTIPLE); but for shapefiles, it seems it should be: layer.queryByAttributes(map, myfield, searchValue, mapscript.MS_MULTIPLE); I am trying to write some generic code, but that's hard if there is no single way to call this method. Also, I haven't found a way yet to do a partial match on a shapefile (PostGIS supports 'LIKE') Regards, Berend Veldkamp ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Joins with MapScript
Hello, Using MapScript C#, is there a way to get to the Join object (does it exist at all)? I can see layerObj.numjoins, but not layerObj.getJoin(i) or something similar. Is there a way to retrieve values from a joined table? Best regards, Berend Veldkamp ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Hatch symbol not properly saved
Hi, I'm using CSharp mapscript to define some symbols, for instance a hatch: symbolObj result = new symbolObj(hatch, null); result.type = (int)MS_SYMBOL_TYPE.MS_SYMBOL_HATCH; map.symbolset.appendSymbol(result); when I call msmap.symbolset.save(), the symbol will have the following definition: SYMBOL NAME hatch END As you can see, TYPE HATCH is missing. Mapserver then says: Symbol of type VECTOR or ELLIPSE has no point data Any ideas? I'm using FWTools 2.3.1 (MS 5.3-dev) Regards, Berend ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] MapScript CSharp save fontset
Hi, Is there a way to save a fontset with CSharp MapScript? It is of course not hard to do that manually, but it would be nice to have a method similar to symbolset.save(). And another thing: After I save the fontset, I can't seem to set the mapObj.fontset.filename, because it claims to be a read-only property. Regards, Berend ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] CSharp Mapscript regional settings
Hi, I have written an application based on CSharp MapScript that generates mapfiles. When I save them, decimal values are written in the format specified in my regional settings (In the Netherlands that is a comma , instead of a period .). So I end up with: EXTENT -336022,285241803 -144935,85554567 383601,953193977 550266,745839123 Which should be: EXTENT -336022.285241803 -144935.85554567 383601.953193977 550266.745839123 I successfully set the decimal separator in my code to a period like this, but apparently MapScript doesn't use that value: System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; When I change the value in the Control Panel, and then run the application, it works perfect. However I would like to be able to run it independent of any system settings. Regards, Berend ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] One-to-many join
Hi, I'm trying to get a one-to-many join in a Postgis db working. One-to-one is working fine, but when I use one-to-many and add a template to the join object, no joined records are returned. In fact, the join template seems to be ignored altogether. Does anyone have a working example? The documentation is limited to One-to-many joins: The more complex variant. If the join type is multiple (one-to-many) the template is replaced by the set of header, template file and footer specified in the mapfile., and I'm not exactly sure what this means. Do I need to specify where the many template(s) are inserted into the main template? Here's the layer definition from my mapfile, and the templates: LAYER NAME Provincies TYPE polygon CONNECTIONTYPE postgis CONNECTION host=localhost dbname=gisdb user=user password=pass DATA the_geom from nl97 STATUS on CLASS COLOR 0 128 128 OUTLINECOLOR 0 64 64 END METADATA wms_title Provincies wms_srs EPSG:28992 END JOIN NAME test CONNECTION host=localhost dbname=gisdb user=user password=pass CONNECTIONTYPE ogr TABLE lookup FROM provnr TO provnr TYPE one-to-many TEMPLATE join.html END HEADER header.html FOOTER footer.html TEMPLATE provincies.html END provincies.html: tr tdNaam: [provincie]/td tdInwoners: [inwoners]/td tdInkomen: [inkomen]/td tdProvcode: [provnr]/td /tr join.html: !-- Join starts here -- trtdJoined field: [joined]/td/tr !-- Join ends here -- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] One-to-many join
Hello Wim, As happens often, one thinks of the answer right after clicking Send... In the layer's template, add a tag named [join_test], i.e. the literal text join, an underscore, and the name of the join in the mapfile. This is the place where zero or more join templates will be inserted. In the join's template, add one or more tags named [test_joined], i.e. the name of the join, an underscore, and a fieldname. HTH, Berend ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] One-to-many join
BTW, this is MapServer 5.0.2 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users