RE: [mapserver-users] C# query method
Hi Steve/Tamas Until now I was under the impression that I can't do a query by attributes and shape in a single call. Hence I had written my code first to execute query by shape and append those results to query expression as IN clause and invoke queryByAttributes. While doing some testing on oracle spatial layer, I found that queryByShape is actually honoring filter expression on the layer. Since this will be executed as a single call, I want to modify my code to call only queryByShape and set the query expression to filter. This will improve overall time taken for the query execution but I want to make sure that his behavior is consistent across all data sets (providers). Thanks Murty From: Lime, Steve D (DNR) [mailto:steve.l...@state.mn.us] Sent: Friday, January 29, 2010 2:27 PM To: Tamas Szekeres; Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] C# query method The one notable exception is the queryByAttribute method. It definitely ignores the existing filter. Steve From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Tamas Szekeres Sent: Friday, January 29, 2010 12:32 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] C# query method Murty, It's up to the driver how the filter is actually used, but the query methods should normally use the specified filter setting to limit the shapes retrieved from the data source. Best regards, Tamas 2010/1/29 Murty Maganti Hi I want to know if a layer's filter (set using layerObj.setFilter method) is used while executing any of the query methods on a layer like queryByShape, queryByAttributes, queryByRect etc. Thanks Murty ___ 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] C# query method
Hi I want to know if a layer's filter (set using layerObj.setFilter method) is used while executing any of the query methods on a layer like queryByShape, queryByAttributes, queryByRect etc. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Cascading with virtual earth
Hi I am cascading a map from map server on top of virtual earth. I want to set the transparency for map server layer and see the features from virtual earth map below. I tired the following but did not work. Is it possible to do it in map file and what is the syntax? (I am using C# map script to generate the map image and open layers to cascade with virtual earth) OUTPUTFORMAT NAME "AGG" DRIVER "AGG/PNG" EXTENSION "png" IMAGEMODE "RGBA" TRANSPARENT TRUE END LAYER NAME "abcd" OPACITY 25 - - - - END Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Cascading on to virtual earth
Hi I am cascading a map from map server on top of virtual earth. I want to set the transparency for map server layer and see the features from virtual earth map below. I tired the following but did not work. Is it possible to do it in map file and what is the syntax? (I am using C# map script to generate the map image and cascade) Thanks Murty OUTPUTFORMAT NAME "AGG" DRIVER "AGG/PNG" EXTENSION "png" IMAGEMODE "RGBA" TRANSPARENT TRUE END LAYER NAME "abcd" OPACITY 25 - - - - END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Oracle spatial issue
Hi All, I am using some oracle spatial layers, getting this error while refreshing map for some of the layers Image handling error. Failed to draw layer named 'Landformarea'.;msOracleSpatialLayerWhichShapes(): OracleSpatial error. Error: ORA-01002: fetch out of sequence . Query statement: SELECT OBJECTID_1, SURFACETYPE, GEOM FROM ALAIN.LANDFORMAREA WHERE SDO_FILTER( GEOM, MDSYS.SDO_GEOMETRY(2003, 32640, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(363076 .413,2679613.84,364442.736,2680338.91) ),'querytype=window') = 'TRUE' . Check your data statement. When does this 'fetch out of sequence' error is thrown by oracle. How can I resolve the issue. Appreciate help. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] layer.whichShapes() in C# mapscript
Hi Tamas, Thanks for your response. I don't have the latest. But, as a workaround, I have done the same fix in my code i.e. backup the connection type and change the connection type to MS_INLINE just before calling whichShapes(). After the change, it is retrieving the attribute values. Appreciate your help. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Wednesday, August 05, 2009 5:11 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] layer.whichShapes() in C# mapscript I suspect you've run into the following issue here: http://trac.osgeo.org/mapserver/ticket/2689 which have already been fixed in: http://trac.osgeo.org/mapserver/changeset/9060 http://trac.osgeo.org/mapserver/changeset/9064 Make sure your version is newer than the changesets above. By using this fix you won't need to call layer.open right after whichShapes in order to retrieve all the items. Best regards, Tamas 2009/8/5 Murty Maganti Hi I am having difficulty performing layerObj.whichShapes() and looping through results. For some datasets like shape files, it requires layerObj.open() call after invoking whichSpaes(). Otherwise, shapeObj.values.length is 0. For ArcSDE, it throws an error on layer.nextShape() if layer.open() is called after invoking whichShapes(). How to write a single piece of code that works with all datasets without checking for layer data source type? Here is the simple test code I am using layerObj layer = m_map.getLayerByName("Roads"); if (layer != null) { layer.template = "abcd"; if (layer.open() == (int)MS_RETURN_VALUE.MS_SUCCESS) { if (layer.whichShapes(m_map.extent) == (int)MS_RETURN_VALUE.MS_SUCCESS) { layer.open(); //Required for shape files. Otherwise, shapeObj.values.length will be zero. shapeObj shape = null; while ((shape = layer.nextShape()) != null) { if (shape.values != null && shape.values.Length > 0) { string value = shape.values[0]; } } } } layer.close(); } Please let me know if some thing wrong with code above. Appreciate any help. Thanks Murty ___ 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] layer.whichShapes() in C# mapscript
Hi I am having difficulty performing layerObj.whichShapes() and looping through results. For some datasets like shape files, it requires layerObj.open() call after invoking whichSpaes(). Otherwise, shapeObj.values.length is 0. For ArcSDE, it throws an error on layer.nextShape() if layer.open() is called after invoking whichShapes(). How to write a single piece of code that works with all datasets without checking for layer data source type? Here is the simple test code I am using layerObj layer = m_map.getLayerByName("Roads"); if (layer != null) { layer.template = "abcd"; if (layer.open() == (int)MS_RETURN_VALUE.MS_SUCCESS) { if (layer.whichShapes(m_map.extent) == (int)MS_RETURN_VALUE.MS_SUCCESS) { layer.open(); //Required for shape files. Otherwise, shapeObj.values.length will be zero. shapeObj shape = null; while ((shape = layer.nextShape()) != null) { if (shape.values != null && shape.values.Length > 0) { string value = shape.values[0]; } } } } layer.close(); } Please let me know if some thing wrong with code above. Appreciate any help. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] C# map script help
Hi It is resolved now. I had an earlier version of the same DLL in system32 folder, though not sure how it ended up there. After removing it, it works fine. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Wednesday, June 03, 2009 6:32 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] C# map script help Strange indeed. Are you sure the Visual Studio runtime is installed on both of the machines? Tamas 2009/6/3 Murty Maganti Hi I am trying to load mapObj using C# mapscript and I get the following error. "The procedure entry point ?o...@cncsjp2file@@UAE?AVCNCSError@@pa...@z could not be located in the dynamic link library libecwj2.dll" The above referenced Dll is present in the executable folder of my application. This is happening on a XP machine. Same application works fine on other XP machines. Appreciate any help. Thanks Murty ___ 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] C# map script help
Hi I am trying to load mapObj using C# mapscript and I get the following error. "The procedure entry point ?o...@cncsjp2file@@UAE?AVCNCSError@@pa...@z could not be located in the dynamic link library libecwj2.dll" The above referenced Dll is present in the executable folder of my application. This is happening on a XP machine. Same application works fine on other XP machines. Appreciate any help. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Version 5.4 binaries
Hi Where can I get map server 5.4 binaries. MS4W website has December 2, 2008 release which appears to be version 5.2. MS4W link that I use to download binaries http://maptools.org/ms4w/index.phtml?page=downloads.html Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] C# connectiontype issue
WMS layers also have type as 'Raster'. But I think I can still try If(layer type == Raster && connection type != WMS), hoping only WMS and true raster have type as 'Raster'. Thanks Murty -Original Message- From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] Sent: Monday, April 27, 2009 4:41 PM To: mapserver-users@lists.osgeo.org; Murty Maganti Subject: Re: [mapserver-users] C# connectiontype issue Nothing wrong with the layer def. Why not just look at the layer type first in your application. Rasters will always have TYPE RASTER. Everything else, is vector I'm pretty sure. Steve >>> On 4/27/2009 at 2:41 PM, in message , "Murty Maganti" wrote: > Hi > > > > I have a raster layer in map file. When I load the map file using C# map > script, at run time it shows layerObj.connectiontype as > 'MS_CONNECTION_TYPE.MS_SHAPEFILE' though it is raster image. Is there > any syntax error with my map file definition. I need to know exactly > whether it is a raster or vector layer in my application. Some logic in > my application needs to handle them differently. > > > > This is the entry in map file > > > > LAYER > > DATA "14m_jpg_24bit.jpg" > > NAME " 14m Jpg 24bit" > > STATUS ON > > TYPE RASTER > > UNITS METERS > > END > > > > Thanks > > Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] C# connectiontype issue
Hi I have a raster layer in map file. When I load the map file using C# map script, at run time it shows layerObj.connectiontype as 'MS_CONNECTION_TYPE.MS_SHAPEFILE' though it is raster image. Is there any syntax error with my map file definition. I need to know exactly whether it is a raster or vector layer in my application. Some logic in my application needs to handle them differently. This is the entry in map file LAYER DATA "14m_jpg_24bit.jpg" NAME " 14m Jpg 24bit" STATUS ON TYPE RASTER UNITS METERS END Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] queryByAttributes on oracle spatial layer
Hi I am doing a query on a oracle spatial layers. When I loop through the result set to retrieve field value, using layerObj.getFeature() method, it is terribly slow. What I see from the log files is that a separate database query with unique id column value is fired to oracle for each getFeature call. This will definitely slows down. If I have 10,000 results, then 10,000 database queries are getting fired to retrieve the field values. Is there is a way to avoid this. Is there any setting or API that will prevent so many separate queries fired and retrieve field values with first query itself. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] VALIDATION item
Hi When I call mapObj.save(), I see a new tag 'VALIDATION' in layer section of map file. It just contains metadata of layer. There is no mention of this item in the online documentation. What is this item 'VALIDATION'? Is it replacement of METADATA or METADATA will continue to be there. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Oracle Spatial Layer + C# map script
Hi I am using a oracle spatial layer which has roughly 100,000 features. When I call layerObj.getExtents() function, it takes a long time to return. This is the query sent to oracle by map server SELECT SDO_AGGR_MBR(GEOM) AS GEOM from (SELECT GEOM FROM ORSPTL.PARCELS) If I run the query in database, it takes long time to execute. Is there way to optimize this query to execute fast? Also, I see that layer extents are stored in USER_SDO_GEOM_METADATA table. Why is map server not querying against that. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] WMS question
OK, I see that we can set the exceptions format as metadata using 'wms_exceptions_format'. That should solve the issue. From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Murty Maganti Sent: Tuesday, March 24, 2009 5:26 PM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] WMS question Hello I have an issue using a WMS layer from http://njwebmap.state.nj.us/njorthos in map file. mapObj.draw() throws an exception. This is the URL constructed by map server http://njwebmap.state.nj.us/njorthos?LAYERS=Infrared2007,Natural2007&REQ UEST=GetMap&SERVICE=WMS&FORMAT=image/jpeg&STYLES=,&HEIGHT=415&VERSION=1. 1.1&SRS=EPSG:4326&WIDTH=578&BBOX=-76.4510022342995,38.91088,-73.01986476 57005,41.372736&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inima ge If I run this URL in a browser, it still gives error. But if I remove EXCEPTIONS=application/vnd.ogc.se_inimage, then it works fine. Is there a way to suppress the exceptions tag appended by map server Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] WMS question
Hello I have an issue using a WMS layer from http://njwebmap.state.nj.us/njorthos in map file. mapObj.draw() throws an exception. This is the URL constructed by map server http://njwebmap.state.nj.us/njorthos?LAYERS=Infrared2007,Natural2007&REQ UEST=GetMap&SERVICE=WMS&FORMAT=image/jpeg&STYLES=,&HEIGHT=415&VERSION=1. 1.1&SRS=EPSG:4326&WIDTH=578&BBOX=-76.4510022342995,38.91088,-73.01986476 57005,41.372736&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inima ge If I run this URL in a browser, it still gives error. But if I remove EXCEPTIONS=application/vnd.ogc.se_inimage, then it works fine. Is there a way to suppress the exceptions tag appended by map server Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] queryByAttribute in C# mapscript
Hi Here is the entry in map file (removed CLASS portion) LAYER CONNECTION "vmonp03,port:5154,dmtigdb,dmtigdb,password" CONNECTIONTYPE PLUGIN PLUGIN "msplugin_sde_92.dll" DATA "DMTIGDB.CANLUR,SHAPE,SDE.DEFAULT" NAME "Canlur" PROCESSING "CLOSE_CONNECTION=DEFER" CLASS -- END END I think the parsing error is coming from query expression. If I use PARCELD=123, then it writes 'Parsing error near(PARCELID)' to log. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Tuesday, March 24, 2009 11:17 AM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] queryByAttribute in C# mapscript How is your mapfile looking like. Parsing error near (OBJECTID) seems a bit strange here Best regards, Tamas 2009/3/24 Murty Maganti Hi I am using queryByAttribute on a SDE layer with a simple expression, 'OBJECTID = 750'. The method returns MS_FAILURE, though it is valid expression. I can run same query in ArcCatalog and get the result back. What do I need to verify here. I usually I check that there is template name defined and maxscaledenom is set to -1. What else I am missing. This is what is logged by map server [Mon Mar 23 18:02:25 2009].834000 msConnPoolRequest(Canlur,vmonp03,port:5154,dmtigdb,dmtigdb,password) -> got 1D49DFF8 [Mon Mar 23 18:02:25 2009].834000 msSDELayerOpen(): Layer Canlur specified version SDE.DEFAULT. [Mon Mar 23 18:02:25 2009].834000 msSDEGetLayerInfo(): Looking for layer by TESTGDB.CANLUR, SHAPE, vmonp03,port:5154,dmtigdb,dmtigdb,password [Mon Mar 23 18:02:25 2009].834000 msSDEGetLayerId(): Matched layer to id 112. [Mon Mar 23 18:02:25 2009].834000 Getting all column information in msSDELayerInitItemInfo [Mon Mar 23 18:02:25 2009].834000 msSDELayerInitItemInfo(): getting info for OBJECTID [Mon Mar 23 18:02:25 2009].834000 msSDELayerInitItemInfo(): getting info for CATEGORY [Mon Mar 23 18:02:25 2009].834000 msSDELayerInitItemInfo(): getting info for SHAPE [Mon Mar 23 18:02:25 2009].834000 msSDELayerInitItemInfo(): getting info for OID [Mon Mar 23 18:02:35 2009].338000 getSymbol(): Symbol definition error. Parsing error near (OBJECTID):(line 831) [Mon Mar 23 18:02:35 2009].37 msQueryByAttributes(): Search returned no results. No matching record(s) found. I used another field PARCELID, which is also numeric but still does not work. Thanks Murty ___ 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] queryByAttribute in C# mapscript
Hi I am using queryByAttribute on a SDE layer with a simple expression, 'OBJECTID = 750'. The method returns MS_FAILURE, though it is valid expression. I can run same query in ArcCatalog and get the result back. What do I need to verify here. I usually I check that there is template name defined and maxscaledenom is set to -1. What else I am missing. This is what is logged by map server [Mon Mar 23 18:02:25 2009].834000 msConnPoolRequest(Canlur,vmonp03,port:5154,dmtigdb,dmtigdb,password) -> got 1D49DFF8 [Mon Mar 23 18:02:25 2009].834000 msSDELayerOpen(): Layer Canlur specified version SDE.DEFAULT. [Mon Mar 23 18:02:25 2009].834000 msSDEGetLayerInfo(): Looking for layer by TESTGDB.CANLUR, SHAPE, vmonp03,port:5154,dmtigdb,dmtigdb,password [Mon Mar 23 18:02:25 2009].834000 msSDEGetLayerId(): Matched layer to id 112. [Mon Mar 23 18:02:25 2009].834000 Getting all column information in msSDELayerInitItemInfo [Mon Mar 23 18:02:25 2009].834000 msSDELayerInitItemInfo(): getting info for OBJECTID [Mon Mar 23 18:02:25 2009].834000 msSDELayerInitItemInfo(): getting info for CATEGORY [Mon Mar 23 18:02:25 2009].834000 msSDELayerInitItemInfo(): getting info for SHAPE [Mon Mar 23 18:02:25 2009].834000 msSDELayerInitItemInfo(): getting info for OID [Mon Mar 23 18:02:35 2009].338000 getSymbol(): Symbol definition error. Parsing error near (OBJECTID):(line 831) [Mon Mar 23 18:02:35 2009].37 msQueryByAttributes(): Search returned no results. No matching record(s) found. I used another field PARCELID, which is also numeric but still does not work. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Oracle spatial question
Hello Is oracle 11g (oracle spatial layers) supported by map server. Online documentation (http://www.mapserver.org/input/vector/oracle.html) says 10gas latest. if supported, is there any libmap.dll available that is compiled against 11g client? Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Scalebar align issue
Hi Setting the scalebar align property to 'left' or 'right' is truncating some text towards that edge. Works fine for 'center' align. For example, I have scalebar with units as miles and align set to right, scalebar label is displaying only 'm' instead of displaying 'mi' for miles. If I change the align to left, part of the 0 is sliced. Is there any property that I can use so that full text is displayed. I have tried buffer and offset properties of label but both did not work. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] WFS-WMS question
Hi What are the supported versions of WFS client (i.e. to consume WFS layer inside mapfile). Online document says 1.0.0. Same way, I want to know for WMS. Currently I am using map server 5.2 (If the support is extended after that). Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Label encoding
Hi >The iconv.dll and fribidi.dll should be available to load by the application by default. >Does this issue exists only when fribidi is compiled in? I can see a couple of non-const static variables used by the fribidi library and I wonder if we should >protect the access to these functions with locks inside the mapserver code in a multi-threaded environment. I have the both DLLs present in PATH/binary folders. Though I see SUPPORT=FRIBIDI output from map server, but I guess it is going through iconv. When a specify wrong encoding like 'abc' it throws exception that the encoding is not supported by iconv, which means it is using iconv. Forgot to mention this previously. There is no problem loading the map file (with encoding) in a desktop application on Vista. It hangs when I load in ASP.Net environment. But same map file loads fine in ASP.Net on XP machine. Appreciate all the help. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Wednesday, March 11, 2009 6:28 PM To: Murty Maganti Cc: Daniel Morissette; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Label encoding 2009/3/11 Murty Maganti Hi Is that list same if map server is compiled with Fribidi or is it different? Hi, I can see the followings added in fribidi (according to fribidi-char-sets-list.h) #ifdef _FRIBIDI_ADD_CHAR_SET_OTHERS _FRIBIDI_ADD_CHAR_SET_OTHERS (UTF8, utf8)/* UTF-8 (Unicode) */ _FRIBIDI_ADD_CHAR_SET_OTHERS (CAP_RTL, cap_rtl)/* CapRTL (Test) */ #endif /* _FRIBIDI_ADD_CHAR_SET_OTHERS */ #ifdef _FRIBIDI_ADD_CHAR_SET_ONE2ONE _FRIBIDI_ADD_CHAR_SET_ONE2ONE (ISO8859_6, iso8859_6)/* ISO8859-6 (Arabic) */ _FRIBIDI_ADD_CHAR_SET_ONE2ONE (ISO8859_8, iso8859_8)/* ISO8859-8 (Hebrew) */ _FRIBIDI_ADD_CHAR_SET_ONE2ONE (CP1255, cp1255)/* CP1255 (MS Hebrew/Yiddish) */ _FRIBIDI_ADD_CHAR_SET_ONE2ONE (CP1256, cp1256)/* CP1256 (MS Arabic) */ #endif /* _FRIBIDI_ADD_CHAR_SET_ONE2ONE */ As far as I can see this takes precedence over iconv when fribidi is compiled in, unless you specify FRIBIDI_NO_CHARSETS when compiling mapserver. In the latter case iconv is used to when doing the encoding. Also, have another issue. I have a map file that loads perfectly fine on XP and vista. The moment I add encoding attribute, it does not load in vista (no matter what the coding value). It just hangs in mapObj.draw() and need to restart IIS. Works fine on XP. Is there any clue where I can look to resolve the issue. Do I need to install any additional libraries for Iconv or Fribidi on Vista? The iconv.dll and fribidi.dll should be available to load by the application by default. Does this issue exists only when fribidi is compiled in? I can see a couple of non-const static variables used by the fribidi library and I wonder if we should protect the access to these functions with locks inside the mapserver code in a multi-threaded environment. Best regards, Tamas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Label encoding
Hi Is that list same if map server is compiled with Fribidi or is it different? Also, have another issue. I have a map file that loads perfectly fine on XP and vista. The moment I add encoding attribute, it does not load in vista (no matter what the coding value). It just hangs in mapObj.draw() and need to restart IIS. Works fine on XP. Is there any clue where I can look to resolve the issue. Do I need to install any additional libraries for Iconv or Fribidi on Vista? Thanks Murty -Original Message- From: Daniel Morissette [mailto:dmorisse...@mapgears.com] Sent: Wednesday, March 11, 2009 2:53 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Label encoding Murty Maganti wrote: > > Where can I get the list of valid encodings that can be used in encoding > of LABEL section. > MapServer uses the libiconv library to deal with encodings. There is a list of encodings that the lib supports here: http://www.gnu.org/software/libiconv/ ... and one can also use the "iconv -l" command on a system with libiconv installed to get the complete list of supported encodings on that specific system. Daniel -- Daniel Morissette http://www.mapgears.com/ ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Label encoding
Hi Where can I get the list of valid encodings that can be used in encoding of LABEL section. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Encoding issues
Hi As per the code documentation in the method msGetEncodedString (as shown below), the characters are assumed to be UTF-8 by default. char *msGetEncodedString(const char *string, const char *encoding) { --- if (len == 0 || (encoding && strcasecmp(encoding, "UTF-8")==0)) return strdup(string);/* Nothing to do: string already in UTF-8 */ Where as in the ‘values’ property of shapeObj.cs in C#, it is using System.Runtime.InteropServices.Marshal.PtrToStringAnsi (to marshal characters from c to c#). Shoudn’t it be using System.Runtime.InteropServices.Marshal.PtrToStringUni method since as the charcters are by default held in UTF-8 encoding? Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Wednesday, March 04, 2009 5:25 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues Hi, I don't know much about the hindi character sets. I guess you could extent that byte array to string copy function with arbitrary character sizes, like for double bytes something like: for (int i = 0; i < bytes.Length; i=i+2) s.Append(Convert.ToChar(bytes[i] + 256*bytes[i+1])); Best regards, Tamas 2009/3/4 Murty Maganti Hi Tamas This is still not working for some of the Asian languages. I suspect the issue could be in this line of your sample code below s.Append(Convert.ToChar(bytes[i])); Here, one single byte is used to convert to a character. But my understanding is that UTF-8 can consume from 1 to 4 bytes to represent one character code point. It worked fine for Arabic may be because all Arabic characters can be represented using a single byte. When I tried the same code below with Hindi, an Indian language, some of the characters are shown junk (but not all characters). I guess those characters which occupy more than a byte turned out to be junk. I am also trying the opposite of the sample code below i.e. read a field value from map server (shapeObj.values), which is in Hindi, and show on a web page, again it turns out to be junk. I tried to look at the byte values of the string in VS by using Byte[] bites = Encoding.Unicode.GetBytes(shapeObj.values[0]) I notice that they are actually code point of UTF-8 but interpreted as UTF-16 and may be the reason I see junk characters on web page. But I don’t know how to extract those UTF-8 byte values from UTF-16. I am just giving sample code here to explain byte[] utf16 = Encoding.Unicode.GetBytes("कीचनर"); //The text is in Hindi, an Indian language byte[] utf8 = Encoding.UTF8.GetBytes("कीचनर"); shapeObj shape = layer.getFeature(result.shapeindex, result.tileindex); string value = shape.values[1]; //This contains the same text (in Hindi) as above in the shape file. byte[] bytes = Encoding.Unicode.GetBytes(value); //There are byte values of characters decoded from UTF-16. .Net internally stores all strings in UTF-16 Now if I examine the values of ‘utf8’ and ‘bytes’ arrays utf8 – 224,164,149,224,165,128,224,164,154,224,164,168,224,164,176 bytes – 224,0,164,0,34,32,224,0,165,0,172,32,224,0,164,0,97,1,224,0,164,0,168,0,224,0,164,0,176,0 utf16 – 21,9,64,9,26,9,40,9,48,9 The first byte value is same as UTF-8. Second byte value is 0 as UTF-16 takes atleast 2 bytes for a character. This gives me impression that the byte values are in UTF-8 and are not converted to UTF-16 to by .Net. Appreciate if you see any solution for this and let me know. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Friday, February 06, 2009 6:59 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues You might have to make explicit conversion maually something like: string value = "لققافعععىىةةونه"; //I actually get this (in arabic) through user input byte[] bytes = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(1256), Encoding.Unicode.GetBytes(value)); StringBuilder s = new StringBuilder(); for (int i = 0; i < bytes.Length; i++) s.Append(Convert.ToChar(bytes[i])); shpObj.text = s.ToString(); Best regards, Tamas 2009/2/6 Murty Maganti HI I am doing a simple thing. I have a map file and trying to show some static text in Arabic on map. You can try this with any map file as it is nothing to do with layers from map. At run time (like on a button click), please add this layerObj lyr = new layerObj(mapObj); lyr.name = "TextAcetate"; lyr.status = mapscript.MS_ON; lyr.type = MS_LAYER_TYPE.MS_LAYER_ANNOTATION; lyr.labelcache = mapscript.MS_TRUE; double locationX =
[mapserver-users] mapscript question
Hi What is the best way to retrieve all records of a layer. Some options I see is 1. calling queryByRect(mapObj.extents) - But this will not get all records if map extents are smaller than layer extents 2. layer.whichShapes() - But this will apply filter set on the layer. I want to get all records. 3. call queryByAttribute() and pass some expression that will select everything Or, is there any more straight forward API to get all records. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] C# mapscript question
Hi I am setting font property at runtime using clsObj.label.font="Times-New-Roman" This font alias is there in my fonts file. When I save the map file (mapObj.save()), the font name is not saved. It saves the font name if the type is set to truetype. If the type is set to bitmap, then it is not saving the font name. Does it not support using a font if the type is bitmap. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Vista + map script question
Hi I could compile from the SDK but have a small issue using the compiled binaries. Getting the following error while loading SDE layer First-chance exception at 0x7855b66c (msvcr90.dll) in WindowsFormsApplication1.exe: 0xC005: Access violation reading location 0x0001. A first chance exception of type 'System.AccessViolationException' occurred in mapscript_csharp.dll An unhandled exception of type 'System.AccessViolationException' occurred in mapscript_csharp.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. And it is happening on this line below char *msDecryptStringTokens(mapObj *map, const char *in) { char *outbuf, *out; if (map == NULL) { msSetError(MS_MISCERR, "NULL MapObj.", "msLoadEncryptionKey()"); return NULL; } /* Start with a copy of the string. Decryption can only result in * a string with the same or shorter length */ =>if ((outbuf = (char *)malloc((strlen(in)+1)*sizeof(char))) == NULL) { Any clue on what I could be doing wrong here. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Thursday, March 05, 2009 7:10 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Vista + map script question 2009/3/6 Murty Maganti Just a quick one. How can I compile only the mapscript_csharp assembly. Is there any VS project file available. Hi, Just download the most sufficient -dev package (http://vbkto.dyndns.org:1280/sdk/index.html) for your compiler version and issue: nmake ms nmake ms-csharp in the Visual Studio Command Prompt. Best regards, Tamas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Vista + map script question
Hi I took from ms4w binaries (version 2.2.7). I can try latest from URL below. Just a quick one. How can I compile only the mapscript_csharp assembly. Is there any VS project file available. Thanks Murty From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Tamas Szekeres Sent: Thursday, March 05, 2009 5:19 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Vista + map script question Where did you obtain the binaries? You could also grab any of my latest builds available at: http://vbkto.dyndns.org:1280/sdk/index.html Best regards, Tamas 2009/3/5 Murty Maganti Hi Running my (desktop) application on some of the Vista or windows 2008 machines, gdla15.dll is not getting loaded. When I run dependency walker on gdal15.dll, it reports one of its dependency, GPSVC.dll, is not found. Did anyone encounter similar issue and if so, what is the resolution. Works fine on XP machines. Thanks Murty ___ 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] Vista + map script question
Hi Running my (desktop) application on some of the Vista or windows 2008 machines, gdla15.dll is not getting loaded. When I run dependency walker on gdal15.dll, it reports one of its dependency, GPSVC.dll, is not found. Did anyone encounter similar issue and if so, what is the resolution. Works fine on XP machines. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Encoding issues
Thanks. I will try out that. From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Wednesday, March 04, 2009 5:25 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues Hi, I don't know much about the hindi character sets. I guess you could extent that byte array to string copy function with arbitrary character sizes, like for double bytes something like: for (int i = 0; i < bytes.Length; i=i+2) s.Append(Convert.ToChar(bytes[i] + 256*bytes[i+1])); Best regards, Tamas 2009/3/4 Murty Maganti Hi Tamas This is still not working for some of the Asian languages. I suspect the issue could be in this line of your sample code below s.Append(Convert.ToChar(bytes[i])); Here, one single byte is used to convert to a character. But my understanding is that UTF-8 can consume from 1 to 4 bytes to represent one character code point. It worked fine for Arabic may be because all Arabic characters can be represented using a single byte. When I tried the same code below with Hindi, an Indian language, some of the characters are shown junk (but not all characters). I guess those characters which occupy more than a byte turned out to be junk. I am also trying the opposite of the sample code below i.e. read a field value from map server (shapeObj.values), which is in Hindi, and show on a web page, again it turns out to be junk. I tried to look at the byte values of the string in VS by using Byte[] bites = Encoding.Unicode.GetBytes(shapeObj.values[0]) I notice that they are actually code point of UTF-8 but interpreted as UTF-16 and may be the reason I see junk characters on web page. But I don’t know how to extract those UTF-8 byte values from UTF-16. I am just giving sample code here to explain byte[] utf16 = Encoding.Unicode.GetBytes("कीचनर"); //The text is in Hindi, an Indian language byte[] utf8 = Encoding.UTF8.GetBytes("कीचनर"); shapeObj shape = layer.getFeature(result.shapeindex, result.tileindex); string value = shape.values[1]; //This contains the same text (in Hindi) as above in the shape file. byte[] bytes = Encoding.Unicode.GetBytes(value); //There are byte values of characters decoded from UTF-16. .Net internally stores all strings in UTF-16 Now if I examine the values of ‘utf8’ and ‘bytes’ arrays utf8 – 224,164,149,224,165,128,224,164,154,224,164,168,224,164,176 bytes – 224,0,164,0,34,32,224,0,165,0,172,32,224,0,164,0,97,1,224,0,164,0,168,0,224,0,164,0,176,0 utf16 – 21,9,64,9,26,9,40,9,48,9 The first byte value is same as UTF-8. Second byte value is 0 as UTF-16 takes atleast 2 bytes for a character. This gives me impression that the byte values are in UTF-8 and are not converted to UTF-16 to by .Net. Appreciate if you see any solution for this and let me know. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Friday, February 06, 2009 6:59 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues You might have to make explicit conversion maually something like: string value = "لققافعععىىةةونه"; //I actually get this (in arabic) through user input byte[] bytes = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(1256), Encoding.Unicode.GetBytes(value)); StringBuilder s = new StringBuilder(); for (int i = 0; i < bytes.Length; i++) s.Append(Convert.ToChar(bytes[i])); shpObj.text = s.ToString(); Best regards, Tamas 2009/2/6 Murty Maganti HI I am doing a simple thing. I have a map file and trying to show some static text in Arabic on map. You can try this with any map file as it is nothing to do with layers from map. At run time (like on a button click), please add this layerObj lyr = new layerObj(mapObj); lyr.name = "TextAcetate"; lyr.status = mapscript.MS_ON; lyr.type = MS_LAYER_TYPE.MS_LAYER_ANNOTATION; lyr.labelcache = mapscript.MS_TRUE; double locationX = 50; double locationY = 50; lyr.transform = (int)mapscript.MS_FALSE; classObj layerClass = new classObj(lyr); //All label properties layerClass.label.size = 15; layerClass.label.type = MS_FONT_TYPE.MS_TRUETYPE; … … layerClass.label.encoding = "CP1256"; shapeObj shpObj = new shapeObj((int)MS_SHAPE_TYPE.MS_SHAPE_POINT); lineObj lnObj = new lineObj(); pointObj pt = new pointObj(locationX, locationY, 0, 0); lnObj.add(pt); shpObj.add(lnObj); shpObj.text = "لققافعععىىةةونه"; //I actually get this (in arabic) through
[mapserver-users] WMS question
Hi When I specify WEB.IMAGEPATH to "." and use a WMS layer, I am able to render the layer on map i.e. map server is able to save the temporary files. I want to know which folder it is getting resolved to either relative to map file path or any other path. I need to verify if the temp files are cleaned up or any files are left in the folder. I can find them in map file folder or any parent or child folders. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] WMS and map script
Tom, Also, I don't see EXTENT attribute at layer level, from below reference http://www.mapserver.org/mapfile/layer.html There is layerObj.setExtent() but the extents are not saved to map file. Thanks Murty -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Murty Maganti Sent: Wednesday, March 04, 2009 2:13 PM To: Kralidis,Tom [Ontario]; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] WMS and map script That won't help me. I add the wms layer dynamically to map using C# mapscript (and then save the map object to map file). I can get the extents from capabilities but layer.extent is readonly and can't be set. Thanks Murty -Original Message- From: Kralidis,Tom [Ontario] [mailto:tom.krali...@ec.gc.ca] Sent: Wednesday, March 04, 2009 2:02 PM To: Murty Maganti; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] WMS and map script > > I am getting junk extent values after calling > layerObj.getExtent() on a WMS layer. > > > > This is the WMS server url > > http://www2.demis.nl/wms/wms.asp > > > > I have used a layer called Countries from that server and > this is the capability xml for that layer > > queryable="1" opaque="0"> > > > Countries > > > Countries > > >maxx="180" maxy="83.6333923339844"/> > > > > > > This is the entry in map file > > LAYER > > CONNECTION "http://www2.demis.nl/wms/wms.asp?wms=SAMPLE&"; > > CONNECTIONTYPE WMS > > METADATA > > "wms_srs""EPSG:4326" > > "wms_name" "Countries" > > "wms_format""image/png" > > "wms_server_version" "1.1.0" > > END > > NAME "Countries" > > PROJECTION > > "init=epsg:4326" > > END > > STATUS ON > > TYPE RASTER > > UNITS DD > > END > > > > I get extents values (minx, miny, maxx and maxy) as > -4.8366978272229995E-26 (which is not same as above in the > capabilities xml) > > > > Appreciate any help. > MapServer won't do a GetCapabiilties to get the extent for remote WMS layers. If you set LAYER.EXTENT accordingly, layer.getExtent() will work accordingly. ..Tom ___ 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] WMS and map script
That won't help me. I add the wms layer dynamically to map using C# mapscript (and then save the map object to map file). I can get the extents from capabilities but layer.extent is readonly and can't be set. Thanks Murty -Original Message- From: Kralidis,Tom [Ontario] [mailto:tom.krali...@ec.gc.ca] Sent: Wednesday, March 04, 2009 2:02 PM To: Murty Maganti; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] WMS and map script > > I am getting junk extent values after calling > layerObj.getExtent() on a WMS layer. > > > > This is the WMS server url > > http://www2.demis.nl/wms/wms.asp > > > > I have used a layer called Countries from that server and > this is the capability xml for that layer > > queryable="1" opaque="0"> > > > Countries > > > Countries > > >maxx="180" maxy="83.6333923339844"/> > > > > > > This is the entry in map file > > LAYER > > CONNECTION "http://www2.demis.nl/wms/wms.asp?wms=SAMPLE&"; > > CONNECTIONTYPE WMS > > METADATA > > "wms_srs""EPSG:4326" > > "wms_name" "Countries" > > "wms_format""image/png" > > "wms_server_version" "1.1.0" > > END > > NAME "Countries" > > PROJECTION > > "init=epsg:4326" > > END > > STATUS ON > > TYPE RASTER > > UNITS DD > > END > > > > I get extents values (minx, miny, maxx and maxy) as > -4.8366978272229995E-26 (which is not same as above in the > capabilities xml) > > > > Appreciate any help. > MapServer won't do a GetCapabiilties to get the extent for remote WMS layers. If you set LAYER.EXTENT accordingly, layer.getExtent() will work accordingly. ..Tom ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Encoding issues
Hi Tamas This is still not working for some of the Asian languages. I suspect the issue could be in this line of your sample code below s.Append(Convert.ToChar(bytes[i])); Here, one single byte is used to convert to a character. But my understanding is that UTF-8 can consume from 1 to 4 bytes to represent one character code point. It worked fine for Arabic may be because all Arabic characters can be represented using a single byte. When I tried the same code below with Hindi, an Indian language, some of the characters are shown junk (but not all characters). I guess those characters which occupy more than a byte turned out to be junk. I am also trying the opposite of the sample code below i.e. read a field value from map server (shapeObj.values), which is in Hindi, and show on a web page, again it turns out to be junk. I tried to look at the byte values of the string in VS by using Byte[] bites = Encoding.Unicode.GetBytes(shapeObj.values[0]) I notice that they are actually code point of UTF-8 but interpreted as UTF-16 and may be the reason I see junk characters on web page. But I don’t know how to extract those UTF-8 byte values from UTF-16. I am just giving sample code here to explain byte[] utf16 = Encoding.Unicode.GetBytes("कीचनर"); //The text is in Hindi, an Indian language byte[] utf8 = Encoding.UTF8.GetBytes("कीचनर"); shapeObj shape = layer.getFeature(result.shapeindex, result.tileindex); string value = shape.values[1]; //This contains the same text (in Hindi) as above in the shape file. byte[] bytes = Encoding.Unicode.GetBytes(value); //There are byte values of characters decoded from UTF-16. .Net internally stores all strings in UTF-16 Now if I examine the values of ‘utf8’ and ‘bytes’ arrays utf8 – 224,164,149,224,165,128,224,164,154,224,164,168,224,164,176 bytes – 224,0,164,0,34,32,224,0,165,0,172,32,224,0,164,0,97,1,224,0,164,0,168,0,224,0,164,0,176,0 utf16 – 21,9,64,9,26,9,40,9,48,9 The first byte value is same as UTF-8. Second byte value is 0 as UTF-16 takes atleast 2 bytes for a character. This gives me impression that the byte values are in UTF-8 and are not converted to UTF-16 to by .Net. Appreciate if you see any solution for this and let me know. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Friday, February 06, 2009 6:59 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues You might have to make explicit conversion maually something like: string value = "لققافعععىىةةونه"; //I actually get this (in arabic) through user input byte[] bytes = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(1256), Encoding.Unicode.GetBytes(value)); StringBuilder s = new StringBuilder(); for (int i = 0; i < bytes.Length; i++) s.Append(Convert.ToChar(bytes[i])); shpObj.text = s.ToString(); Best regards, Tamas 2009/2/6 Murty Maganti HI I am doing a simple thing. I have a map file and trying to show some static text in Arabic on map. You can try this with any map file as it is nothing to do with layers from map. At run time (like on a button click), please add this layerObj lyr = new layerObj(mapObj); lyr.name = "TextAcetate"; lyr.status = mapscript.MS_ON; lyr.type = MS_LAYER_TYPE.MS_LAYER_ANNOTATION; lyr.labelcache = mapscript.MS_TRUE; double locationX = 50; double locationY = 50; lyr.transform = (int)mapscript.MS_FALSE; classObj layerClass = new classObj(lyr); //All label properties layerClass.label.size = 15; layerClass.label.type = MS_FONT_TYPE.MS_TRUETYPE; … … layerClass.label.encoding = "CP1256"; shapeObj shpObj = new shapeObj((int)MS_SHAPE_TYPE.MS_SHAPE_POINT); lineObj lnObj = new lineObj(); pointObj pt = new pointObj(locationX, locationY, 0, 0); lnObj.add(pt); shpObj.add(lnObj); shpObj.text = "لققافعععىىةةونه"; //I actually get this (in arabic) through user input lyr.addFeature(shpObj); mapObj.draw(); //Onto a picture box or save as file (In the map file, my output format is set to GD/PNG) Please let me know if you need more information. Thanks Murty From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Tamas Szekeres Sent: Friday, February 06, 2009 4:12 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues Please send me your example so that I could examine what's going
[mapserver-users] WMS and map script
Hi I am getting junk extent values after calling layerObj.getExtent() on a WMS layer. This is the WMS server url http://www2.demis.nl/wms/wms.asp I have used a layer called Countries from that server and this is the capability xml for that layer Countries Countries This is the entry in map file LAYER CONNECTION "http://www2.demis.nl/wms/wms.asp?wms=SAMPLE&"; CONNECTIONTYPE WMS METADATA "wms_srs""EPSG:4326" "wms_name" "Countries" "wms_format""image/png" "wms_server_version" "1.1.0" END NAME "Countries" PROJECTION "init=epsg:4326" END STATUS ON TYPE RASTER UNITS DD END I get extents values (minx, miny, maxx and maxy) as -4.8366978272229995E-26 (which is not same as above in the capabilities xml) Appreciate any help. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] WFS Layer + C# map script
Hi Assefa Yes, the problem seems to be related to the GML file not accessible. I normally leave WEB->IMAGEPATH empty in my map files as my application displays map image on a windows form directly. When I started adding support for WMS layers, I noticed that it is using imagepath to store temporary files. I didn't want to specify a qualified path as the map file will not load on other machines which may not have the same path. I tried "\" (after briefly scanning through msBuildPath and msBuildPath3 methods) and it worked for WMS. I guess "\" gets resolved to location of the map file. But same is not working for WFS. If I change the path from "\" to a fully qualified path, I don't see that error any more. But I don't want to use fully qualified path. I want to use any relative path that can be resolved to map file path or shappath or any other location. What is the best relative path I can use for imagepath that can work for WMS/WFS or any other data sources that use this to store temporary files. Thanks Murty -Original Message- From: Yewondwossen Assefa [mailto:yass...@dmsolutions.ca] Sent: Thursday, February 26, 2009 11:13 AM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] WFS Layer + C# map script Hi Murty, MapServer does a request to the WFS server to get the GML file. This GML file is saved locally and rendered by OGR as a vector layer. You might want to check the file you got from the server (should be inside web.imagepath (.tmp.gml) and see if it is valid or/if can be opened with ogr. Best Regards Murty Maganti wrote: > Hi > > > > I am trying load a WFS layer and getting the following error calling > mapObj.draw(). Is WFS layer handled by OGR or is it handled directly by > map server. When I ran 'orginfo -formats', it does not show WFS as > supported format by OGR. WFS URL in map file is correct and I can see > the capabilities xml in browser using the url. > > > > Here is the error > > msDrawMap(): Image handling error. Failed to draw layer named > 'Municipality (id=0)'.;msOGRFileOpen(): OGR error. Open failed for OGR > connection in layer ` Municipality (id=0)'. File not found or > unsupported format. > > > > Layer entry in the map file > > > > LAYER > > CONNECTION "http://vmonp03/wfsconnector/com.esri.wfs.Esrimap/ MS01?" > > CONNECTIONTYPE WFS > > METADATA > > "wfs_srs" "EPSG:26917" > > "wfs_request_method" "GET" > > "wfs_typename" "Municipality-0" > > "wfs_service" "WFS" > > "wfs_version" "1.0.0" > > END > > NAME "Municipality (id=0)" > > STATUS ON > > TYPE POLYGON > > UNITS METERS > > CLASS > > NAME "Municipality (id=0)" > > STYLE > > COLOR 184 155 225 > > OPACITY 100 > > OUTLINECOLOR 0 0 0 > > SYMBOL 0 > > END > > END > > END > > > > Thanks > > Murty > > > > > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users -- Assefa Yewondwossen Software Analyst Email: ass...@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] WFS Layer + C# map script
Hi I am trying load a WFS layer and getting the following error calling mapObj.draw(). Is WFS layer handled by OGR or is it handled directly by map server. When I ran 'orginfo -formats', it does not show WFS as supported format by OGR. WFS URL in map file is correct and I can see the capabilities xml in browser using the url. Here is the error msDrawMap(): Image handling error. Failed to draw layer named 'Municipality (id=0)'.;msOGRFileOpen(): OGR error. Open failed for OGR connection in layer ` Municipality (id=0)'. File not found or unsupported format. Layer entry in the map file LAYER CONNECTION "http://vmonp03/wfsconnector/com.esri.wfs.Esrimap/ MS01?" CONNECTIONTYPE WFS METADATA "wfs_srs" "EPSG:26917" "wfs_request_method" "GET" "wfs_typename" "Municipality-0" "wfs_service" "WFS" "wfs_version" "1.0.0" END NAME "Municipality (id=0)" STATUS ON TYPE POLYGON UNITS METERS CLASS NAME "Municipality (id=0)" STYLE COLOR 184 155 225 OPACITY 100 OUTLINECOLOR 0 0 0 SYMBOL 0 END END END Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Map server build kit
Hello All Where can I download latest build kit for map server? Also, will I be able to use nmake of VS 2008 to compile it? Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] C# map script question
Thanks. Currently I have used System.Diagnostic.Process in my app to call msencrypt and there are no issues. From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Thursday, February 19, 2009 5:00 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] C# map script question Those functions haven't been exposed to the MapScript interface yet. Best regards, Tamas 2009/2/19 Murty Maganti Hi I want to encrypt the passwords in map file. I know there is a tool available under installation folder but I want to encrypt through my application. Is there any API available under C# map script for encrypt/decrypt or invoking tool as shell command is the only option? Thanks Murty ___ 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] C# map script question
Hi I want to encrypt the passwords in map file. I know there is a tool available under installation folder but I want to encrypt through my application. Is there any API available under C# map script for encrypt/decrypt or invoking tool as shell command is the only option? Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Problem with loading map file using C# map script
Thanks a lot. It resolved my issue. Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Wednesday, February 18, 2009 4:43 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Problem with loading map file using C# map script Murty, I've investigated the problem it seems having the same name for each connection causes that the same connection is used from the connection pool when opening the second layer by the OGR driver. But if you close the first layer before opening the second it should work correctly then, like: string mapfile1 = Path.Combine(Application.StartupPath, @"..\..\mapfile1.map"); mapObj map1 = new mapObj(mapfile1); layerObj lyr1 = map1.getLayer(0); lyr1.open(); string field1 = lyr1.getItem(0); lyr1.close(); string mapfile2 = Path.Combine(Application.StartupPath, @"..\..\mapfile2.map"); mapObj map2 = new mapObj(mapfile2); layerObj lyr2 = map2.getLayer(0); lyr2.open(); string field2 = lyr2.getItem(0); lyr2.close(); Best regards, Tamas 2009/2/18 Murty Maganti Hi I have posted the test application. But the email is waiting for approval of moderator (as the attachment size is 75 KB and I think allowed is only 40 KB). Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Tuesday, February 17, 2009 6:33 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Problem with loading map file using C# map script Hmmm. I haven't found such an issue before. If you could post an example that would be helpful to reproduce this. Best regards, Tamas 2009/2/18 Murty Maganti Hi I have a issue loading a map file through map script and need help. I have two map info (tab) files with same name but in two different folders. I have two map files each containing each layer. I am loading these map files using C# map script (each map file is loaded in to a separate mapObj on a separate thread). At run time, when I debug the second mapObj, the layer has items (layerObj.getItem()) from the first layer loaded by the first map file. I verified 'shapepath' on mapObj and it is pointing to correct path. There is nothing wrong there. I am surprised how is it caching the item info, just by the file name (file name is same but they are completely from different folders). When I load the map file one more time (again a different .Net thread, it shows up correct fields). Within my app (Asp.Net), I can consistently replicate this. Thanks Murty ___ 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] Problem with loading map file using C# map script
Sorry, it may be coming from our SMTP server. I will verify. From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Wednesday, February 18, 2009 2:03 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Problem with loading map file using C# map script Would you send me the files privately for the meantime? Tamas 2009/2/18 Murty Maganti Hi I have posted the test application. But the email is waiting for approval of moderator (as the attachment size is 75 KB and I think allowed is only 40 KB). Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Tuesday, February 17, 2009 6:33 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Problem with loading map file using C# map script Hmmm. I haven't found such an issue before. If you could post an example that would be helpful to reproduce this. Best regards, Tamas 2009/2/18 Murty Maganti Hi I have a issue loading a map file through map script and need help. I have two map info (tab) files with same name but in two different folders. I have two map files each containing each layer. I am loading these map files using C# map script (each map file is loaded in to a separate mapObj on a separate thread). At run time, when I debug the second mapObj, the layer has items (layerObj.getItem()) from the first layer loaded by the first map file. I verified 'shapepath' on mapObj and it is pointing to correct path. There is nothing wrong there. I am surprised how is it caching the item info, just by the file name (file name is same but they are completely from different folders). When I load the map file one more time (again a different .Net thread, it shows up correct fields). Within my app (Asp.Net), I can consistently replicate this. Thanks Murty ___ 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] Problem with loading map file using C# map script
Hi Tried few times before but that is bouncing with following message Your message did not reach some or all of the intended recipients. Subject:RE: [mapserver-users] Problem with loading map file using C# map script The following recipient(s) cannot be reached: 'Tamas Szekeres' on 2/18/2009 2:35 PM There was a SMTP communication problem with the recipient's email server. Please contact your system administrator. From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Wednesday, February 18, 2009 2:03 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Problem with loading map file using C# map script Would you send me the files privately for the meantime? Tamas 2009/2/18 Murty Maganti Hi I have posted the test application. But the email is waiting for approval of moderator (as the attachment size is 75 KB and I think allowed is only 40 KB). Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Tuesday, February 17, 2009 6:33 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Problem with loading map file using C# map script Hmmm. I haven't found such an issue before. If you could post an example that would be helpful to reproduce this. Best regards, Tamas 2009/2/18 Murty Maganti Hi I have a issue loading a map file through map script and need help. I have two map info (tab) files with same name but in two different folders. I have two map files each containing each layer. I am loading these map files using C# map script (each map file is loaded in to a separate mapObj on a separate thread). At run time, when I debug the second mapObj, the layer has items (layerObj.getItem()) from the first layer loaded by the first map file. I verified 'shapepath' on mapObj and it is pointing to correct path. There is nothing wrong there. I am surprised how is it caching the item info, just by the file name (file name is same but they are completely from different folders). When I load the map file one more time (again a different .Net thread, it shows up correct fields). Within my app (Asp.Net), I can consistently replicate this. Thanks Murty ___ 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] Problem with loading map file using C# map script
Hi I have posted the test application. But the email is waiting for approval of moderator (as the attachment size is 75 KB and I think allowed is only 40 KB). Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Tuesday, February 17, 2009 6:33 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Problem with loading map file using C# map script Hmmm. I haven't found such an issue before. If you could post an example that would be helpful to reproduce this. Best regards, Tamas 2009/2/18 Murty Maganti Hi I have a issue loading a map file through map script and need help. I have two map info (tab) files with same name but in two different folders. I have two map files each containing each layer. I am loading these map files using C# map script (each map file is loaded in to a separate mapObj on a separate thread). At run time, when I debug the second mapObj, the layer has items (layerObj.getItem()) from the first layer loaded by the first map file. I verified 'shapepath' on mapObj and it is pointing to correct path. There is nothing wrong there. I am surprised how is it caching the item info, just by the file name (file name is same but they are completely from different folders). When I load the map file one more time (again a different .Net thread, it shows up correct fields). Within my app (Asp.Net), I can consistently replicate this. Thanks Murty ___ 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] Problem with loading map file using C# map script
I will create a test app and post it. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Tue 17/02/2009 6:33 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Problem with loading map file using C# map script Hmmm. I haven't found such an issue before. If you could post an example that would be helpful to reproduce this. I Best regards, Tamas 2009/2/18 Murty Maganti Hi I have a issue loading a map file through map script and need help. I have two map info (tab) files with same name but in two different folders. I have two map files each containing each layer. I am loading these map files using C# map script (each map file is loaded in to a separate mapObj on a separate thread). At run time, when I debug the second mapObj, the layer has items (layerObj.getItem()) from the first layer loaded by the first map file. I verified 'shapepath' on mapObj and it is pointing to correct path. There is nothing wrong there. I am surprised how is it caching the item info, just by the file name (file name is same but they are completely from different folders). When I load the map file one more time (again a different .Net thread, it shows up correct fields). Within my app (Asp.Net), I can consistently replicate this. Thanks Murty ___ 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] Problem with loading map file using C# map script
Hi I have a issue loading a map file through map script and need help. I have two map info (tab) files with same name but in two different folders. I have two map files each containing each layer. I am loading these map files using C# map script (each map file is loaded in to a separate mapObj on a separate thread). At run time, when I debug the second mapObj, the layer has items (layerObj.getItem()) from the first layer loaded by the first map file. I verified 'shapepath' on mapObj and it is pointing to correct path. There is nothing wrong there. I am surprised how is it caching the item info, just by the file name (file name is same but they are completely from different folders). When I load the map file one more time (again a different .Net thread, it shows up correct fields). Within my app (Asp.Net), I can consistently replicate this. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] help on SQL Server 2008 + C# map script
Hi After firing queryByShape() on SQL Server 2008 layer, getting junk characters for those field which are null (or have no value) in the database. Shows fine for those fields with some value. When I run any sample query on the table in query analyzer, I see the output as {null}. If the value is null in the database, I should be getting null reference or empty string (using C# map script i.e. shapeObj.values). Why I am getting junk characters. Appreciate any help. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Scalebar (and C# mapscript) issue
Hi Brian I had verified my code and there is no issue setting the units correctly in C#. In fact, I see the same issue setting the units to feet in map file directly. It seems there is some rounding issue when the scale values are too large. Please see the ticket http://trac.osgeo.org/mapserver/ticket/2890. Thanks a lot for your response. Murty From: Hulbert, Brian [mailto:brian.hulb...@linquest.com] Sent: Tuesday, February 17, 2009 11:13 AM To: Murty Maganti; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] Scalebar (and C# mapscript) issue Murty, It works fine for me using MapServer 5.0.2 with an equirectangular projection using a WGS84 geoid reference whether I'm zoomed to a world view or to a street-level view. Be sure you are setting the scalebar units member accordingly in C#. For example, scalebar.units = (int)OSGeo.MapServer.MS_UNITS.MS_FEET to set the units to feet. However, I have noted that it will appear garbled and squashed in width if you use units which are not meaningful for the current zoomed area. In other words, don't use inches when zoomed to a city or world view...the numbers are too large to display properly. Write a routine that sets the appropriate units based on the delta degrees that you are showing. For example, if the user chose English units (versus metric) and the current viewport spans roughly ~0.5 nautical miles, then set the units to inches. If the viewport is > 0.5 NM and < 1 NM, set the units to feet. Otherwise (the viewport spans more than 1 NM), set the units to miles. You can tweak this idea to suit your needs but this works well for me. Brian NOTE: The views expressed are the author's and do not necessarily reflect the official position of LinQuest Corporation or any of its subsidiaries or the organization providing Internet access. From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Murty Maganti Sent: Friday, February 13, 2009 2:20 PM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] Scalebar (and C# mapscript) issue Hello I am having strange issue with scalebar. I have scalebar displayed on map (embed) and scale units are set to miles. It has size of 200x10 pixels. It shows up fine on the map. Then at run time (using C# map script), I just change the units to feet or meters and the bar size shrinks (to almost 10 pixels length), which appears strange to me. Why would the scalebar length changes by changing units. Is there any other setting I need to set to maintain the same scalebar size? This works fine (or not noticeable) for maps which have extents at city level. I am testing on map which displays Ontario province (Canada). Also, you need to have projection elements defined at both map and layer level. In my case, the projection is same (WGS 1984). Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Scalebar (and C# mapscript) issue
Hello I am having strange issue with scalebar. I have scalebar displayed on map (embed) and scale units are set to miles. It has size of 200x10 pixels. It shows up fine on the map. Then at run time (using C# map script), I just change the units to feet or meters and the bar size shrinks (to almost 10 pixels length), which appears strange to me. Why would the scalebar length changes by changing units. Is there any other setting I need to set to maintain the same scalebar size? This works fine (or not noticeable) for maps which have extents at city level. I am testing on map which displays Ontario province (Canada). Also, you need to have projection elements defined at both map and layer level. In my case, the projection is same (WGS 1984). Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Encoding issues
Hello Great. It worked. Thanks a lot for your quick help. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Friday, February 06, 2009 6:59 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues You might have to make explicit conversion maually something like: string value = "لققافعععىىةةونه"; //I actually get this (in arabic) through user input byte[] bytes = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(1256), Encoding.Unicode.GetBytes(value)); StringBuilder s = new StringBuilder(); for (int i = 0; i < bytes.Length; i++) s.Append(Convert.ToChar(bytes[i])); shpObj.text = s.ToString(); Best regards, Tamas 2009/2/6 Murty Maganti HI I am doing a simple thing. I have a map file and trying to show some static text in Arabic on map. You can try this with any map file as it is nothing to do with layers from map. At run time (like on a button click), please add this layerObj lyr = new layerObj(mapObj); lyr.name = "TextAcetate"; lyr.status = mapscript.MS_ON; lyr.type = MS_LAYER_TYPE.MS_LAYER_ANNOTATION; lyr.labelcache = mapscript.MS_TRUE; double locationX = 50; double locationY = 50; lyr.transform = (int)mapscript.MS_FALSE; classObj layerClass = new classObj(lyr); //All label properties layerClass.label.size = 15; layerClass.label.type = MS_FONT_TYPE.MS_TRUETYPE; … … layerClass.label.encoding = "CP1256"; shapeObj shpObj = new shapeObj((int)MS_SHAPE_TYPE.MS_SHAPE_POINT); lineObj lnObj = new lineObj(); pointObj pt = new pointObj(locationX, locationY, 0, 0); lnObj.add(pt); shpObj.add(lnObj); shpObj.text = "لققافعععىىةةونه"; //I actually get this (in arabic) through user input lyr.addFeature(shpObj); mapObj.draw(); //Onto a picture box or save as file (In the map file, my output format is set to GD/PNG) Please let me know if you need more information. Thanks Murty From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Tamas Szekeres Sent: Friday, February 06, 2009 4:12 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues Please send me your example so that I could examine what's going on. Best regards, Tamas 2009/2/6 Murty Maganti Hi I tried with the suggested encoding but still no success. >From the output below, I guess ICONV support is included. E:\Utils\MapServer\Map Server 5.2 RC\ms4w\Apache\cgi-bin>mapserv -v MapServer version 5.2.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICO NV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUP PORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE Where can get some details on how to build the C# mapscript (Managed assembly only) from Visual Studio, keeping all unmanaged dlls from binaries from ms4w. I just want to give a try using MarshalAsAttribute. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Friday, February 06, 2009 3:02 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues Hi, You might want to try with encoding="ISO-8859-6" assuming you have libiconv compiled in. The c# mapscript doesn't specify explicit conversion during the marshaling. In this case I assume an unicode to Charset.Ansi conversion will automatically takes place by default. Best regards, Tamas 2009/2/6 Murty Maganti Hello I am having some issues using Arabic text as labels. I am using C# map script. I am setting the following at runtime labelObj label = classObj.label; label.encoding = "CP1256"; label.text = "some text in Arabic"; (At rune time in VS, I can see the text is actually in Arabic) But labels are displayed as '?'. Is there any conversion I need to do before setting the text value. How are the string represented in the underlying mapscript dll (ASCII or Unicode?). As I was reading in the MSDN, the default marshalling uses LPStr which is a single byte of ASCII. Does it mean that first I need to convert from Unicode to ASCII in C# before setting the value. Appreciate any help. Thanks Murty ___ mapserver-users m
RE: [mapserver-users] Encoding issues
HI I am doing a simple thing. I have a map file and trying to show some static text in Arabic on map. You can try this with any map file as it is nothing to do with layers from map. At run time (like on a button click), please add this layerObj lyr = new layerObj(mapObj); lyr.name = "TextAcetate”; lyr.status = mapscript.MS_ON; lyr.type = MS_LAYER_TYPE.MS_LAYER_ANNOTATION; lyr.labelcache = mapscript.MS_TRUE; double locationX = 50; double locationY = 50; lyr.transform = (int)mapscript.MS_FALSE; classObj layerClass = new classObj(lyr); //All label properties layerClass.label.size = 15; layerClass.label.type = MS_FONT_TYPE.MS_TRUETYPE; … … layerClass.label.encoding = “CP1256”; shapeObj shpObj = new shapeObj((int)MS_SHAPE_TYPE.MS_SHAPE_POINT); lineObj lnObj = new lineObj(); pointObj pt = new pointObj(locationX, locationY, 0, 0); lnObj.add(pt); shpObj.add(lnObj); shpObj.text = “لققافعععىىةةونه”; //I actually get this (in arabic) through user input lyr.addFeature(shpObj); mapObj.draw(); //Onto a picture box or save as file (In the map file, my output format is set to GD/PNG) Please let me know if you need more information. Thanks Murty From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Tamas Szekeres Sent: Friday, February 06, 2009 4:12 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues Please send me your example so that I could examine what's going on. Best regards, Tamas 2009/2/6 Murty Maganti Hi I tried with the suggested encoding but still no success. >From the output below, I guess ICONV support is included. E:\Utils\MapServer\Map Server 5.2 RC\ms4w\Apache\cgi-bin>mapserv -v MapServer version 5.2.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICO NV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUP PORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE Where can get some details on how to build the C# mapscript (Managed assembly only) from Visual Studio, keeping all unmanaged dlls from binaries from ms4w. I just want to give a try using MarshalAsAttribute. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Friday, February 06, 2009 3:02 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues Hi, You might want to try with encoding="ISO-8859-6" assuming you have libiconv compiled in. The c# mapscript doesn't specify explicit conversion during the marshaling. In this case I assume an unicode to Charset.Ansi conversion will automatically takes place by default. Best regards, Tamas 2009/2/6 Murty Maganti Hello I am having some issues using Arabic text as labels. I am using C# map script. I am setting the following at runtime labelObj label = classObj.label; label.encoding = "CP1256"; label.text = "some text in Arabic"; (At rune time in VS, I can see the text is actually in Arabic) But labels are displayed as '?'. Is there any conversion I need to do before setting the text value. How are the string represented in the underlying mapscript dll (ASCII or Unicode?). As I was reading in the MSDN, the default marshalling uses LPStr which is a single byte of ASCII. Does it mean that first I need to convert from Unicode to ASCII in C# before setting the value. Appreciate any help. Thanks Murty ___ 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] Encoding issues
Hi I tried with the suggested encoding but still no success. >From the output below, I guess ICONV support is included. E:\Utils\MapServer\Map Server 5.2 RC\ms4w\Apache\cgi-bin>mapserv -v MapServer version 5.2.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICO NV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUP PORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE Where can get some details on how to build the C# mapscript (Managed assembly only) from Visual Studio, keeping all unmanaged dlls from binaries from ms4w. I just want to give a try using MarshalAsAttribute. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Friday, February 06, 2009 3:02 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Encoding issues Hi, You might want to try with encoding="ISO-8859-6" assuming you have libiconv compiled in. The c# mapscript doesn't specify explicit conversion during the marshaling. In this case I assume an unicode to Charset.Ansi conversion will automatically takes place by default. Best regards, Tamas 2009/2/6 Murty Maganti Hello I am having some issues using Arabic text as labels. I am using C# map script. I am setting the following at runtime labelObj label = classObj.label; label.encoding = "CP1256"; label.text = "some text in Arabic"; (At rune time in VS, I can see the text is actually in Arabic) But labels are displayed as '?'. Is there any conversion I need to do before setting the text value. How are the string represented in the underlying mapscript dll (ASCII or Unicode?). As I was reading in the MSDN, the default marshalling uses LPStr which is a single byte of ASCII. Does it mean that first I need to convert from Unicode to ASCII in C# before setting the value. Appreciate any help. Thanks Murty ___ 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] Encoding issues
Hello I am having some issues using Arabic text as labels. I am using C# map script. I am setting the following at runtime labelObj label = classObj.label; label.encoding = "CP1256"; label.text = "some text in Arabic"; (At rune time in VS, I can see the text is actually in Arabic) But labels are displayed as '?'. Is there any conversion I need to do before setting the text value. How are the string represented in the underlying mapscript dll (ASCII or Unicode?). As I was reading in the MSDN, the default marshalling uses LPStr which is a single byte of ASCII. Does it mean that first I need to convert from Unicode to ASCII in C# before setting the value. Appreciate any help. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Junk text field values for ArcSDE layers
Hello I am having some issue with attribute (field) values for ArcSDE or Oracle Spatial layers. All text field values are becoming junk characters (after calling queryByRect() method). I am using C# map script and VS 2008. This is happening for text fields. Number and date fields seems to be fine. Is there any special encoding I need to handle in .Net when values are retrieved (shapeObj.values)? Same field values looks fine in ArcIMS and ArcMap. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] queryByRect throws an error
Hi Tamas Yes, there is a workaround to prevent this issue. I am already taking care in my code. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Wednesday, January 07, 2009 6:11 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] queryByRect throws an error Hi Murty, Yes, you're correct. By setting the template parameter of these internal layers like __embed__legend or __embed__scalebar causes the behaviour you've reported before. However I'm not sure it should be denoted as a bug since you could easily skip setting these parameters in your code. Skipping these layers in the mapserver query code may cause slower execution which is undesirable in most cases. I'm guessing there might be some other occurrences where altering these special layers in mapscript may also cause unexpected results. Best regards, Tamas 2009/1/7 Murty Maganti Hi Tamas Thanks for reply. These are extracts from my code to replicate the issue //Create map object mapObj map = new mapObj("MyMap.map"); //draw map map.draw() ; //Make sure some template name is defined. Otherwise, query will not be successful. for (int i = 0; i < map.numlayers; i++) { if (string.IsNullOrEmpty(m_map.getLayer(i).template)) { m_map.getLayer(i).template = "abc"; } } //Perform the query now map.queryByRect(map.extents); I think after a call to map.draw(), a new layer '__embed__scalebar' is added to layers collection. Setting template name to it is performing the query on scalebar layer as well. I think the scalebar layer is not satisfying these two conditions in msQueryByRect method of mapquery.c and hence getting used for query if(!msIsLayerQueryable(lp)) continue; if(lp->status == MS_OFF) continue; Please let me know if you need more info or you need any test application. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Tuesday, January 06, 2009 3:33 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] queryByRect throws an error Hi, Could you provide a code/mapfile sample to reconstruct the issue? I've never experienced such a problem, I've used this function many times though. Best regards, Tamas 2009/1/6 Murty Maganti mapObj.queryByRect(...) (using C# map script) is throwing following exception when there is an embedded scale bar on map. Exception message: "msShapefileOpen(): Unable to access file. No (NULL) filename provided.;msBuildPath: Unable to access file" Removing the scale bar from map file works fine. ___ 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] queryByRect throws an error
Hi Tamas Thanks for reply. These are extracts from my code to replicate the issue //Create map object mapObj map = new mapObj("MyMap.map"); //draw map map.draw() ; //Make sure some template name is defined. Otherwise, query will not be successful. for (int i = 0; i < map.numlayers; i++) { if (string.IsNullOrEmpty(m_map.getLayer(i).template)) { m_map.getLayer(i).template = "abc"; } } //Perform the query now map.queryByRect(map.extents); I think after a call to map.draw(), a new layer '__embed__scalebar' is added to layers collection. Setting template name to it is performing the query on scalebar layer as well. I think the scalebar layer is not satisfying these two conditions in msQueryByRect method of mapquery.c and hence getting used for query if(!msIsLayerQueryable(lp)) continue; if(lp->status == MS_OFF) continue; Please let me know if you need more info or you need any test application. Thanks Murty From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: Tuesday, January 06, 2009 3:33 PM To: Murty Maganti Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] queryByRect throws an error Hi, Could you provide a code/mapfile sample to reconstruct the issue? I've never experienced such a problem, I've used this function many times though. Best regards, Tamas 2009/1/6 Murty Maganti mapObj.queryByRect(...) (using C# map script) is throwing following exception when there is an embedded scale bar on map. Exception message: "msShapefileOpen(): Unable to access file. No (NULL) filename provided.;msBuildPath: Unable to access file" Removing the scale bar from map file works fine. ___ 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] queryByRect throws an error
mapObj.queryByRect(...) (using C# map script) is throwing following exception when there is an embedded scale bar on map. Exception message: "msShapefileOpen(): Unable to access file. No (NULL) filename provided.;msBuildPath: Unable to access file" Removing the scale bar from map file works fine. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Clear projecton from layerObj
Hello How to remove (or clear) a projection information set to a layer using C# map script. For example, I have set a projection information to a layer using the code layerObj.setProjection("init=EPSG:4326"); Now I want to clear this projection and set the layer to its original (unknown )status. I don't find any API on the layerObj to clear the projection information. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Exception using oracle spatial layer
Hello Users I am getting an exception when using oracle spatial layer. I am setting filter expression to the layer at run time(using C# map script, layerObj.setFilter()) and when I call draw() method on map after setting the filter, the following exception is thrown msDrawMap(): Image handling error. Failed to draw layer named 'Ward'.;msOracleSpatialLayerWhichShapes(): OracleSpatial error. Error: ORA-21710: argument is expecting a valid memory address of an object. Filter expression is very simple - 'WARDID in (1,2)'. The field and the values both exist on the layer. It works fine (i.e. image is generated) when I don't set the filter. Appreciate any help -Murty Maganti ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] setConfigOption is not working
I am trying to set a CONFIG option (using C# mapscript ) but it doesn't seems to work. In the map file (under layer block), I have set 'PLUGIN' parameter to the name of the DLL (without fully qualified path). I want to set the path prefix (MS_PLUGIN_DIR) at run time. Here is the C# code I am using, mapObj map = new mapObj("C:\\mymap.map"); map.setConfigOption("MS_PLUGIN_DIR", "C:\\my_plugins"); map.applyConfigOptions(); imageObj image=map.draw(); It is not loading the plug-in DLL. If I set this CONFIG parameter directly in the map file, it works fine. Also, when I debug and check the value of 'plugin_library' on layerObj, it does not contain the prefix of plug-in directory. Did anyone had the same issue? Am I missing any steps here. Appreciate any help. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users