Re: [mapserver-users] Mapscript C# and OWSRequest parameters
Hi all, Well, that route was a short one. Yes, I can call installStdinFromBuffer, but actually reading something via bufferRead: int msIO_bufferRead( void *cbData, void *data, int byteCount ) { (void)cbData; (void)data; (void)byteCount; /* not implemented yet. */ return 0; } Unless I’m missing something, this isn’t possible, yet. I find it hard to believe no-one uses MapServer to handle WFS Post requests, so I’m pretty sure I’m missing something? Regards, Jelmer Baas From: mapserver-users On Behalf Of Seth G Sent: donderdag 27 mei 2021 20:35 To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Mapscript C# and OWSRequest parameters Hi Jelmer, I think you'd have to use mapscript.msIO_installStdinFromBuffer to read data in. See https://mapserver.org/development/rfc/ms-rfc-16.html#io-hooking although I'm not sure if the approach works or was fully implemented. Let us know how you get on, Seth -- web:http://geographika.co.uk twitter: @geographika On Thu, May 27, 2021, at 10:39 AM, Jelmer Baas wrote: Hello, For a new project, I’ve decided to pickup MapScript again to function as an internal (back-end) WFS server. I use the OWSRequest class, which works fine when I fill it with loadParamsFromURL() – in the case of Get requests. I can’t seem to figure out a way to get my POST data into this object, though. It has a loadParams method, but because I’m not running as a CGI application (back-end app without a webserver), this doesn’t do anything. I also tried setting postrequest property and then calling the loadParams, setting Environment variables, etc. No error, no exception, just -1 value from NumParams. Any suggestions on how to proceed? Regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org<mailto:mapserver-users%40lists.osgeo.org> https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapscript C# and OWSRequest parameters
Hi Seth, Thanks for the pointer, I’ll give this a try. (Your mail got caught in a spam filter; apologies) Regards, Jelmer Baas From: mapserver-users On Behalf Of Seth G Sent: donderdag 27 mei 2021 20:35 To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Mapscript C# and OWSRequest parameters Hi Jelmer, I think you'd have to use mapscript.msIO_installStdinFromBuffer to read data in. See https://mapserver.org/development/rfc/ms-rfc-16.html#io-hooking although I'm not sure if the approach works or was fully implemented. Let us know how you get on, Seth -- web:http://geographika.co.uk twitter: @geographika On Thu, May 27, 2021, at 10:39 AM, Jelmer Baas wrote: Hello, For a new project, I’ve decided to pickup MapScript again to function as an internal (back-end) WFS server. I use the OWSRequest class, which works fine when I fill it with loadParamsFromURL() – in the case of Get requests. I can’t seem to figure out a way to get my POST data into this object, though. It has a loadParams method, but because I’m not running as a CGI application (back-end app without a webserver), this doesn’t do anything. I also tried setting postrequest property and then calling the loadParams, setting Environment variables, etc. No error, no exception, just -1 value from NumParams. Any suggestions on how to proceed? Regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org<mailto:mapserver-users%40lists.osgeo.org> https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapscript C# and OWSRequest parameters
Hi all, I had some issues getting subscribed. Did this email arrive? If so, does anyone have some insights, even if it's just a pointer to a place to continue my search? Regards, Jelmer Baas From: mapserver-users On Behalf Of Jelmer Baas Sent: donderdag 27 mei 2021 10:39 To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] Mapscript C# and OWSRequest parameters Hello, For a new project, I've decided to pickup MapScript again to function as an internal (back-end) WFS server. I use the OWSRequest class, which works fine when I fill it with loadParamsFromURL() - in the case of Get requests. I can't seem to figure out a way to get my POST data into this object, though. It has a loadParams method, but because I'm not running as a CGI application (back-end app without a webserver), this doesn't do anything. I also tried setting postrequest property and then calling the loadParams, setting Environment variables, etc. No error, no exception, just -1 value from NumParams. Any suggestions on how to proceed? Regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Mapscript C# and OWSRequest parameters
Hello, For a new project, I've decided to pickup MapScript again to function as an internal (back-end) WFS server. I use the OWSRequest class, which works fine when I fill it with loadParamsFromURL() - in the case of Get requests. I can't seem to figure out a way to get my POST data into this object, though. It has a loadParams method, but because I'm not running as a CGI application (back-end app without a webserver), this doesn't do anything. I also tried setting postrequest property and then calling the loadParams, setting Environment variables, etc. No error, no exception, just -1 value from NumParams. Any suggestions on how to proceed? Regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Segfaults with MapScript from Python
Hi List, Some of my automated renders are failing because Python crashes with an Segmentation fault. I've finally found at least some logs of this: Feb 12 16:16:19 vm-ctwrender07 kernel: [276759.889265] traps: python[8002] general protection ip:7f104ec4f50f sp:7fff17d8d790 error:0 in libmapserver.so.6.4.1[7f104eb91000+1d8000] Feb 12 15:08:01 vm-ctwrender07 kernel: [272664.046597] traps: python[7841] general protection ip:7f80558877b6 sp:7fff641f27c0 error:0 in libmapserver.so.6.4.1[7f80557c9000+1d8000] Feb 12 13:53:01 vm-ctwrender07 kernel: [268166.881041] python[7614]: segfault at fffc ip 7f805588750f sp 7fff641f27c0 error 5 in libmapserver.so.6.4.1[7f80557c9000+1d8000] Unfortunatly, I have no idea how to continue. I suspect this has something todo with odd font rendering (too large, too small), since I had issues with that before. Can someone match these addresses with code and find out where it crashes? Thanks in advance! Regards, Jelmer ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Segfaults with MapScript from Python
The code isn't all that complex, not much more than three layers with a postgis source and using an ogr_style column. I'll do my best to create a stripped-down script and test dataset tomorrow. -- Jelmer Van: Dan Little [theduckylit...@gmail.com] Verzonden: donderdag 12 februari 2015 16:55 Aan: Jelmer Baas CC: mapserver-users@lists.osgeo.org Onderwerp: Re: [mapserver-users] Segfaults with MapScript from Python I don't see any debugging symbols in there making life a little bit more difficult. Is your Python code very complex? Could a useful snippet be posted to a gist? On Thu, Feb 12, 2015 at 9:44 AM, Jelmer Baas b...@speerit.nl wrote: Hi List, Some of my automated renders are failing because Python crashes with an Segmentation fault. I've finally found at least some logs of this: Feb 12 16:16:19 vm-ctwrender07 kernel: [276759.889265] traps: python[8002] general protection ip:7f104ec4f50f sp:7fff17d8d790 error:0 in libmapserver.so.6.4.1[7f104eb91000+1d8000] Feb 12 15:08:01 vm-ctwrender07 kernel: [272664.046597] traps: python[7841] general protection ip:7f80558877b6 sp:7fff641f27c0 error:0 in libmapserver.so.6.4.1[7f80557c9000+1d8000] Feb 12 13:53:01 vm-ctwrender07 kernel: [268166.881041] python[7614]: segfault at fffc ip 7f805588750f sp 7fff641f27c0 error 5 in libmapserver.so.6.4.1[7f80557c9000+1d8000] Unfortunatly, I have no idea how to continue. I suspect this has something todo with odd font rendering (too large, too small), since I had issues with that before. Can someone match these addresses with code and find out where it crashes? Thanks in advance! Regards, Jelmer ___ 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] Annotation label with styleitem auto uses bitmap font
Update on this issue: MapInfo didn't have a font specified for the TEXT objects. This meant that MapServer somehow didn't use the fallback font (default), but switched to its built-in font. I've now manually changed all fonts to Arial, added a valid default font in my fontset, and it works! (And it looks beautiful :) For short-term, I'll make sure our conversion software adds a valid font, but I would like it if someone can investigate this further (MID/MIF or TAB file available on request), since it's odd behavious imho. Thanks, Jelmer -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jelmer Baas Sent: woensdag 5 november 2014 21:39 To: humbe...@pastoraldacrianca.org.br; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Annotation label with styleitem auto uses bitmap font Hi Humberto, Thanks for the quick reply. I have not tried any encoding setting, because it's obviously using the bitmap font. Or would that force MapServer to use a TTF font? I'm also not sure where to add the FONT property. On the class? Or Layer? I tried both, had no effect. I believe I may have a bigger problem, maybe MapServer is falling back to the built-in font because it can't open the TTF files, but I have no idea how to test that (or confirm or deny my suspicions, because I can't find any debugging / logging info). Regards, Jelmer -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Humberto Cereser Ibanez Sent: woensdag 5 november 2014 17:49 To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Annotation label with styleitem auto uses bitmap font Hi Jelmer, On Wed, 2014-11-05 at 15:30 +, Jelmer Baas wrote: - Setting class.label properties; this has been removed in 6.2 Did you try set LABEL properties: FONT to TRUETYPE and ENCODING to UTF8 or something like that? Regards, ___ 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] Annotation label with styleitem auto uses bitmap font
Hi all, I have some converted AutoCAD files in MapInfo format that I'm showing via MapScript (up-to-date, via apt get). To show all components, each TAB file has both a 'line' layer (styleitem auto) and an 'annotation' layer (also set to styleitem auto). This has worked fine for ages, but there are two issues: - Special characters aren't displayed - We now have a new file, which has an odd font size Because of this new file, I'm beging flooded with this message: msGetRasterTextBBox(): General error message. selected renderer does not support bitmap font size 13 Both issues obviously mean MapServer is using its built-in bitmap font. Is there a way to override this? I've tried a few options already: - Switching to PNG instead of GIF output format - Setting class.label properties; this has been removed in 6.2 - Creating a new labelObj, and adding it via class.addLabel; this manages to crash my python script (not getting caught in try/catch) without leaving any logs when styleitem is still set to auto - Adding a default and Arial entry in my fontlist file. This seems to be ignored. Furthermore, I can't seem to get ANY logging from MapScript. I've tried setting debug to MS_TRUE in the layer, mapfile, class, etc. Log file is being created (in /tmp) but remains empty. Am I doing something wrong? Missing something? Any help would be greatly appreciated! Regards, Jelmer ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] [Python+MapScript] Convert imageObj to PIL Image
Hi All, I've been testing today in Python, trying to get a MapScript imageObj into an python Image object. This works via the following code: map.transparent = MS_ON map.selectOutputFormat('png8') map.outputformat.imagemode = MS_IMAGEMODE_RGBA map.outputformat.transparent = MS_ON img = map.draw() mem_png = StringIO.StringIO(img.saveToString()) _img = Image.open(mem_png) However, the _img file lost its transparency, even though it's still (or again) PNG. There MUST be a better way of getting the PNG file into PIL, right? Something besides writing it to a tempfile, opening it, and deleting it? On a side note, I only use this rendered image temporarily, I only need to cut it up in smaller bits and return those to my client. So if there's some sort of format that supports transparcency but without the PNG compression overhead, that would be even better! Regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] [Python+MapScript] Convert imageObj to PIL Image
Oh, wow, that was so simple. I changed map.selectOutputFormat('png8') to map.selectOutputFormat('png24') And done. Strangely, though, saving it to a file and re-opening *does* work! Thanks for the quick reply! -- Jelmer -Original Message- From: thomas bonfort [mailto:thomas.bonf...@gmail.com] Sent: Friday, September 07, 2012 15:50 To: Jelmer Baas Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] [Python+MapScript] Convert imageObj to PIL Image IIRC, PIL does not support 8bit pngs with transparency, so writing it to a file won't help. If you need alpha, you'll have to stick with 32bit pngs. -- thomas On Fri, Sep 7, 2012 at 3:35 PM, Jelmer Baas b...@speerit.nl wrote: Hi All, I've been testing today in Python, trying to get a MapScript imageObj into an python Image object. This works via the following code: map.transparent = MS_ON map.selectOutputFormat('png8') map.outputformat.imagemode = MS_IMAGEMODE_RGBA map.outputformat.transparent = MS_ON img = map.draw() mem_png = StringIO.StringIO(img.saveToString()) _img = Image.open(mem_png) However, the _img file lost its transparency, even though it's still (or again) PNG. There MUST be a better way of getting the PNG file into PIL, right? Something besides writing it to a tempfile, opening it, and deleting it? On a side note, I only use this rendered image temporarily, I only need to cut it up in smaller bits and return those to my client. So if there's some sort of format that supports transparcency but without the PNG compression overhead, that would be even better! Regards, Jelmer Baas ___ 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] Itemnquery slow in big TAB file; slow on Oracle as well
Hello List, I have a query to retrieve geometry from a TAB file: mapserv.exe?mode=itemquerymap= query.mapmapext=-7+28+50+70layers=MYLAYERqlayer= MYLAYER qstring=('[IDCOLUMN]' IN '2550643') This is my simplified Layer definition: LAYER NAME MYLAYER TYPE LINE CONNECTIONTYPE OGR CONNECTION c:\temp\MYLAYER.TAB CLASS NAME Test END METADATA qstring_validation_pattern '^' END END To query this TAB file, MapServer needs about 20 seconds. MapInfo needs about 20ms, so MapServer is obviously not using the index on this column. I tried changing this to Oracle Spatial, but then I bump into another problem: the query contains a spatial clause (which isn't needed): SELECT IDCOLUMN FROM MYLAYER WHERE 'IDCOLUMN' IN '2550643' AND SDO_FILTER( GEOLOC, MDSYS.SDO_GEOMETRY(2003, 90112, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-7,28,50,70) ),'querytype=window') = 'TRUE' This also takes about 10 seconds. Without the AND SDO_FILTER() part it takes a few milliseconds. So two questions, I guess. Can I make MapServer use the index on the IDCOLUMN column, and, can I tell Mapserver to skip the SDO_FILTER part on Oracle? Oh, I'm currently using MapServer 5.6 but tried 6.0 as well. Thank you, Regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] RE: Error with WFS request from MapInfo
Oh, wow, thanks to adding the wfs_extent and fixing a few other mistakes I found, I actually got it to work! Thanks a lot for the quick answers! Regards, Jelmer Baas -Original Message- From: Rahkonen Jukka [mailto:jukka.rahko...@mmmtike.fi] Sent: vrijdag 19 augustus 2011 12:41 To: Jelmer Baas; 'mapserver-users@lists.osgeo.org' Subject: Re: Error with WFS request from MapInfo Hi, You can also try to add this to LAYER wfs_extent Description: (Optional) Used for the layer's BoundingBox tag for cases where it is impossible (or very inefficient) for MapServer to probe the data source to figure its extents. The value for this metadata is minx miny maxx maxy separated by spaces, with the values in the layer's projection units. If wfs_extent is provided then it has priority and MapServer will NOT try to read the source file's extents. And of course you should always be the boss and test with the basic hand written requests first before letting the GIS client to add for the complexity. Something like these: http://myserver.xx/cgi- bin/mapserv.exe?service=wfsversion=1.0.0request=getCapabilitiesmap =path/to/the/wfs.map http://myserver.xx/cgi- bin/mapserv.exe?service=wfsversion=1.0.0request=DescribeFeatureTyp etypeName=mytestmap=path/to/the/wfs.map http://myserver.xx/cgi- bin/mapserv.exe?service=wfsversion=1.0.0request=GetFeaturetypeNa me=mytestmaxFeatures=10map=path/to/the/wfs.map -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: Jelmer Baas [mailto:b...@speerit.nl] Lähetetty: 19. elokuuta 2011 12:45 Vastaanottaja: Rahkonen Jukka; 'mapserver-users@lists.osgeo.org' Aihe: RE: Error with WFS request from MapInfo Jukka, Thanks for your pointers, I'll check out other WFS servers and see how far I get. I did add the extent as EXTENT -180 -90 180 90 in the map file but that doesn't seem to change anything. Regards Jelmer Baas -Original Message- From: Rahkonen Jukka [mailto:jukka.rahko...@mmmtike.fi] Sent: vrijdag 19 augustus 2011 11:05 To: Jelmer Baas; 'mapserver-users@lists.osgeo.org' Subject: Re: Error with WFS request from MapInfo Hi, I would start by addind EXTENT to MAP level. WFS 1.0.0 does not support reprojection so select the desired output srsName and use that as map level PROJECTION. Express extents to suit that projection. Mapserver has been pretty poor WFS server for real GIS clients but it is getting better. However, I cannot promise you any amazing interoperability. At least I would recommend you to update to 6.0. If you want to get some good feelings about WFS consider having a try with TinyOWS first. It works only with PostGIS (v. 1.5 or higher) but that looks to be OK for you. I have managed to read features from TinyOWS with Kosmo GIS, gvSIG, QGis, uDig, ArcGIS, MapInfo, Gaia, SIS Map Browser and iGeoDesktop. With some clients even attribute and spatial filters work. Come back to Mapserver WFS later and start making bug reports. Glad that you learned already to study the POST traffic, it is really a must with WFS debugging. I am using Fiddler for that purpose. MapInfo seems to send a most basic WFS call (or stupid, just orders the whole layer from you) so that should not be a trouble in this case. Once you get the extents corrected you can continue and wait excited if MapInfo will have troubles with checking the schemas and parsing the GML that comes from Mapserver. -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Jelmer Baas Lähetetty: 19. elokuuta 2011 11:26 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: [mapserver-users] Error with WFS request from MapInfo Hello list, I've been struggling with this issue for a while, now. When I try to add a WFS layer in MapInfo, I receive the following error (from the mapserver logfile): prepare_database(): Query error. Error declaring cursor: ERROR: BOX3D parser - couldnt parse. It should look like: BOX3D(xmin ymin zmin,xmax ymax zmax) or BOX3D(xmin ymin,xmax ymax) LINE 1: ...:text from pandactueel WHERE geometrie setSRID('BOX3D(-1 ^ With query string: DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(geo)),'NDR'),oid::text from mytable WHERE geo setSRID('BOX3D(-1.#INF -1.#INF,1390604146415.56 -16080812.3872859)'::BOX3D, 28992 ) The layer itself works, via normal GetMap requests. This is my mapfile: MAP NAME TEST STATUS ON UNITS meters FONTSET fontset.txt DEBUG 5 CONFIG MS_ERRORFILE c:\temp\mapserver.log IMAGECOLOR 255
[mapserver-users] Error with WFS request from MapInfo
Hello list, I've been struggling with this issue for a while, now. When I try to add a WFS layer in MapInfo, I receive the following error (from the mapserver logfile): prepare_database(): Query error. Error declaring cursor: ERROR: BOX3D parser - couldnt parse. It should look like: BOX3D(xmin ymin zmin,xmax ymax zmax) or BOX3D(xmin ymin,xmax ymax) LINE 1: ...:text from pandactueel WHERE geometrie setSRID('BOX3D(-1 ^ With query string: DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(geo)),'NDR'),oid::text from mytable WHERE geo setSRID('BOX3D(-1.#INF -1.#INF,1390604146415.56 -16080812.3872859)'::BOX3D, 28992 ) The layer itself works, via normal GetMap requests. This is my mapfile: MAP NAME TEST STATUS ON UNITS meters FONTSET fontset.txt DEBUG 5 CONFIG MS_ERRORFILE c:\temp\mapserver.log IMAGECOLOR 255 55 255 OUTPUTFORMAT NAME aggpng24 DRIVER AGG/PNG TRANSPARENT ON IMAGEMODE RGBA MIMETYPE image/png EXTENSION png END WEB METADATA wms_title TEST wfs_title TEST wms_srs epsg:4326 epsg:900913 wfs_srs epsg:4326 epsg:900913 wms_onlineresource *** wfs_onlineresource *** END # METADATA END #web SYMBOLSET symbols_mapinfo2.sym PROJECTION init=epsg:4326 END LAYER TYPE POLYGON STATUS ON DUMP TRUE CONNECTIONTYPE POSTGIS CONNECTION host=localhost dbname=TEST user=postgres password=*** port=5432 DATA geo from mytable using unique oid using srid=28992 NAME mytest CLASS NAME mytest STYLE COLOR 0 0 250 OUTLINECOLOR 0 250 0 END END PROJECTION init=epsg:28992 END MINSCALE 1 MAXSCALE 8000 METADATA wms_title mytest wms_srs epsg:4326 epsg:900913 wfs_title mytest wfs_srs epsg:4326 epsg:900913 gml_featureid oid gml_include_items all END # METADATA END END # Map File MapInfo sends its requests as post (I'd prefer get...) and after using a packet sniffer I found out it sends this: ?xml version=1.0 encoding=utf-8? GetFeature version=1.0.0 service=WFS outputFormat=GML2 xmlns:ms=http://mapserver.gis.umn.edu/mapserver; xmlns:gml=http://www.opengis.net/gml; xmlns:ogc=http://www.opengis.net/ogc; xmlns=http://www.opengis.net/wfs; xsi:schemaLocation=http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;Query typeName= mytest//GetFeature I use MapServer version 5.4.2, by the way. Can anyone tell me what I'm missing? Should I add extends in the MapFile or something? And where do those weird numbers come from? Regards, Jelmer Baas Speer IT B.V. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Pyhton mapscript and styleitem auto
Tamas, Thanks for the reply. This setting does indeed work, however: you still need to define a (empty) class for the layer, otherwise it’s simply invisible. Might I suggest documenting this? Thanks again, Regards, Jelmer From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: woensdag 23 maart 2011 19:05 To: Jelmer Baas Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Pyhton mapscript and styleitem auto Hi, If you set the styleitem property of the layerObj to the string 'AUTO' that should be equivalent to the same setting in the mapfile. Best regards, Tamas 2011/3/23 Jelmer Baas b...@speerit.nlmailto:b...@speerit.nl Hi all, I've managed to build my first Python project and use mapscript to open tab files and render an image. The styling still remains, though. Since I use OGR to open MapInfo TAB files, I'd like to use mapscript equivalent of styleitem auto, if possible. Can someone please point me in the right direction? Regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.orgmailto: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] Pyhton mapscript and styleitem auto
Hi all, I've managed to build my first Python project and use mapscript to open tab files and render an image. The styling still remains, though. Since I use OGR to open MapInfo TAB files, I'd like to use mapscript equivalent of styleitem auto, if possible. Can someone please point me in the right direction? Regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Pyhton mapscript and styleitem auto
Jeff, The URL you've given describes the usage of styleitem auto in a map file; I need the (Python) MapScript version of that ... Thanks, -- Jelmer -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users- boun...@lists.osgeo.org] On Behalf Of Jeff McKenna Sent: woensdag 23 maart 2011 13:20 To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Pyhton mapscript and styleitem auto On 11-03-23 7:33 AM, Jelmer Baas wrote: Hi all, I've managed to build my first Python project and use mapscript to open tab files and render an image. The styling still remains, though. Since I use OGR to open MapInfo TAB files, I'd like to use mapscript equivalent of styleitem auto, if possible. Can someone please point me in the right direction? For the record, I just checked and the old demos of STYLEITEM AUTO with TAB files are still working, and their mapfiles are available: http://demo.mapserver.org/ -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] MapServer, WFS and Oracle
Hello list, I'm trying to get MapServer running as a WFS server with an Oracle data source. When using TAB files I have no problem, also using the Oracle datasource and letting MapServer draw it (WMS) works properly. However, the WFS request only returns one result (a correct one). My total resulting XML is: wfs:FeatureCollection xsi:schemaLocation=http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://mapserver.gis.umn.edu/mapserver http://x.x.x/scripts/mapserv.exe?map=address.mapSERVICE=WFSVERSION=1.0 .0REQUEST=DescribeFeatureTypeTYPENAME=addressOUTPUTFORMAT=XMLSCHEMA gml:boundedBy gml:Box srsName=EPSG:4326 gml:coordinates5.172200,52.038485 5.173701,52.038853/gml:coordinates /gml:Box /gml:boundedBy /wfs:FeatureCollection There should be more results (confirmed by the WMS image and by monitoring the query in Oracle). I also set DUMP to true and gml_include_items all in my layer METADATA, so I also expected more fields. My layer definition is as follows: LAYER NAME address TYPE point CONNECTIONTYPE oraclespatial DATA GEOLOC FROM ADDRESS USING SRID 90112 VERSION 10g CONNECTION x/y...@z DUMP TRUE PROCESSING CLOSE_CONNECTION=DEFER CLASS SYMBOL circle OUTLINECOLOR 255 0 0 SIZE 6 NAME address END PROJECTION init=epsg:28992 END METADATA wfs_title address wfs_srs EPSG:28992 EPSG:900913 wms_title address wms_srs EPSG:28992 EPSG:900913 gml_featureid ID gml_include_items all END END Any idea what I'm doing wrong? I'm using MapServer 5.4.2 with Oracle 10g. Regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] MapServer, WFS and Oracle
Jukka, Thanks for the quick reply. The request is: mapserv.exe?map=address.maptypename=addressSERVICE=WFSVERSION=1.0.0REQUEST=GetFeatureSRS=EPSG%3A4326BBOX=1.171946062917749,52.038473357169345,5.173921509856943,52.03887593415947 (Very zoomed out) If this is another projection issue, I'm going to eat my shoe. ;) Regards, Jelmer -Original Message- From: Rahkonen Jukka [mailto:jukka.rahko...@mmmtike.fi] Sent: woensdag 18 november 2009 11:51 To: Jelmer Baas; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] MapServer, WFS and Oracle Hi, You seem not to get even a single feature back, all you get is an empty bounding box. How does you GetFeature request look like? -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Jelmer Baas Lähetetty: 18. marraskuuta 2009 12:11 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: [mapserver-users] MapServer, WFS and Oracle Hello list, I'm trying to get MapServer running as a WFS server with an Oracle data source. When using TAB files I have no problem, also using the Oracle datasource and letting MapServer draw it (WMS) works properly. However, the WFS request only returns one result (a correct one). My total resulting XML is: wfs:FeatureCollection xsi:schemaLocation=http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://mapserver.gis.umn.edu/mapserver http://x.x.x/scripts/mapserv.exe?map=address.mapSERVICE=WFSV ERSION=1.0 .0REQUEST=DescribeFeatureTypeTYPENAME=addressOUTPUTFORMAT=X MLSCHEMA gml:boundedBy gml:Box srsName=EPSG:4326 gml:coordinates5.172200,52.038485 5.173701,52.038853/gml:coordinates /gml:Box /gml:boundedBy /wfs:FeatureCollection There should be more results (confirmed by the WMS image and by monitoring the query in Oracle). I also set DUMP to true and gml_include_items all in my layer METADATA, so I also expected more fields. My layer definition is as follows: LAYER NAME address TYPE point CONNECTIONTYPE oraclespatial DATA GEOLOC FROM ADDRESS USING SRID 90112 VERSION 10g CONNECTION x/y...@z DUMP TRUE PROCESSING CLOSE_CONNECTION=DEFER CLASS SYMBOL circle OUTLINECOLOR 255 0 0 SIZE 6 NAME address END PROJECTION init=epsg:28992 END METADATA wfs_title address wfs_srs EPSG:28992 EPSG:900913 wms_title address wms_srs EPSG:28992 EPSG:900913 gml_featureid ID gml_include_items all END END Any idea what I'm doing wrong? I'm using MapServer 5.4.2 with Oracle 10g. Regards, Jelmer Baas ___ 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] MapServer, WFS and Oracle
Bart, Jukka, The shoes taste wonderful. The request comes from OpenLayers, and I can't find how to change it to WFS 1.1, but that'll be another Google search, soon. Right now I thought it'd be smart to see if I at least can get *some* results, manually. This however also fails. My current request mapserv.exe?map=address.maptypename=addressSERVICE=WFSVERSION=1.0.0REQUEST=GetFeatureSRS=EPSG%3A28992BBOX=125474.00,381967.999850,206652.000100,470382.335300 The coordinates come from a previous request (gml:boundedBy) and should definatly contain some points. An select count(id) from address where x 125474 and y 206652 and x 381967 and y 470382 returns 24002 rows (the geo object is also saved as plain X/Y). For completeness, here's my current MAP file: MAP NAME Test STATUS ON UNITS meters FONTSET fontset.txt OUTPUTFORMAT NAME aggpng24 DRIVER AGG/PNG TRANSPARENT ON IMAGEMODE RGBA MIMETYPE image/png EXTENSION png END WEB METADATA wms_title Test wfs_title Test wms_srs EPSG:28992 wfs_srs EPSG:28992 wms_onlineresource url wfs_onlineresource url END # METADATA END #web SYMBOLSET symbols_mapinfo2.sym PROJECTION init=epsg:28992 END LAYER NAME address TYPE point CONNECTIONTYPE oraclespatial DATA GEOLOC FROM ADDRESS USING SRID 90112 VERSION 10g CONNECTION x/y/z DUMP TRUE PROCESSING CLOSE_CONNECTION=DEFER CLASS SYMBOL circle OUTLINECOLOR 255 0 0 SIZE 6 NAME address END PROJECTION init=epsg:28992 END METADATA wfs_title address wfs_srs EPSG:28992 wms_title address wms_srs EPSG:28992 gml_featureid ZIPCODE gml_include_items ZIPCODE END END END # Map File As you can see, I use the Dutch projection system everywhere. Yet the request only returns: ?xml version='1.0' encoding=ISO-8859-1 ? wfs:FeatureCollection xmlns:ms=http://mapserver.gis.umn.edu/mapserver; xmlns:wfs=http://www.opengis.net/wfs; xmlns:gml=http://www.opengis.net/gml; xmlns:ogc=http://www.opengis.net/ogc; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://mapserver.gis.umn.edu/mapserver url/mapserv.exe?map=address.mapamp;SERVICE=WFSamp;VERSION=1.0.0amp;REQUEST=DescribeFeatureTypeamp;TYPENAME=addressamp;OUTPUTFORMAT=XMLSCHEMA gml:boundedBy gml:Box srsName=EPSG:28992 gml:coordinates125474.00,381967.999850 206652.000100,470382.335300/gml:coordinates /gml:Box /gml:boundedBy /wfs:FeatureCollection Any more help would be greatly appreciated. Regards, Jelmer Hi, I hope you have tasty shoes. WFS 1.0.0 does officially support only one projection. I am not sure how Marverver has implemented it, with Geoserver it is possible to use also other projections by adding projection parameter to request. However, I would try GetFeature request by using BBOX in native projection. -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Jelmer Baas Lähetetty: 18. marraskuuta 2009 13:06 Vastaanottaja: Rahkonen Jukka; mapserver-users@lists.osgeo.org Aihe: RE: [mapserver-users] MapServer, WFS and Oracle Jukka, Thanks for the quick reply. The request is: mapserv.exe?map=address.maptypename=addressSERVICE=WFSVERSI ON=1.0.0REQUEST=GetFeatureSRS=EPSG%3A4326BBOX=1.17194606291 7749,52.038473357169345,5.173921509856943,52.03887593415947 (Very zoomed out) If this is another projection issue, I'm going to eat my shoe. ;) Regards, Jelmer -Original Message- From: Rahkonen Jukka [mailto:jukka.rahko...@mmmtike.fi] Sent: woensdag 18 november 2009 11:51 To: Jelmer Baas; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] MapServer, WFS and Oracle Hi, You seem not to get even a single feature back, all you get is an empty bounding box. How does you GetFeature request look like? -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Jelmer Baas Lähetetty: 18. marraskuuta 2009 12:11
RE: [mapserver-users] MapServer, WFS and Oracle
Jukka, Thanks for the little tip! I just tested the test url you gave me, and it also didn't return anything. After checking the log files I found this: [Wed Nov 18 13:50:46 2009].176000 msOracleSpatialLayerGetShape(): OracleSpatial error. Error parsing OracleSpatial DATA variable for query. To execute query functions you need to define one unique column [USING UNIQUE #column] Chaning the query from DATA GEOLOC FROM ADDRESS USING SRID 90112 VERSION 10g to DATA GEOLOC FROM ADDRESS USING UNIQUE ID SRID 90112 VERSION 10g Did the trick. Not too bright of me that I didn't check the log file, I admit, but might I recommend outputting this message to the client anyway? Thanks for the help, I can now continue fiddling with projections, my favorite! *sigh* :) Regards, Jelmer -Original Message- From: Rahkonen Jukka [mailto:jukka.rahko...@mmmtike.fi] Sent: woensdag 18 november 2009 13:47 To: Jelmer Baas; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] MapServer, WFS and Oracle Hi, If you haven't done it yet, check that you can for sure get some data out of your service. mapserv.exe?map=address.maptypename=addressSERVICE=WFSVERSI ON=1.0.0REQUEST=GetFeatureMaxFeatures=10 If yes, have a look at the returned data and see what kind of coordinates it likes to send you. Just to be sure that your BBOX is correct. Also, add DEBUG=5 to the layer definitions and look at the Mapserver errorfile to understand more about what is happening. -Jukka- -Alkuperäinen viesti- Lähettäjä: Jelmer Baas [mailto:b...@speerit.nl] Lähetetty: 18. marraskuuta 2009 14:39 Vastaanottaja: Rahkonen Jukka; mapserver-users@lists.osgeo.org Aihe: RE: [mapserver-users] MapServer, WFS and Oracle Bart, Jukka, The shoes taste wonderful. The request comes from OpenLayers, and I can't find how to change it to WFS 1.1, but that'll be another Google search, soon. Right now I thought it'd be smart to see if I at least can get *some* results, manually. This however also fails. My current request mapserv.exe?map=address.maptypename=addressSERVICE=WFSVERSI ON=1.0.0REQUEST=GetFeatureSRS=EPSG%3A28992BBOX=125474.0 0,381967.999850,206652.000100,470382.335300 The coordinates come from a previous request (gml:boundedBy) and should definatly contain some points. An select count(id) from address where x 125474 and y 206652 and x 381967 and y 470382 returns 24002 rows (the geo object is also saved as plain X/Y). For completeness, here's my current MAP file: MAP NAME Test STATUS ON UNITS meters FONTSET fontset.txt OUTPUTFORMAT NAME aggpng24 DRIVER AGG/PNG TRANSPARENT ON IMAGEMODE RGBA MIMETYPE image/png EXTENSION png END WEB METADATA wms_title Test wfs_title Test wms_srs EPSG:28992 wfs_srs EPSG:28992 wms_onlineresource url wfs_onlineresource url END # METADATA END #web SYMBOLSET symbols_mapinfo2.sym PROJECTION init=epsg:28992 END LAYER NAME address TYPE point CONNECTIONTYPE oraclespatial DATA GEOLOC FROM ADDRESS USING SRID 90112 VERSION 10g CONNECTION x/y/z DUMP TRUE PROCESSING CLOSE_CONNECTION=DEFER CLASS SYMBOL circle OUTLINECOLOR 255 0 0 SIZE 6 NAME address END PROJECTION init=epsg:28992 END METADATA wfs_title address wfs_srs EPSG:28992 wms_title address wms_srs EPSG:28992 gml_featureid ZIPCODE gml_include_items ZIPCODE END END END # Map File As you can see, I use the Dutch projection system everywhere. Yet the request only returns: ?xml version='1.0' encoding=ISO-8859-1 ? wfs:FeatureCollection xmlns:ms=http://mapserver.gis.umn.edu/mapserver; xmlns:wfs=http://www.opengis.net/wfs; xmlns:gml=http://www.opengis.net/gml; xmlns:ogc=http://www.opengis.net/ogc; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://mapserver.gis.umn.edu/mapserver url/mapserv.exe?map=address.mapamp;SERVICE=WFSamp;VERSION= 1.0.0amp;REQUEST=DescribeFeatureTypeamp;TYPENAME=addressamp ;OUTPUTFORMAT=XMLSCHEMA gml:boundedBy gml:Box srsName=EPSG:28992 gml:coordinates125474.00,381967.999850 206652.000100,470382.335300/gml:coordinates
RE: [mapserver-users] MapServer, WFS and Oracle
Michael, Thanks for the tip. Indeed, I still need to add these tags, but since my dataset wasn't working at all, I didn't do anything with that, yet. Right now the query takes 16-20sec, so some optimization is in order. Regards, Jelmer Jelmer, Also, when using WFS from Oracle, you should add the wfs_extent or ows_extent metadata tags. Otherwise MapServer will request Oracle to do a convex_hull to get the extent of your data. On large datasets, this can take a while. Setting the extent metadata tag bypasses this check and uses the value you specify. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] MapServer, WFS and Oracle
Bart, Thanks for the tip. I'll be using more Oracle access in the future, so I guess I'll jump in the Compile-MapServer-On-Windows maze this evening. Regards, Jelmer Jelmer, you might want to check out Mapserver 5.6 release candidates, since WFS was greatly optimized for database sources (single pass query). ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] fatal error on linux server
Might I also suggest checking if the .shp file is in the correct case? KB_ACEH is uppercase, while .shp is lowercase, I've had plenty of problems (i.e., typo's) with that. Regards, Jelmer As Francesco indicated, the primary error in this case is that the file /home/bleketux/public_html/cmh2/mapserver/shp/KB_ACEH.shp cannot be opened. Make sure the file exists at that location, and that it is readable by the user running the Apache. hint: check the permissions on /home/bleketux Daniel francesco wrote: Should check your mapfile if it is correctly parsed by the mapscritpt. Try drawing the mapfile using standard mapserver.exe and see if it works. Francesco Pirotti MSulchan Darmawan ha scritto: Dear all, I've made a PHP script and tried it on windows using ms4w (mapserver 5.4.2) and it's completely works. Then I tried it on linux (ubuntu server 8.04 with mapserver 5.4.2) but it produce the following error : Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named 'aceh'. in /home/bleketux/public_html/cmh2/_modules/mod_petazm/frm_petazm.php on line 184 Warning: [MapServer Error]: msShapefileOpen(): (KB_ACEH.shp) in /home/bleketux/public_html/cmh2/_modules/mod_petazm/frm_petazm.php on line 184 Warning: [MapServer Error]: msShapefileOpen(): (/home/bleketux/public_html/cmh2/mapserver/shp/KB_ACEH.shp) in /home/bleketux/public_html/cmh2/_modules/mod_petazm/frm_petazm.php on line 184 Fatal error: Call to a member function SaveWebImage() on a non-object in /home/bleketux/public_html/cmh2/_modules/mod_petazm/frm_petazm.php on line 185 Here is some script of line 180 - 185 : $strProj = proj=latlong,ellps=WGS84,datum=WGS84; $objMap-SetProjection ($strProj, MS_FALSE); $objMap-outputformat-Set (name, Format GIF); $objMap-outputformat-Set (extension, gif); $objImagePeta = $objMap-Draw(); $objUrlPeta = $objImagePeta-SaveWebImage(); To avoid permission problem, i've set chmod 777 to the root web folder. Can you point me where should I fix the problem ? Thanks in advance. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] MapServer Projection Issues (I think).
Milo, Thanks for the reply. I've changed the definition in my epsg file and it works! Thanks :) -- Jelmer -Original Message- From: Milo van der Linden [mailto:mlin...@zeelandnet.nl] Sent: donderdag 1 oktober 2009 18:05 To: Jelmer Baas Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] MapServer Projection Issues (I think). projectionsprojections... it is what differentiates a geo-specialist from a regular programmer Hello Jelmer, The wgs84 layer is correct because the ellipsoid/spheroid is the same as used by the mercator projection. We in the Netherlands use the Bessel ellipsoid on our Rijksdriehoekstelsel so you need a +towgs84 transformation too.. http://blog.openstreetmap.nl/index.php/2009/08/27/woorden-schi eten-tekort/ Good luck! Milo van der Linden Jelmer Baas schreef: Hello List, I've been struggling with OpenLayers and MapServer while using Google Maps as a backgroundlayer (thus using Spherical Mercator projection). I've been able to figure it out quite well, but I seem to be stuck at a reprojection issue. The request from OL is: mapserv.exe?map=test.mapLAYERS=layer1%Clayer2TRANSPARENT=tru eSERVICE= WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=applicatio n%2Fvnd.og c.se_inimageFORMAT=image%2FpngSRS=EPSG%3A900913BBOX=664084. 90082266,6 838973.7927063,664696.39704883,6839585.2889324WIDTH=256HEIGHT=256 This results in an image such as this: http://www.cocontheweb.nl/_ftth/test.png The black line is the original file, in EPSG:28992 (Amersfoort new) and has a projection init=EPSG:28992 in the map file. The green line has the default map file projection (init=epsg:4326) and the file is saved as WGS84 with MapInfo. The problem now is that the green line is the correct one, the black line is offset. I've checked all relevant declarations in my epsg file, they are correct. Am I doing something wrong? I hope there is another solution besides re-saving all files as WGS84. Thanks in advance for any assistance! With kind regards, Jelmer Baas ___ 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] MapServer Projection Issues (I think).
Hello List, I've been struggling with OpenLayers and MapServer while using Google Maps as a backgroundlayer (thus using Spherical Mercator projection). I've been able to figure it out quite well, but I seem to be stuck at a reprojection issue. The request from OL is: mapserv.exe?map=test.mapLAYERS=layer1%Clayer2TRANSPARENT=trueSERVICE= WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.og c.se_inimageFORMAT=image%2FpngSRS=EPSG%3A900913BBOX=664084.90082266,6 838973.7927063,664696.39704883,6839585.2889324WIDTH=256HEIGHT=256 This results in an image such as this: http://www.cocontheweb.nl/_ftth/test.png The black line is the original file, in EPSG:28992 (Amersfoort new) and has a projection init=EPSG:28992 in the map file. The green line has the default map file projection (init=epsg:4326) and the file is saved as WGS84 with MapInfo. The problem now is that the green line is the correct one, the black line is offset. I've checked all relevant declarations in my epsg file, they are correct. Am I doing something wrong? I hope there is another solution besides re-saving all files as WGS84. Thanks in advance for any assistance! With kind regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] How to use 01 connection for all layers in map file
Don't you mean that you don't want your Oracle connection opened and closed for each layer? If that's the case, you can use the setting PROCESSING CLOSE_CONNECTION=DEFER in your Layer. See http://ms.gis.umn.edu/docs/reference/mapfile/layer http://ms.gis.umn.edu/docs/reference/mapfile/layer or http://mapserver.org/input/vector/ogr.html http://mapserver.org/input/vector/ogr.html Regards, Jelmer From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Bic Phuong Sent: donderdag 6 augustus 2009 11:32 To: Pavel Iacovlev Cc: mapserver-users@lists.osgeo.org Subject: [mapserver-users] How to use 01 connection for all layers in map file Your reply is really good news, Will you please to tell me details on details how can I do like you with a map file which has more than 17 connection now? I do not understand yet clearly how to use single MapServer layer for all? Thanks so much and I hope you can help me more! --- On Thu, 8/6/09, Pavel Iacovlev iacovlev.pa...@gmail.com wrote: From: Pavel Iacovlev iacovlev.pa...@gmail.com Subject: Re: [mapserver-users] How to use 01 connection for all layers in map file To: Mr. Bic Phuong bicphuongonl...@yahoo.com Date: Thursday, August 6, 2009, 3:16 PM Hope I get your question right. We have around 32 layers in one of the project, the approach is rather simple, you just use a single Mapserver layer so there is always 1 request to Mapserver from OpenLayers. The request layer is the combination of all your layers, the overlaying is made server side. Details: 1. We have a custom layer switcher that user selects what layers he wants to see and this data is saved, in a php session for example. 2. Then the user requests a map from a PHPMapscript(mapserver) server, using php you fetch all the layers selected by the user previously 3. Dispatch the result ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Oracle Spatial and styleitem auto
Dan, Thank you for your reply, unfortunatly this is not an option due to the large ammount of different styles we (need to) use. Plus, with TAB or Shapefiles each filter slows down map rendering. Tamas, Thanks a lot! At the moment I'm using MapServers' own Oracle interface, but I'll switch to OGR and give it a shot. It looks exactly like what I need. Might I suggest adding a link to http://www.gdal.org/ogr/ogr_feature_style.html in some MapServer pages (even though it's technically an OGR thing, I think it's information that will benifit many more MapServer users). With kind regards, Jelmer Baas -Original Message- From: Dan Little [mailto:danlit...@yahoo.com] Sent: vrijdag 22 mei 2009 15:58 To: Jelmer Baas; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Oracle Spatial and styleitem auto You could use separate classes to do that? - Original Message From: Jelmer Baas b...@speerit.nl To: mapserver-users@lists.osgeo.org Sent: Friday, May 22, 2009 6:38:34 AM Subject: [mapserver-users] Oracle Spatial and styleitem auto Hello List, Are there any plans to create a way for MapServer to automaticly apply a certain style to data retrieved from Oracle Spatial? For example by specifying a style column in the mapfile which contains a MapInfo style description? With kind regards, Jelmer Baas ___ 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] Oracle Spatial and styleitem auto
Tamas, Thanks to your url I managed to get it working. The performance is way better than I hoped! The only thing that doesn't seem to work is linewidth for (poly)lines. The style PEN(w:8px,c:#FF6A00) still draws a 1 or 2 pixel line. I tried using cm, pt, etc, but that doesn't change anything. I don't have a style in my map file that overrides it, too (only a class with name and template). Any ideas? Or should I ask this question in a gdal/ogr list? Regards, Jelmer Baas From: Tamas Szekeres [mailto:szeker...@gmail.com] Sent: zaterdag 23 mei 2009 0:30 To: Jelmer Baas Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Oracle Spatial and styleitem auto Hi, If you are using OGR to access the Oracle Spatial data source, you could specify a valid OGR style string in the table by adding field with name: 'OGR_STYLE'. In this case OGR will extract the feature style automatically when using the STYLEITEM AUTO option with this OGR layer. For more information about the OGR feature style strings see: http://www.gdal.org/ogr/ogr_feature_style.html You could use ogr2ogr to transfer the feature styles between various data sources, see the document above. Best regards, Tamas 2009/5/22 Jelmer Baas b...@speerit.nl Hello List, Are there any plans to create a way for MapServer to automaticly apply a certain style to data retrieved from Oracle Spatial? For example by specifying a style column in the mapfile which contains a MapInfo style description? With kind regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Oracle Spatial and styleitem auto
Hello List, Are there any plans to create a way for MapServer to automaticly apply a certain style to data retrieved from Oracle Spatial? For example by specifying a style column in the mapfile which contains a MapInfo style description? With kind regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] MapScript and ZoomRectangle (and rectObj problems)
Jim, List, Thanks for the reply. I'm afraid that eventually I'll be working with more than one coord system, so I don't believe your solution can work for me. I've been continueing my testing, and it seems like all MapScript zoomto functions either work unlike I expect them, or are completely broken. I tried to following: In the immediate pane in VB .Net: ? map.setCenter(new pointObj(143000,485437,0,0)) 0 ? map.extent {OSGeo.MapServer.rectObj} maxx: 143397.59497452341 maxy: 485654.62790724094 minx: 142602.40502547659 miny: 485219.37209275906 This seems to work properly. Now the following: ? map.zoomScale(1000, new pointObj(143000,485437,0,0),mapwidth, mapheight,map.extent, nothing) 0 ? map.extent {OSGeo.MapServer.rectObj} maxx: 225008.64025899942 maxy: 207042.5828362515 minx: 224520.10434931691 miny: 206775.17742509485 When I change map.extent to fullExtent (which is set after loading, in this case the extents of the Netherlands) ? map.zoomScale(1000, new pointObj(143000,485437,0,2),mapwidth, mapheight,FullExtent, nothing) 0 ? map.extent {OSGeo.MapServer.rectObj} maxx: 85315130.06053336 maxy: -353386875.22545278 minx: 85314641.524623737 miny: -353387142.6308639 These numbers are completely unexpected. Even though I'm not sure about the zoomscale of 1000, the extent returned doesn't make any sense. MapWidth = 1384. mapHeight = 758 This is really a huge problem for us at the moment. I hope someone can shed some light on this. Thanks in advance, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] MapScript and ZoomRectangle (and rectObj problems)
Hello List, Three years ago, I built a web interface for our primary application using MapServer. Now we're in the process of building that same application in VB.Net (but with more features) using MapScript. Although everything comes along nicely (I love the fact that everything returns objects, etc) there is one huge problem that I can't seem to solve: creating and using the rectObj class. I read a lot about it and found many bug cases, older messages, etc, but I still can't make heads or tails of it. I'm sorry about asking it, since it must be the millionth time this question has been asked. I *CAN* get ZoomRect with a rectObj to work when using image coords, even though that requires my own code that flips miny and maxy to solve that lovely error about miny = maxy or something. When I try to use it with map coords however, I can't get it to work. In my init code I create a new rect object: Map = New mapObj(strMapPath) FullExtent = New rectObj(0, 0, 0, 0, 0) With Map.extent FullExtent.maxx = .maxx FullExtent.minx = .minx FullExtent.maxy = .maxy FullExtent.miny = .miny End With When I feed this to ZoomRectangle using Map.zoomRectangle(FullExtent, MapWidth, MapHeight, Map.extent, Nothing) I get that famous mapscript::mapObj::zoomRectangle(): General error message. image rectangle maxy = miny. When I flip miny and maxy I end up in the middle of the Sahara (while the original coords should show the Netherlands). Things I wonder about: 1) How can I get zoomRectangle to work with world/map coords instead of image coords? 2) Why does the constructor have an imageunits as integer? IMHO a simple rect object has nothing todo with the coordsys of the/a map (since I can more than one). 3) When will the much discussed bugfix be applied that automaticly flips miny/maxy? Any help would be greatly appreciated, With kind regards, Jelmer Baas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users