From ahmettemiz88 at gmail.com Tue Aug 1 01:49:39 2017 From: ahmettemiz88 at gmail.com (Ahmet Temiz) Date: Tue, 1 Aug 2017 11:49:39 +0300 Subject: [mapserver-users] Wrong about cgi feature parameter In-Reply-To: References: Message-ID: Thank you Steve for your detailed help. Actually I intended to create polygon using OpenLayers, then sending coordinates to mapserver as feature object. I am going to use this polygon feature as a mask to crop related portion of raster map. It was OK for simple rectangle polygon. Now, I am looking for a way for complex polygon which has so many points. Do you have any idea about whether I can assign a GeoJSON object for a feature in URL request ? Regards On Mon, Jul 31, 2017 at 10:41 PM, Lime, Steve D (MNIT) < steve.lime at state.mn.us> wrote: > I was able to get something very similar working, albeit via a straight > MapServer CGI call ? didn?t try WMS. I noticed in your example you > reference two layers poor and polf, is that intended? > > > > Request: > > http://maps1.dnr.state.mn.us/cgi-bin/mapserv72?map=/usr/ > local/mapserver/apps/test/temiz/test.map&mode=map&layer= > polf&map_layer[polf]=FEATURE+POINTS+3559569+5042506+END+END > > > > Mapfile: > > MAP > > NAME 'ahmet temiz test mapfile' > > EXTENT 2857613.741389 4274927.875099 4989229.633477 5176940.449967 > > SIZE 400 300 > > > > SYMBOL > > NAME 'circle' > > TYPE ELLIPSE > > POINTS 1 1 END > > FILLED TRUE > > END > > > > LAYER > > NAME 'polf' > > TYPE POINT > > STATUS OFF > > CLASS > > STYLE COLOR 255 0 0 SYMBOL 'circle' SIZE 10 END > > END > > END > > END > > > > --Steve > > > > *From:* mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] *On > Behalf Of *Ahmet Temiz > *Sent:* Friday, July 28, 2017 11:12 PM > *To:* mapserver-users at lists.osgeo.org > *Subject:* [mapserver-users] Wrong about cgi feature parameter > > > > Hi, > > I want to create a feature dynamically for point layer. > > But,What am I doing wrong ? It must be about feature parameter. But I was > not able to solve it. > > This request generates nothing. > > > > curl --trace -i -g -X GET -H "Content-Type: image/png" " > http://localhost/cgi-bin/mapserv?map=/var/www/ms_map/ > slptrRGB3857.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&Layers=poor > &map_layer[polf]=FEATURE+POINTS+3559569+5042506+END+ > END&STYLES=&SRS=EPSG:3857&BBOX=2857613.741389,4274927. > 875099,4989229.633477,5176940.449967&WIDTH=400&HEIGHT=300&FORMAT=image/png" > > out.png > > > > If you can help, I will appreciate. > > regards > > -- > > Ahmet Temiz > Jeoloji M?h. > Afet ve Acil Durum Y?netimi Ba?kanl??? > Bilgi ??lem Dairesi Ba?kanl???-CBS Grubu > > > ________________________ > > Ahmet Temiz > Geological Eng. > Information Systems - GIS Group > Disaster and Emergency Management > of Presidency > -- Ahmet Temiz Jeoloji M?h. Afet ve Acil Durum Y?netimi Ba?kanl??? Bilgi ??lem Dairesi Ba?kanl???-CBS Grubu ________________________ Ahmet Temiz Geological Eng. Information Systems - GIS Group Disaster and Emergency Management of Presidency -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve.lime at state.mn.us Tue Aug 1 08:50:21 2017 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Tue, 1 Aug 2017 15:50:21 +0000 Subject: [mapserver-users] Wrong about cgi feature parameter In-Reply-To: References: Message-ID: Hi Ahmet: MapServer doesn?t handle GeoJSON within a feature object. However, it does handle WKT so I imagine you can convert from a polygon in OpenLayer to WKT and pass that. See http://mapserver.org/mapfile/feature.html for more information on the MapServer side? Steve From: Ahmet Temiz [mailto:ahmettemiz88 at gmail.com] Sent: Tuesday, August 01, 2017 3:50 AM To: Lime, Steve D (MNIT) Cc: mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Wrong about cgi feature parameter Thank you Steve for your detailed help. Actually I intended to create polygon using OpenLayers, then sending coordinates to mapserver as feature object. I am going to use this polygon feature as a mask to crop related portion of raster map. It was OK for simple rectangle polygon. Now, I am looking for a way for complex polygon which has so many points. Do you have any idea about whether I can assign a GeoJSON object for a feature in URL request ? Regards On Mon, Jul 31, 2017 at 10:41 PM, Lime, Steve D (MNIT) > wrote: I was able to get something very similar working, albeit via a straight MapServer CGI call ? didn?t try WMS. I noticed in your example you reference two layers poor and polf, is that intended? Request: http://maps1.dnr.state.mn.us/cgi-bin/mapserv72?map=/usr/local/mapserver/apps/test/temiz/test.map&mode=map&layer=polf&map_layer[polf]=FEATURE+POINTS+3559569+5042506+END+END Mapfile: MAP NAME 'ahmet temiz test mapfile' EXTENT 2857613.741389 4274927.875099 4989229.633477 5176940.449967 SIZE 400 300 SYMBOL NAME 'circle' TYPE ELLIPSE POINTS 1 1 END FILLED TRUE END LAYER NAME 'polf' TYPE POINT STATUS OFF CLASS STYLE COLOR 255 0 0 SYMBOL 'circle' SIZE 10 END END END END --Steve From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Ahmet Temiz Sent: Friday, July 28, 2017 11:12 PM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Wrong about cgi feature parameter Hi, I want to create a feature dynamically for point layer. But,What am I doing wrong ? It must be about feature parameter. But I was not able to solve it. This request generates nothing. curl --trace -i -g -X GET -H "Content-Type: image/png" "http://localhost/cgi-bin/mapserv?map=/var/www/ms_map/slptrRGB3857.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&Layers=poor &map_layer[polf]=FEATURE+POINTS+3559569+5042506+END+END&STYLES=&SRS=EPSG:3857&BBOX=2857613.741389,4274927.875099,4989229.633477,5176940.449967&WIDTH=400&HEIGHT=300&FORMAT=image/png" > out.png If you can help, I will appreciate. regards -- Ahmet Temiz Jeoloji M?h. Afet ve Acil Durum Y?netimi Ba?kanl??? Bilgi ??lem Dairesi Ba?kanl???-CBS Grubu ________________________ Ahmet Temiz Geological Eng. Information Systems - GIS Group Disaster and Emergency Management of Presidency -- Ahmet Temiz Jeoloji M?h. Afet ve Acil Durum Y?netimi Ba?kanl??? Bilgi ??lem Dairesi Ba?kanl???-CBS Grubu ________________________ Ahmet Temiz Geological Eng. Information Systems - GIS Group Disaster and Emergency Management of Presidency -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.greenwood at gmail.com Tue Aug 1 18:40:20 2017 From: richard.greenwood at gmail.com (Richard Greenwood) Date: Tue, 1 Aug 2017 19:40:20 -0600 Subject: [mapserver-users] rotating a label 90 degrees. In-Reply-To: <062a40ff76994fa4906403c4c0090d93@GeoAnalytic.com> References: <07B15A5A-0AAC-4F76-85C8-6A640750E12F@ci.stpaul.mn.us> <0770BBF1-7855-4CB0-A226-BCD432630DA8@ci.stpaul.mn.us> <062a40ff76994fa4906403c4c0090d93@GeoAnalytic.com> Message-ID: I've only been using MapServer for like 15 or 18 years now and I continue to be blow away by these hidden features! (I guess if I learned to read the docs they might not be so hidden) Anybody going to Boston? Rich On Mon, Jul 31, 2017 at 3:00 PM, Brent Fraser wrote: > Bob, > > Maybe using Javascript style GEOMTRANSFORM in the mapfle? > http://www.mapserver.org/mapfile/geomtransform.html# > javascript-transformation > > > Best Regards, > Brent Fraser > > > > ------------------------------ > *From*: "Basques, Bob (CI-StPaul)" > *Sent*: Monday, July 31, 2017 2:56 PM > *To*: "Steve D Lime (MNIT)" > *Cc*: "mapserver-users at lists.osgeo.org" > *Subject*: Re: [mapserver-users] rotating a label 90 degrees. > > Steve, > > I?m pretty sure I can get to what I need via SQL, but it would be rather > convoluted. It?s doable though. > > I was hoping for doing something like ?auto+/-90? as an option for a value. > > > bobb > > > > On Jul 31, 2017, at 3:52 PM, Lime, Steve D (MNIT) > wrote: > > I can?t think of anything offhand. If using PostGIS could you compute the > angle and add 90? I think you could then use attribute binding on the > result. Could pre-process data too. Otherwide we?d need an ?angleoffset? > parameters or something like that. > > *From:* mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org > ] *On Behalf Of *Basques, Bob > (CI-StPaul) > *Sent:* Monday, July 31, 2017 1:38 PM > *To:* mapserver-users at lists.osgeo.org > *Subject:* [mapserver-users] rotating a label 90 degrees. > > All, > > Is there and way to label a line with the ANGLE value set to AUTO, but to > rotate the label by 90 degrees? I want to label a line by crossing > perpendicular to the line vs aligned parallel. > > Thanks > > bobb > > > > "In the end, it's not the years in your life that count. It's the life in > your years.? > > - Abraham Lincoln > > > > > "I've had a wonderful time, but this wasn't it." - Groucho Marx > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -- Richard W. Greenwood, PLS www.greenwoodmap.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From swathiv.mca at gmail.com Thu Aug 3 03:17:12 2017 From: swathiv.mca at gmail.com (swathi v) Date: Thu, 3 Aug 2017 15:47:12 +0530 Subject: [mapserver-users] Getting attributes from a shapefile from Mapscript/PhP (Mapserver) Message-ID: Hi, I have a shapefile/vector file as Layer in the .map file. Now, I want to get all the attributes of that shapefile in my Mapscript/PhP and display them on the browser. For example, a shapefile has the attributes as Name, Type, Width. Now I want to get these attributes from that layer dynamically from my PhP/Mapscript code. So please let me know how to get attributes from a shapefile from Mapscript/PhP. Thanks & Regards, - swathi.m -------------- next part -------------- An HTML attachment was scrubbed... URL: From boolean10001 at yahoo.com Thu Aug 3 08:13:35 2017 From: boolean10001 at yahoo.com (Carlos Ruiz) Date: Thu, 3 Aug 2017 15:13:35 +0000 (UTC) Subject: [mapserver-users] Getting attributes from a shapefile from Mapscript/PhP (Mapserver) In-Reply-To: References: Message-ID: <769454615.1138751.1501773215485@mail.yahoo.com> Swathi, Have a look here PHP MapScript API ? MapServer 7.0.6 documentation at the getShape method. | | | PHP MapScript API ? MapServer 7.0.6 documentation | | | Cheers From: swathi v To: mapserver-users at lists.osgeo.org Sent: Thursday, August 3, 2017 5:17 AM Subject: [mapserver-users] Getting attributes from a shapefile from Mapscript/PhP (Mapserver) Hi, I have a shapefile/vector file as Layer in the .map file. Now, I want to get all the attributes of that shapefile in my Mapscript/PhP and display them on the browser. For example, a shapefile has the attributes as Name, Type, Width. Now I want to get these attributes from that layer dynamically from my PhP/Mapscript code. So please let me know how to get attributes from a shapefile from Mapscript/PhP. Thanks & Regards, - swathi.m_______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From besteseymen at sabanciuniv.edu Sun Aug 6 03:21:54 2017 From: besteseymen at sabanciuniv.edu (Beste Seymen) Date: Sun, 6 Aug 2017 13:21:54 +0300 Subject: [mapserver-users] XSS vulnerability on the 'layer' parameter of WMTS Message-ID: Hello, I'm a student working on a school project that utilises mapserver 6.2 installed from rpm on RedHat OS. My advisors are very concerned about the security of the system. From the security reports, we obtained this XSS vulnerability on the 'layer' parameter of WMTS service. http://example.com/mapcache/wmts/?SERVICE=WMTS&REQUEST= GetTile&VERSION=1.0.0&LAYER=--%3E%3ca%20xml ns%3aa%3d%27http%3a%2f%2fwww.w3.org%2f1999%2fxhtml%27%3e% 3ca%3abody%20onload%3d%27alert(1111)%27%2f %3e%3c%2fa%3e&STYLE=default&TILEMATRIXSET=epsg3857&TILEMATRIX=6&TILEROW=23& TILECOL=38&FORMAT= I wonder if the newer versions of mapserver have this issue or is there any way to solve it? Any help would be appreciated. Beste -------------- next part -------------- An HTML attachment was scrubbed... URL: From even.rouault at spatialys.com Sun Aug 6 04:47:28 2017 From: even.rouault at spatialys.com (Even Rouault) Date: Sun, 06 Aug 2017 13:47:28 +0200 Subject: [mapserver-users] XSS vulnerability on the 'layer' parameter of WMTS In-Reply-To: References: Message-ID: <1557347.uTY25landb@even-i700> Beste / devs, adding the development list in CC. I can confirm the issue on latest mapcache master. The vulnerabililty is the injection of a parameter value between XML comment markers <-- --> used for the error message. When this parameter value starts with --> it ends up the comment part and the rest of the value is then parsed as non-comment XML. By skimming through the code it appears there are several similar instances in this protocol and others as well. I can see 2 options to fix this: - the safer one I think: do not return the invalid parameter value in the error message, but just the parameter name. So returning "Invalid layer name" instead of "Invalid layer {value_of_the_LAYER_parameter}". The important information is the name of the erroneous parameter, not its value (the user can figure it that himself) - a more risky one: sanitize the value that is going to be put inside XML comments <-- --> . So that means at least removing --> sequences, but perhaps other things too ? Even > Hello, > > I'm a student working on a school project that utilises mapserver 6.2 > installed from rpm on RedHat OS. My advisors are very concerned about the > security of the system. From the security reports, we obtained this XSS > vulnerability on the 'layer' parameter of WMTS service. > > http://example.com/mapcache/wmts/?SERVICE=WMTS&REQUEST= > GetTile&VERSION=1.0.0&LAYER=--%3E%3ca%20xml > > ns%3aa%3d%27http%3a%2f%2fwww.w3.org%2f1999%2fxhtml%27%3e% > 3ca%3abody%20onload%3d%27alert(1111)%27%2f > %3e%3c%2fa%3e&STYLE=default&TILEMATRIXSET=epsg3857&TILEMATRIX=6&TILEROW=23& > TILECOL=38&FORMAT= > > I wonder if the newer versions of mapserver have this issue or is there any > way to solve it? > Any help would be appreciated. > > Beste -- Spatialys - Geospatial professional services http://www.spatialys.com From jmckenna at gatewaygeomatics.com Sun Aug 6 06:43:48 2017 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Sun, 6 Aug 2017 10:43:48 -0300 Subject: [mapserver-users] XSS vulnerability on the 'layer' parameter of WMTS In-Reply-To: <1557347.uTY25landb@even-i700> References: <1557347.uTY25landb@even-i700> Message-ID: <24ccd452-b6cc-027c-cefa-36fcb86257de@gatewaygeomatics.com> On 2017-08-06 8:47 AM, Even Rouault wrote: > Beste / devs, > > adding the development list in CC. > > I can confirm the issue on latest mapcache master. The vulnerabililty is the > injection of a parameter value between XML comment markers <-- --> used for > the error message. When this parameter value starts with --> it ends up the > comment part and the rest of the value is then parsed as non-comment XML. > By skimming through the code it appears there are several similar instances in > this protocol and others as well. > > I can see 2 options to fix this: > - the safer one I think: do not return the invalid parameter value in the > error message, but just the parameter name. So returning "Invalid layer name" > instead of "Invalid layer {value_of_the_LAYER_parameter}". The important > information is the name of the erroneous parameter, not its value (the user > can figure it that himself) I think users need the {value_of_the_LAYER_parameter} Without that, it is impossible to debug with a large mapfile (with or without MapCache). > - a more risky one: sanitize the value that is going to be put inside XML > comments <-- --> . So that means at least removing --> sequences, but perhaps > other things too ? > > Even > -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ From steve.lime at state.mn.us Mon Aug 7 08:20:01 2017 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Mon, 7 Aug 2017 15:20:01 +0000 Subject: [mapserver-users] XSS vulnerability on the 'layer' parameter of WMTS In-Reply-To: <24ccd452-b6cc-027c-cefa-36fcb86257de@gatewaygeomatics.com> References: <1557347.uTY25landb@even-i700> <24ccd452-b6cc-027c-cefa-36fcb86257de@gatewaygeomatics.com> Message-ID: I'd favor the more simple and safer approach. It's not that difficult for the user to validate the layers requested against the GetCapabilties response. MapServer itself does not return the name of the invalid layer, presumably for the exact same reason. Instead you get "msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter. A layer might be disabled for this request. Check wms/ows_enable_request settings.". Even, would you be willing to prepare a patch? Steve -----Original Message----- From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jeff McKenna Sent: Sunday, August 06, 2017 8:44 AM To: mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] XSS vulnerability on the 'layer' parameter of WMTS On 2017-08-06 8:47 AM, Even Rouault wrote: > Beste / devs, > > adding the development list in CC. > > I can confirm the issue on latest mapcache master. The vulnerabililty is the > injection of a parameter value between XML comment markers <-- --> used for > the error message. When this parameter value starts with --> it ends up the > comment part and the rest of the value is then parsed as non-comment XML. > By skimming through the code it appears there are several similar instances in > this protocol and others as well. > > I can see 2 options to fix this: > - the safer one I think: do not return the invalid parameter value in the > error message, but just the parameter name. So returning "Invalid layer name" > instead of "Invalid layer {value_of_the_LAYER_parameter}". The important > information is the name of the erroneous parameter, not its value (the user > can figure it that himself) I think users need the {value_of_the_LAYER_parameter} Without that, it is impossible to debug with a large mapfile (with or without MapCache). > - a more risky one: sanitize the value that is going to be put inside XML > comments <-- --> . So that means at least removing --> sequences, but perhaps > other things too ? > > Even > -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From even.rouault at spatialys.com Mon Aug 7 09:13:38 2017 From: even.rouault at spatialys.com (Even Rouault) Date: Mon, 07 Aug 2017 18:13:38 +0200 Subject: [mapserver-users] [mapserver-dev] XSS vulnerability on the 'layer' parameter of WMTS (mapcache) In-Reply-To: References: <24ccd452-b6cc-027c-cefa-36fcb86257de@gatewaygeomatics.com> Message-ID: <1691135.yeGOVPsbZG@even-i700> On lundi 7 ao?t 2017 15:20:01 CEST Lime, Steve D (MNIT) wrote: > I'd favor the more simple and safer approach. It's not that difficult for > the user to validate the layers requested against the GetCapabilties > response. MapServer itself does not return the name of the invalid layer, > presumably for the exact same reason. Instead you get > "msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the > LAYERS parameter. A layer might be disabled for this request. Check > wms/ows_enable_request settings.". Agreed. I guess Jeff's remark was perhaps if the client software sends a lot of requests and it is not very convenient to match the responses with the queries which have been fired. For a single request, re-emitting the value in the response exception doesn't bring much, because the user knows what it has requested. > Even, would you be willing to prepare a patch? I can. I would have been interested in hearing Thomas' opinion, but given the period of the year he might not been reading us. I've researched how to safely "escape" arbitrary user data input for inclusion inside <-- --> markers, but couldn't find any solid reference (probably rejeting "--" should be sufficient ?). As there's one function per protocol where error messages are formatted, the sanitizing could potentially be centralized there, which would reduce the amount of changes. The simpler approach I talked about is simpler indeed but requires to identify all the places where a user value is returned in an error message ( mostly grepping for a "%s" in a set_error() call ) : not hard, but with a slight chance of missing something. Even -- Spatialys - Geospatial professional services http://www.spatialys.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at phased.co.uk Tue Aug 8 09:38:20 2017 From: dave at phased.co.uk (Dave Barter) Date: Tue, 8 Aug 2017 17:38:20 +0100 Subject: [mapserver-users] Fixed positioning Message-ID: Is it possible for me to have a layer that places a symbol at the centre of the generated tile and text at a fixed position from the bottom? My aim is to make a single WMS tile call to get back a map image with marker at centre and text at bottom. From steve.lime at state.mn.us Tue Aug 8 09:55:36 2017 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Tue, 8 Aug 2017 16:55:36 +0000 Subject: [mapserver-users] Fixed positioning In-Reply-To: References: Message-ID: Yup, it's possible, for example: http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/local/mapserver/apps/test/barter/test.map&mode=map The mapfile is below... MAP NAME 'barter' SIZE 256 256 IMAGECOLOR 255 255 255 EXTENT 0 0 255 255 SYMBOL NAME 'circle' TYPE ELLIPSE POINTS 1 1 END FILLED TRUE END LAYER NAME 'marker' TYPE POINT STATUS DEFAULT FEATURE POINTS 0 0 END END TRANSFORM CC CLASS STYLE SYMBOL 'circle' COLOR 255 0 0 SIZE 10 END END END LAYER NAME 'label' TYPE POINT STATUS DEFAULT FEATURE POINTS 0 -20 END END TRANSFORM LC CLASS LABEL TEXT 'some text to display' SIZE SMALL COLOR 0 0 0 END END END END --Steve -----Original Message----- From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Dave Barter Sent: Tuesday, August 08, 2017 11:38 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Fixed positioning Is it possible for me to have a layer that places a symbol at the centre of the generated tile and text at a fixed position from the bottom? My aim is to make a single WMS tile call to get back a map image with marker at centre and text at bottom. _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From dave at phased.co.uk Wed Aug 9 11:03:22 2017 From: dave at phased.co.uk (Dave Barter) Date: Wed, 9 Aug 2017 19:03:22 +0100 Subject: [mapserver-users] International Fonts - OSM Data Message-ID: <4E7D5E3E-1323-4604-B31F-6B03FF495C15@phased.co.uk> I?ve done a planet load of OSM and when I view countries in the database using PGADMIN I can see them correctly encoded as per the image below:- http://imgbox.com/Z5SJ911X My Mapfile looks like this:- CLASS EXPRESSION 'country' LABEL FONT sc TYPE TRUETYPE ENCODING "utf-8" SIZE 8 COLOR 100 100 100 OUTLINECOLOR -1 -1 -1 OUTLINEWIDTH 2 WRAP ' ' MAXLENGTH 8 ALIGN CENTER BUFFER 4 PARTIALS FALSE POSITION cc END END Which renders some of the characters but not Ethiopia as shown by this image http://imgbox.com/vnGmn7jT My database server is using UTF8 as the encoding. So Is the problem with my font? sc maps to DejaVuSansCondensed.ttf I am guessing some characters are missing or I need to use another font? -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.bonfort at gmail.com Thu Aug 10 00:28:18 2017 From: thomas.bonfort at gmail.com (thomas bonfort) Date: Thu, 10 Aug 2017 07:28:18 +0000 Subject: [mapserver-users] International Fonts - OSM Data In-Reply-To: <4E7D5E3E-1323-4604-B31F-6B03FF495C15@phased.co.uk> References: <4E7D5E3E-1323-4604-B31F-6B03FF495C15@phased.co.uk> Message-ID: Dave, The Noto font aims at resolving this issue: https://www.google.com/get/noto/ Aside from that mapserver supports language specific fonts. This needs documenting aside from what can be found in the RFC http://mapserver.org/development/rfc/ms-rfc-98.html (which has a typo, use s/LABEL/FONT/) FONT "arialuni,en:arial,ja:cjk,ar:arabic" will use a specific font for a given language code. Collecting all the fonts and mapping them to all the language codes for a worldwide osm db will be a tiresome job... cheers, Thomas On Wed, Aug 9, 2017 at 8:04 PM Dave Barter wrote: > I?ve done a planet load of OSM and when I view countries in the database > using PGADMIN I can see them correctly encoded as per the image below:- > > http://imgbox.com/Z5SJ911X > > My Mapfile looks like this:- > > CLASS > EXPRESSION 'country' > LABEL > FONT sc > TYPE TRUETYPE > ENCODING "utf-8" > SIZE 8 > COLOR 100 100 100 > OUTLINECOLOR -1 -1 -1 > OUTLINEWIDTH 2 > WRAP ' ' > MAXLENGTH 8 > ALIGN CENTER > BUFFER 4 > PARTIALS FALSE > POSITION cc > END > END > > Which renders some of the characters but not Ethiopia as shown by this > image > > http://imgbox.com/vnGmn7jT > > My database server is using UTF8 as the encoding. So Is the problem with > my font? > > sc maps to DejaVuSansCondensed.ttf > > I am guessing some characters are missing or I need to use another font? > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From swathiv.mca at gmail.com Thu Aug 10 01:33:39 2017 From: swathiv.mca at gmail.com (swathi v) Date: Thu, 10 Aug 2017 14:03:39 +0530 Subject: [mapserver-users] Getting attributes from a shapefile from Mapscript/PhP (Mapserver) In-Reply-To: References: Message-ID: Hi, Thank you. Now, I am able to retrieve the layer attributes using the getItems() method. Now I want to retrieve the values under each attribute for that layer. For example, want to retrieve the values under the attribute, Name of a layer by name "states". Thanks & Regards, - swathi.m On Thu, Aug 3, 2017 at 3:47 PM, swathi v wrote: > Hi, > > I have a shapefile/vector file as Layer in the .map file. > > Now, I want to get all the attributes of that shapefile in my > Mapscript/PhP and display them on the browser. > > For example, a shapefile has the attributes as Name, Type, Width. Now I > want to get these attributes from that layer dynamically from my > PhP/Mapscript code. > > So please let me know how to get attributes from a shapefile from > Mapscript/PhP. > > > Thanks & Regards, > - swathi.m > -- - swathi.m -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at phased.co.uk Thu Aug 10 03:00:38 2017 From: dave at phased.co.uk (Dave Barter) Date: Thu, 10 Aug 2017 11:00:38 +0100 Subject: [mapserver-users] International Fonts - OSM Data In-Reply-To: References: <4E7D5E3E-1323-4604-B31F-6B03FF495C15@phased.co.uk> Message-ID: > > Dave, > The Noto font aims at resolving this issue: https://www.google.com/get/noto/ > > Aside from that mapserver supports language specific fonts. This needs documenting aside from what can be found in the RFC http://mapserver.org/development/rfc/ms-rfc-98.html (which has a typo, use s/LABEL/FONT/) > > FONT "arialuni,en:arial,ja:cjk,ar:arabic" > > will use a specific font for a given language code. Collecting all the fonts and mapping them to all the language codes for a worldwide osm db will be a tiresome job... > Thanks for the guidance. This may be a really stupid question but given I can find the Ethiopia record in the database how can I establish its language code? -------------- next part -------------- An HTML attachment was scrubbed... URL: From havard.tveite at nmbu.no Thu Aug 10 05:57:22 2017 From: havard.tveite at nmbu.no (Havard Tveite) Date: Thu, 10 Aug 2017 14:57:22 +0200 Subject: [mapserver-users] International Fonts - OSM Data In-Reply-To: References: <4E7D5E3E-1323-4604-B31F-6B03FF495C15@phased.co.uk> Message-ID: <6a42310c-fb41-95fe-41a9-6b47408e8121@nmbu.no> Thanks for reporting, Thomas. I have added a documentation issue for RFC98. H?vard On 10. aug. 2017 09:28, thomas bonfort wrote: > Dave, > The Noto font aims at resolving this issue: https://www.google.com/get/noto/ > > Aside from that mapserver supports language specific fonts. This needs > documenting aside from what can be found in the RFC > http://mapserver.org/development/rfc/ms-rfc-98.html (which has a typo, > use s/LABEL/FONT/) > > FONT "arialuni,en:arial,ja:cjk,ar:arabic" > > will use a specific font for a given language code. Collecting all the > fonts and mapping them to all the language codes for a worldwide osm db > will be a tiresome job... > > cheers, > Thomas > > On Wed, Aug 9, 2017 at 8:04 PM Dave Barter > wrote: > > I?ve done a planet load of OSM and when I view countries in the > database using PGADMIN I can see them correctly encoded as per the > image below:- > > http://imgbox.com/Z5SJ911X > > My Mapfile looks like this:- > > CLASS > EXPRESSION 'country' > LABEL > FONT sc > TYPE TRUETYPE > ENCODING "utf-8" > SIZE 8 > COLOR 100 100 100 > OUTLINECOLOR -1 -1 -1 > OUTLINEWIDTH 2 > WRAP ' ' > MAXLENGTH 8 > ALIGN CENTER > BUFFER 4 > PARTIALS FALSE > POSITION cc > END > END > > Which renders some of the characters but not Ethiopia as shown by > this image > > http://imgbox.com/vnGmn7jT > > My database server is using UTF8 as the encoding. So Is the problem > with my font? > > sc maps to DejaVuSansCondensed.ttf > > I am guessing some characters are missing or I need to use another font? > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -- H?vard Tveite Faculty of Sciences and Technology, NMBU Dr?bakveien 31, POBox 5003, N-1432 ?s, NORWAY Phone: +47 67231548 Web: http://www.nmbu.no From boolean10001 at yahoo.com Thu Aug 10 08:39:45 2017 From: boolean10001 at yahoo.com (Carlos Ruiz) Date: Thu, 10 Aug 2017 15:39:45 +0000 (UTC) Subject: [mapserver-users] Getting attributes from a shapefile from Mapscript/PhP (Mapserver) In-Reply-To: References: Message-ID: <350869104.1218361.1502379585225@mail.yahoo.com> Once you have the shape object, you can access the associative array values to retrieve the desired value by attribute name. | | The values array is an associative array with the attribute values forthis shape. It is set only on shapes obtained from layer->getShape().The key to the values in the array is the attribute name, e.g.$population = $shape->values["Population"]; Taken from PHP MapScript API ? MapServer 7.0.6 documentation | | | PHP MapScript API ? MapServer 7.0.6 documentation | | | Cheers Carlos Ruiz | | | | | | | | | | | Carlos Ruiz View Carlos Ruiz?s professional profile on LinkedIn. LinkedIn is the world's largest business network, helpi... | | | | From: swathi v To: mapserver-users at lists.osgeo.org Sent: Thursday, August 10, 2017 3:34 AM Subject: Re: [mapserver-users] Getting attributes from a shapefile from Mapscript/PhP (Mapserver) Hi, Thank you. Now, I am able to retrieve the layer attributes using the getItems() method. Now I want to retrieve the values under each attribute for that layer. For example, want to retrieve the values under the attribute, Name of a layer by name "states". Thanks & Regards, - swathi.m On Thu, Aug 3, 2017 at 3:47 PM, swathi v wrote: Hi, I have a shapefile/vector file as Layer in the .map file. Now, I want to get all the attributes of that shapefile in my Mapscript/PhP and display them on the browser. For example, a shapefile has the attributes as Name, Type, Width. Now I want to get these attributes from that layer dynamically from my PhP/Mapscript code. So please let me know how to get attributes from a shapefile from Mapscript/PhP. Thanks & Regards, - swathi.m -- - swathi.m_______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at phased.co.uk Fri Aug 18 03:13:29 2017 From: dave at phased.co.uk (Dave Barter) Date: Fri, 18 Aug 2017 11:13:29 +0100 Subject: [mapserver-users] Segfault - LINE layer Message-ID: <31C76B16-5B4C-488A-863B-9B974E78E6F2@phased.co.uk> This call:- /usr/lib/cgi-bin/mapserv.ngx -nh "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng&SRS=EPSG%3a3857&LAYERS=roads8&transparent=false Is giving me:- Segmentation fault (core dumped) For the layer definition:- LAYER GROUP "default" STATUS ON TYPE LINE MINSCALEDENOM 1300032 MAXSCALEDENOM 2600064 NAME "roads8" DEBUG 5 CONNECTIONTYPE postgis PROCESSING "CLOSE_CONNECTION=DEFER" {%public_map_user%} PROJECTION "init=epsg:900913" END DATA "geometry from (select osm_id,geometry,name as name,ref,type from mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') order by z_order asc) as foo using unique osm_id using srid=900913" LABELITEM "name" CLASSITEM "type" CLASS EXPRESSION {primary,primary_link} STYLE WIDTH 0.5 COLOR 242 242 242 END END CLASS EXPRESSION "motorway" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END CLASS EXPRESSION "trunk" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END END When I look in my debug file I see the following as last set of lines:- [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7 [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary" [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] "" [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] "" [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570 [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327 [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570 [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174) [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called. [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called. [Fri Aug 18 11:09:39 2017].94 So it seems to segfault during msPostGISReadShape. I?ve checked the query and it is pulling 3110 linestrings from the database. But I am not sure why is is segfaulting? Is this a bug? Dave Barter dave at phased.co.uk @citizenfishy www.phased.co.uk From steve.lime at state.mn.us Fri Aug 18 05:44:08 2017 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Fri, 18 Aug 2017 12:44:08 +0000 Subject: [mapserver-users] Segfault - LINE layer In-Reply-To: <31C76B16-5B4C-488A-863B-9B974E78E6F2@phased.co.uk> References: <31C76B16-5B4C-488A-863B-9B974E78E6F2@phased.co.uk> Message-ID: I'd call it a bug. What version? Can you prepare a small test case? ________________________________ From: mapserver-users on behalf of Dave Barter Sent: Friday, August 18, 2017 5:13:29 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Segfault - LINE layer This call:- /usr/lib/cgi-bin/mapserv.ngx -nh "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng&SRS=EPSG%3a3857&LAYERS=roads8&transparent=false Is giving me:- Segmentation fault (core dumped) For the layer definition:- LAYER GROUP "default" STATUS ON TYPE LINE MINSCALEDENOM 1300032 MAXSCALEDENOM 2600064 NAME "roads8" DEBUG 5 CONNECTIONTYPE postgis PROCESSING "CLOSE_CONNECTION=DEFER" {%public_map_user%} PROJECTION "init=epsg:900913" END DATA "geometry from (select osm_id,geometry,name as name,ref,type from mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') order by z_order asc) as foo using unique osm_id using srid=900913" LABELITEM "name" CLASSITEM "type" CLASS EXPRESSION {primary,primary_link} STYLE WIDTH 0.5 COLOR 242 242 242 END END CLASS EXPRESSION "motorway" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END CLASS EXPRESSION "trunk" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END END When I look in my debug file I see the following as last set of lines:- [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7 [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary" [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] "" [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] "" [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570 [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327 [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570 [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174) [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called. [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called. [Fri Aug 18 11:09:39 2017].94 So it seems to segfault during msPostGISReadShape. I?ve checked the query and it is pulling 3110 linestrings from the database. But I am not sure why is is segfaulting? Is this a bug? Dave Barter dave at phased.co.uk @citizenfishy www.phased.co.uk _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at phased.co.uk Fri Aug 18 06:04:51 2017 From: dave at phased.co.uk (Dave Barter) Date: Fri, 18 Aug 2017 14:04:51 +0100 Subject: [mapserver-users] Segfault - LINE layer In-Reply-To: References: <31C76B16-5B4C-488A-863B-9B974E78E6F2@phased.co.uk> Message-ID: > On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) wrote: > > I'd call it a bug. What version? Can you prepare a small test case? MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE I have tracked it down to a specific geometry:- 010200000000000000 = ?LINESTRING EMPTY? > > From: mapserver-users > on behalf of Dave Barter > > Sent: Friday, August 18, 2017 5:13:29 AM > To: mapserver-users at lists.osgeo.org > Subject: [mapserver-users] Segfault - LINE layer > > This call:- > > /usr/lib/cgi-bin/mapserv.ngx -nh "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng&SRS=EPSG%3a3857&LAYERS=roads8&transparent=false > > Is giving me:- > > Segmentation fault (core dumped) > > For the layer definition:- > > LAYER > GROUP "default" > STATUS ON > TYPE LINE > MINSCALEDENOM 1300032 > MAXSCALEDENOM 2600064 > NAME "roads8" > DEBUG 5 > CONNECTIONTYPE postgis > PROCESSING "CLOSE_CONNECTION=DEFER" > {%public_map_user%} > PROJECTION > "init=epsg:900913" > END > DATA "geometry from (select osm_id,geometry,name as name,ref,type from mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') order by z_order asc) as foo using unique osm_id using srid=900913" > LABELITEM "name" > CLASSITEM "type" > CLASS > EXPRESSION {primary,primary_link} > STYLE > WIDTH 0.5 > COLOR 242 242 242 > END > END > CLASS > EXPRESSION "motorway" > TEXT ("[ref]") > STYLE > WIDTH 1 > OUTLINEWIDTH 0.5 > OUTLINECOLOR 217 217 217 > END > STYLE > WIDTH 1 > COLOR 242 242 242 > > END > END > CLASS > EXPRESSION "trunk" > TEXT ("[ref]") > STYLE > WIDTH 1 > OUTLINEWIDTH 0.5 > OUTLINECOLOR 217 217 217 > END > STYLE > WIDTH 1 > COLOR 242 242 242 > END > END > END > > When I look in my debug file I see the following as last set of lines:- > > [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7 > [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary" > [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0 > [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] "" > [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0 > [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] "" > [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570 > [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327 > [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570 > [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174) > [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called. > [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called. > [Fri Aug 18 11:09:39 2017].94 > > So it seems to segfault during msPostGISReadShape. > > I?ve checked the query and it is pulling 3110 linestrings from the database. > > But I am not sure why is is segfaulting? Is this a bug? > > Dave Barter > dave at phased.co.uk > @citizenfishy > www.phased.co.uk > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at phased.co.uk Fri Aug 18 07:56:09 2017 From: dave at phased.co.uk (Dave Barter) Date: Fri, 18 Aug 2017 15:56:09 +0100 Subject: [mapserver-users] Segfault - LINE layer In-Reply-To: <40428ada5d964f929a13764f8542e592@C119S212VM042.msvyvi.vaha.local> References: <40428ada5d964f929a13764f8542e592@C119S212VM042.msvyvi.vaha.local> Message-ID: <9F61D202-D4A5-4441-94A1-DB753838A0D5@phased.co.uk> > > As a quick workaround edit your DATA: > > where type in ('trunk','motorway','primary') AND geometry is not null > > -Jukka Rahkonen- That will not work as an empty geometry is not null The fix is WHERE NOT ST_EMPTY(geometry) > > L?hett?j?: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org ] Puolesta Dave Barter > L?hetetty: 18. elokuuta 2017 16:05 > Vastaanottaja: mapserver-users at lists.osgeo.org > Aihe: Re: [mapserver-users] Segfault - LINE layer > > > On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) > wrote: > > I'd call it a bug. What version? Can you prepare a small test case? > > MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE > > I have tracked it down to a specific geometry:- > > 010200000000000000 = ?LINESTRING EMPTY? > > > > From: mapserver-users > on behalf of Dave Barter > > Sent: Friday, August 18, 2017 5:13:29 AM > To: mapserver-users at lists.osgeo.org > Subject: [mapserver-users] Segfault - LINE layer > > This call:- > > /usr/lib/cgi-bin/mapserv.ngx -nh "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng&SRS=EPSG%3a3857&LAYERS=roads8&transparent=false > > Is giving me:- > > Segmentation fault (core dumped) > > For the layer definition:- > > LAYER > GROUP "default" > STATUS ON > TYPE LINE > MINSCALEDENOM 1300032 > MAXSCALEDENOM 2600064 > NAME "roads8" > DEBUG 5 > CONNECTIONTYPE postgis > PROCESSING "CLOSE_CONNECTION=DEFER" > {%public_map_user%} > PROJECTION > "init=epsg:900913" > END > DATA "geometry from (select osm_id,geometry,name as name,ref,type from mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') order by z_order asc) as foo using unique osm_id using srid=900913" > LABELITEM "name" > CLASSITEM "type" > CLASS > EXPRESSION {primary,primary_link} > STYLE > WIDTH 0.5 > COLOR 242 242 242 > END > END > CLASS > EXPRESSION "motorway" > TEXT ("[ref]") > STYLE > WIDTH 1 > OUTLINEWIDTH 0.5 > OUTLINECOLOR 217 217 217 > END > STYLE > WIDTH 1 > COLOR 242 242 242 > > END > END > CLASS > EXPRESSION "trunk" > TEXT ("[ref]") > STYLE > WIDTH 1 > OUTLINEWIDTH 0.5 > OUTLINECOLOR 217 217 217 > END > STYLE > WIDTH 1 > COLOR 242 242 242 > END > END > END > > When I look in my debug file I see the following as last set of lines:- > > [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7 > [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary" > [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0 > [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] "" > [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0 > [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] "" > [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570 > [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327 > [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570 > [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174) > [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called. > [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called. > [Fri Aug 18 11:09:39 2017].94 > > So it seems to segfault during msPostGISReadShape. > > I?ve checked the query and it is pulling 3110 linestrings from the database. > > But I am not sure why is is segfaulting? Is this a bug? > > Dave Barter > dave at phased.co.uk > @citizenfishy > www.phased.co.uk > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Fri Aug 18 07:54:09 2017 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Fri, 18 Aug 2017 14:54:09 +0000 Subject: [mapserver-users] Segfault - LINE layer Message-ID: <40428ada5d964f929a13764f8542e592@C119S212VM042.msvyvi.vaha.local> Hi, As a quick workaround edit your DATA: where type in ('trunk','motorway','primary') AND geometry is not null -Jukka Rahkonen- L?hett?j?: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Dave Barter L?hetetty: 18. elokuuta 2017 16:05 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] Segfault - LINE layer On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) > wrote: I'd call it a bug. What version? Can you prepare a small test case? MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE I have tracked it down to a specific geometry:- 010200000000000000 = ?LINESTRING EMPTY? ________________________________ From: mapserver-users > on behalf of Dave Barter > Sent: Friday, August 18, 2017 5:13:29 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Segfault - LINE layer This call:- /usr/lib/cgi-bin/mapserv.ngx -nh "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng&SRS=EPSG%3a3857&LAYERS=roads8&transparent=false Is giving me:- Segmentation fault (core dumped) For the layer definition:- LAYER GROUP "default" STATUS ON TYPE LINE MINSCALEDENOM 1300032 MAXSCALEDENOM 2600064 NAME "roads8" DEBUG 5 CONNECTIONTYPE postgis PROCESSING "CLOSE_CONNECTION=DEFER" {%public_map_user%} PROJECTION "init=epsg:900913" END DATA "geometry from (select osm_id,geometry,name as name,ref,type from mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') order by z_order asc) as foo using unique osm_id using srid=900913" LABELITEM "name" CLASSITEM "type" CLASS EXPRESSION {primary,primary_link} STYLE WIDTH 0.5 COLOR 242 242 242 END END CLASS EXPRESSION "motorway" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END CLASS EXPRESSION "trunk" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END END When I look in my debug file I see the following as last set of lines:- [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7 [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary" [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] "" [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] "" [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570 [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327 [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570 [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174) [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called. [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called. [Fri Aug 18 11:09:39 2017].94 So it seems to segfault during msPostGISReadShape. I?ve checked the query and it is pulling 3110 linestrings from the database. But I am not sure why is is segfaulting? Is this a bug? Dave Barter dave at phased.co.uk @citizenfishy www.phased.co.uk _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve.lime at state.mn.us Fri Aug 18 08:19:32 2017 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Fri, 18 Aug 2017 15:19:32 +0000 Subject: [mapserver-users] Segfault - LINE layer In-Reply-To: <9F61D202-D4A5-4441-94A1-DB753838A0D5@phased.co.uk> References: <40428ada5d964f929a13764f8542e592@C119S212VM042.msvyvi.vaha.local> <9F61D202-D4A5-4441-94A1-DB753838A0D5@phased.co.uk> Message-ID: Still it the code should gracefully skip empty geometries. Can you create a ticket please? From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Dave Barter Sent: Friday, August 18, 2017 9:56 AM To: mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Segfault - LINE layer As a quick workaround edit your DATA: where type in ('trunk','motorway','primary') AND geometry is not null -Jukka Rahkonen- That will not work as an empty geometry is not null The fix is WHERE NOT ST_EMPTY(geometry) L?hett?j?: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Dave Barter L?hetetty: 18. elokuuta 2017 16:05 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] Segfault - LINE layer On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) > wrote: I'd call it a bug. What version? Can you prepare a small test case? MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE I have tracked it down to a specific geometry:- 010200000000000000 = ?LINESTRING EMPTY? ________________________________ From: mapserver-users > on behalf of Dave Barter > Sent: Friday, August 18, 2017 5:13:29 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Segfault - LINE layer This call:- /usr/lib/cgi-bin/mapserv.ngx -nh "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng&SRS=EPSG%3a3857&LAYERS=roads8&transparent=false Is giving me:- Segmentation fault (core dumped) For the layer definition:- LAYER GROUP "default" STATUS ON TYPE LINE MINSCALEDENOM 1300032 MAXSCALEDENOM 2600064 NAME "roads8" DEBUG 5 CONNECTIONTYPE postgis PROCESSING "CLOSE_CONNECTION=DEFER" {%public_map_user%} PROJECTION "init=epsg:900913" END DATA "geometry from (select osm_id,geometry,name as name,ref,type from mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') order by z_order asc) as foo using unique osm_id using srid=900913" LABELITEM "name" CLASSITEM "type" CLASS EXPRESSION {primary,primary_link} STYLE WIDTH 0.5 COLOR 242 242 242 END END CLASS EXPRESSION "motorway" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END CLASS EXPRESSION "trunk" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END END When I look in my debug file I see the following as last set of lines:- [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7 [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary" [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] "" [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] "" [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570 [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327 [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570 [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174) [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called. [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called. [Fri Aug 18 11:09:39 2017].94 So it seems to segfault during msPostGISReadShape. I?ve checked the query and it is pulling 3110 linestrings from the database. But I am not sure why is is segfaulting? Is this a bug? Dave Barter dave at phased.co.uk @citizenfishy www.phased.co.uk _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From aperi2007 at gmail.com Fri Aug 18 12:22:15 2017 From: aperi2007 at gmail.com (Andrea Peri) Date: Fri, 18 Aug 2017 21:22:15 +0200 Subject: [mapserver-users] Segfault - LINE layer In-Reply-To: References: <40428ada5d964f929a13764f8542e592@C119S212VM042.msvyvi.vaha.local> <9F61D202-D4A5-4441-94A1-DB753838A0D5@phased.co.uk> Message-ID: Hi, I guess the avoid of empty or null geometries should happened surely in wms service. Not sure It is good in wfs services. A. Il 18 Ago 2017 17:19, "Lime, Steve D (MNIT)" ha scritto: Still it the code should gracefully skip empty geometries. Can you create a ticket please? *From:* mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] *On Behalf Of *Dave Barter *Sent:* Friday, August 18, 2017 9:56 AM *To:* mapserver-users at lists.osgeo.org *Subject:* Re: [mapserver-users] Segfault - LINE layer As a quick workaround edit your DATA: where type in ('trunk','motorway','primary') AND geometry is not null -Jukka Rahkonen- That will not work as an empty geometry is not null The fix is WHERE NOT ST_EMPTY(geometry) *L?hett?j?:* mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org ] *Puolesta *Dave Barter *L?hetetty:* 18. elokuuta 2017 16:05 *Vastaanottaja:* mapserver-users at lists.osgeo.org *Aihe:* Re: [mapserver-users] Segfault - LINE layer On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) wrote: I'd call it a bug. What version? Can you prepare a small test case? MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE I have tracked it down to a specific geometry:- 010200000000000000 = ?LINESTRING EMPTY? ------------------------------ *From:* mapserver-users on behalf of Dave Barter *Sent:* Friday, August 18, 2017 5:13:29 AM *To:* mapserver-users at lists.osgeo.org *Subject:* [mapserver-users] Segfault - LINE layer This call:- /usr/lib/cgi-bin/mapserv.ngx -nh "QUERY_STRING=map=/usr/src/ app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE= WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=& BBOX=-6114.962263%2c6099063.360931%2c162657.996191% 2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng& SRS=EPSG%3a3857&LAYERS=roads8&transparent=false Is giving me:- Segmentation fault (core dumped) For the layer definition:- LAYER GROUP "default" STATUS ON TYPE LINE MINSCALEDENOM 1300032 MAXSCALEDENOM 2600064 NAME "roads8" DEBUG 5 CONNECTIONTYPE postgis PROCESSING "CLOSE_CONNECTION=DEFER" {%public_map_user%} PROJECTION "init=epsg:900913" END DATA "geometry from (select osm_id,geometry,name as name,ref,type from mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') order by z_order asc) as foo using unique osm_id using srid=900913" LABELITEM "name" CLASSITEM "type" CLASS EXPRESSION {primary,primary_link} STYLE WIDTH 0.5 COLOR 242 242 242 END END CLASS EXPRESSION "motorway" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END CLASS EXPRESSION "trunk" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END END When I look in my debug file I see the following as last set of lines:- [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7 [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary" [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] "" [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] "" [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570 [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327 [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570 [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174) [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called. [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called. [Fri Aug 18 11:09:39 2017].94 So it seems to segfault during msPostGISReadShape. I?ve checked the query and it is pulling 3110 linestrings from the database. But I am not sure why is is segfaulting? Is this a bug? Dave Barter dave at phased.co.uk @citizenfishy www.phased.co.uk _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve.lime at state.mn.us Fri Aug 18 13:45:57 2017 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Fri, 18 Aug 2017 20:45:57 +0000 Subject: [mapserver-users] Segfault - LINE layer In-Reply-To: References: <40428ada5d964f929a13764f8542e592@C119S212VM042.msvyvi.vaha.local> <9F61D202-D4A5-4441-94A1-DB753838A0D5@phased.co.uk> , Message-ID: agreed, shouldn't segfault in either case ________________________________ From: Andrea Peri Sent: Friday, August 18, 2017 2:22:15 PM To: Lime, Steve D (MNIT) Cc: Dave Barter; mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Segfault - LINE layer Hi, I guess the avoid of empty or null geometries should happened surely in wms service. Not sure It is good in wfs services. A. Il 18 Ago 2017 17:19, "Lime, Steve D (MNIT)" > ha scritto: Still it the code should gracefully skip empty geometries. Can you create a ticket please? From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Dave Barter Sent: Friday, August 18, 2017 9:56 AM To: mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Segfault - LINE layer As a quick workaround edit your DATA: where type in ('trunk','motorway','primary') AND geometry is not null -Jukka Rahkonen- That will not work as an empty geometry is not null The fix is WHERE NOT ST_EMPTY(geometry) L?hett?j?: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Dave Barter L?hetetty: 18. elokuuta 2017 16:05 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] Segfault - LINE layer On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) > wrote: I'd call it a bug. What version? Can you prepare a small test case? MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE I have tracked it down to a specific geometry:- 010200000000000000 = ?LINESTRING EMPTY? ________________________________ From: mapserver-users > on behalf of Dave Barter > Sent: Friday, August 18, 2017 5:13:29 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Segfault - LINE layer This call:- /usr/lib/cgi-bin/mapserv.ngx -nh "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng&SRS=EPSG%3a3857&LAYERS=roads8&transparent=false Is giving me:- Segmentation fault (core dumped) For the layer definition:- LAYER GROUP "default" STATUS ON TYPE LINE MINSCALEDENOM 1300032 MAXSCALEDENOM 2600064 NAME "roads8" DEBUG 5 CONNECTIONTYPE postgis PROCESSING "CLOSE_CONNECTION=DEFER" {%public_map_user%} PROJECTION "init=epsg:900913" END DATA "geometry from (select osm_id,geometry,name as name,ref,type from mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') order by z_order asc) as foo using unique osm_id using srid=900913" LABELITEM "name" CLASSITEM "type" CLASS EXPRESSION {primary,primary_link} STYLE WIDTH 0.5 COLOR 242 242 242 END END CLASS EXPRESSION "motorway" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END CLASS EXPRESSION "trunk" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END END When I look in my debug file I see the following as last set of lines:- [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7 [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary" [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] "" [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] "" [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570 [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327 [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570 [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174) [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called. [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called. [Fri Aug 18 11:09:39 2017].94 So it seems to segfault during msPostGISReadShape. I?ve checked the query and it is pulling 3110 linestrings from the database. But I am not sure why is is segfaulting? Is this a bug? Dave Barter dave at phased.co.uk @citizenfishy www.phased.co.uk _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Mon Aug 21 00:28:20 2017 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Mon, 21 Aug 2017 07:28:20 +0000 Subject: [mapserver-users] Segfault - LINE layer In-Reply-To: References: <40428ada5d964f929a13764f8542e592@C119S212VM042.msvyvi.vaha.local> <9F61D202-D4A5-4441-94A1-DB753838A0D5@phased.co.uk> , , Message-ID: <1503300501932.54102@maanmittauslaitos.fi> Hi, Agreed, it shouldn't segfault, but I do not quite understand how these empty geometries ever get selected. It is PostGIS backend and WMS GetMap request. As far as I know Mapserver in this case adds the "&&" or "bounding boxes intersect" query to the main query by using the layer extent as reference. As far as I know the only way to prevent this is to set metadata item "wfs_use_default_extent_for_getfeature" to false as documented in http://mapserver.org/ogc/wfs_server.html and even then this only affects WFS service. I made a test with PostGIS by interting two geometries into a table: POLYGON (( 40 40, 40 120, 120 120, 120 40, 40 40 )) LINESTRING EMPTY Query select * from bbox_test where "GEOMETRY" && ST_GeomFromText('POLYGON (( 40 40, 40 120, 120 120, 120 40, 40 40 ))'); does not return the empty geometry. I believe that Dave has something not typical in his environment. As he said, OSM data tend to have empty geometries but for most users rendering OS data still works. What have given problems for me are not empty geometries but invalid ones, typically polygons with only three vertices A-B-A. Dave, please add DEBUG 5 into your layer. It should then log the exact SQL that Mapserver is generating. Check if the && part is added into the query and if it is run the same query diretly with pgAdmin and see if the empty geometries are really selected. -Jukka Rahkonen- ________________________________ L?hett?j?: mapserver-users k?ytt?j?n puolestaLime, Steve D (MNIT) L?hetetty: 18. elokuuta 2017 23:45 Vastaanottaja: Andrea Peri Kopio: Dave Barter; mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] Segfault - LINE layer agreed, shouldn't segfault in either case ________________________________ From: Andrea Peri Sent: Friday, August 18, 2017 2:22:15 PM To: Lime, Steve D (MNIT) Cc: Dave Barter; mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Segfault - LINE layer Hi, I guess the avoid of empty or null geometries should happened surely in wms service. Not sure It is good in wfs services. A. Il 18 Ago 2017 17:19, "Lime, Steve D (MNIT)" > ha scritto: Still it the code should gracefully skip empty geometries. Can you create a ticket please? From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Dave Barter Sent: Friday, August 18, 2017 9:56 AM To: mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Segfault - LINE layer As a quick workaround edit your DATA: where type in ('trunk','motorway','primary') AND geometry is not null -Jukka Rahkonen- That will not work as an empty geometry is not null The fix is WHERE NOT ST_EMPTY(geometry) L?hett?j?: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Dave Barter L?hetetty: 18. elokuuta 2017 16:05 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] Segfault - LINE layer On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) > wrote: I'd call it a bug. What version? Can you prepare a small test case? MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE I have tracked it down to a specific geometry:- 010200000000000000 = ?LINESTRING EMPTY? ________________________________ From: mapserver-users > on behalf of Dave Barter > Sent: Friday, August 18, 2017 5:13:29 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Segfault - LINE layer This call:- /usr/lib/cgi-bin/mapserv.ngx -nh "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng&SRS=EPSG%3a3857&LAYERS=roads8&transparent=false Is giving me:- Segmentation fault (core dumped) For the layer definition:- LAYER GROUP "default" STATUS ON TYPE LINE MINSCALEDENOM 1300032 MAXSCALEDENOM 2600064 NAME "roads8" DEBUG 5 CONNECTIONTYPE postgis PROCESSING "CLOSE_CONNECTION=DEFER" {%public_map_user%} PROJECTION "init=epsg:900913" END DATA "geometry from (select osm_id,geometry,name as name,ref,type from mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') order by z_order asc) as foo using unique osm_id using srid=900913" LABELITEM "name" CLASSITEM "type" CLASS EXPRESSION {primary,primary_link} STYLE WIDTH 0.5 COLOR 242 242 242 END END CLASS EXPRESSION "motorway" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END CLASS EXPRESSION "trunk" TEXT ("[ref]") STYLE WIDTH 1 OUTLINEWIDTH 0.5 OUTLINECOLOR 217 217 217 END STYLE WIDTH 1 COLOR 242 242 242 END END END When I look in my debug file I see the following as last set of lines:- [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7 [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary" [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] "" [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0 [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] "" [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570 [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327 [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570 [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174) [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called. [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called. [Fri Aug 18 11:09:39 2017].94 So it seems to segfault during msPostGISReadShape. I?ve checked the query and it is pulling 3110 linestrings from the database. But I am not sure why is is segfaulting? Is this a bug? Dave Barter dave at phased.co.uk @citizenfishy www.phased.co.uk _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From pe_lord at yahoo.ca Wed Aug 23 08:51:29 2017 From: pe_lord at yahoo.ca (pe_lord) Date: Wed, 23 Aug 2017 08:51:29 -0700 (MST) Subject: [mapserver-users] Multi template In-Reply-To: <1497379083589-5324075.post@n6.nabble.com> References: <1492520742623-5317599.post@n6.nabble.com> <1492534338162-5317655.post@n6.nabble.com> <1492543876608-5317677.post@n6.nabble.com> <1493293693420-5318595.post@n6.nabble.com> <1494524136059-5320221.post@n6.nabble.com> <1497379083589-5324075.post@n6.nabble.com> Message-ID: <1503503489379-5332275.post@n6.nabble.com> One more question. Can template-output-driven be able to live at the same time as other standard templates? Until now, it seems to me that supplant the behavior of the other. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Multi-template-tp5317599p5332275.html Sent from the Mapserver - User mailing list archive at Nabble.com. From steve.lime at state.mn.us Wed Aug 23 09:07:33 2017 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Wed, 23 Aug 2017 16:07:33 +0000 Subject: [mapserver-users] Multi template In-Reply-To: <1503503489379-5332275.post@n6.nabble.com> References: <1492520742623-5317599.post@n6.nabble.com> <1492534338162-5317655.post@n6.nabble.com> <1492543876608-5317677.post@n6.nabble.com> <1493293693420-5318595.post@n6.nabble.com> <1494524136059-5320221.post@n6.nabble.com> <1497379083589-5324075.post@n6.nabble.com> <1503503489379-5332275.post@n6.nabble.com> Message-ID: Yes, you can have both although whenever I've started to use the outputformat-based templating I've abandoned the other approach. If no query format is set then MapServer will revert to the older approach. You can't, however, mix and match the approaches within a single query response. Does that make sense? -----Original Message----- From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of pe_lord Sent: Wednesday, August 23, 2017 10:51 AM To: mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Multi template One more question. Can template-output-driven be able to live at the same time as other standard templates? Until now, it seems to me that supplant the behavior of the other. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Multi-template-tp5317599p5332275.html Sent from the Mapserver - User mailing list archive at Nabble.com. _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From pe_lord at yahoo.ca Wed Aug 23 10:31:25 2017 From: pe_lord at yahoo.ca (pe_lord) Date: Wed, 23 Aug 2017 10:31:25 -0700 (MST) Subject: [mapserver-users] Multi template In-Reply-To: References: <1492534338162-5317655.post@n6.nabble.com> <1492543876608-5317677.post@n6.nabble.com> <1493293693420-5318595.post@n6.nabble.com> <1494524136059-5320221.post@n6.nabble.com> <1497379083589-5324075.post@n6.nabble.com> <1503503489379-5332275.post@n6.nabble.com> Message-ID: <1503509485261-5332287.post@n6.nabble.com> I understand but I cannot get the same behavior. Here some mapfile sample: OUTPUTFORMAT NAME 'html' DRIVER 'TEMPLATE' MIMETYPE 'text/html' FORMATOPTION "FILE=../templates/html.tmpl" FORMATOPTION 'ATTACHMENT=info.html' END LAYER NAME A ... TEMPLATE 'another_template_html.html' ... END LAYER NAME B ... TEMPLATE 'void' # redirect to template-driven output filtered by the resultset tag [resultset layer="B"] ... END At this time, with this configuration, I cannot alternate between the 2 methods. I get a correct template from layer B but nothing from LAYER A... Is it correct? Something wrong? -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Multi-template-tp5317599p5332287.html Sent from the Mapserver - User mailing list archive at Nabble.com. From steve.lime at state.mn.us Wed Aug 23 12:06:07 2017 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Wed, 23 Aug 2017 19:06:07 +0000 Subject: [mapserver-users] Multi template In-Reply-To: <1503509485261-5332287.post@n6.nabble.com> References: <1492534338162-5317655.post@n6.nabble.com> <1492543876608-5317677.post@n6.nabble.com> <1493293693420-5318595.post@n6.nabble.com> <1494524136059-5320221.post@n6.nabble.com> <1497379083589-5324075.post@n6.nabble.com> <1503503489379-5332275.post@n6.nabble.com> <1503509485261-5332287.post@n6.nabble.com> Message-ID: I'll have to setup a quick test to satisfy my own curiosity and report back. -----Original Message----- From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of pe_lord Sent: Wednesday, August 23, 2017 12:31 PM To: mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Multi template I understand but I cannot get the same behavior. Here some mapfile sample: OUTPUTFORMAT NAME 'html' DRIVER 'TEMPLATE' MIMETYPE 'text/html' FORMATOPTION "FILE=../templates/html.tmpl" FORMATOPTION 'ATTACHMENT=info.html' END LAYER NAME A ... TEMPLATE 'another_template_html.html' ... END LAYER NAME B ... TEMPLATE 'void' # redirect to template-driven output filtered by the resultset tag [resultset layer="B"] ... END At this time, with this configuration, I cannot alternate between the 2 methods. I get a correct template from layer B but nothing from LAYER A... Is it correct? Something wrong? -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Multi-template-tp5317599p5332287.html Sent from the Mapserver - User mailing list archive at Nabble.com. _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From pe_lord at yahoo.ca Wed Aug 23 12:33:49 2017 From: pe_lord at yahoo.ca (pe_lord) Date: Wed, 23 Aug 2017 12:33:49 -0700 (MST) Subject: [mapserver-users] Multi template In-Reply-To: References: <1492543876608-5317677.post@n6.nabble.com> <1493293693420-5318595.post@n6.nabble.com> <1494524136059-5320221.post@n6.nabble.com> <1497379083589-5324075.post@n6.nabble.com> <1503503489379-5332275.post@n6.nabble.com> <1503509485261-5332287.post@n6.nabble.com> Message-ID: <1503516829925-5332325.post@n6.nabble.com> I'm on MapServer 7.0.3 -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Multi-template-tp5317599p5332325.html Sent from the Mapserver - User mailing list archive at Nabble.com. From jenia.ivlev at gmail.com Wed Aug 23 18:40:53 2017 From: jenia.ivlev at gmail.com (jenia mtl) Date: Wed, 23 Aug 2017 21:40:53 -0400 Subject: [mapserver-users] How do I perfrom IPC with mapserver? Message-ID: Hello. I need mapserver to get the vector data from another process. Is that possible? Maybe I can use CGI or something else to get vector data from a socket instead of a file? Thanks Jenia Ivlev -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenia.ivlev at gmail.com Wed Aug 23 18:58:22 2017 From: jenia.ivlev at gmail.com (jenia mtl) Date: Wed, 23 Aug 2017 21:58:22 -0400 Subject: [mapserver-users] How do I perfrom IPC with mapserver? In-Reply-To: References: Message-ID: Hi Brent. No problem. Let's all CC the list. That way everyone can share the info. On Wed, Aug 23, 2017 at 9:49 PM, Brent Wood wrote: > Hopefully replies will be posted to the list, but I'm also interested in > any ways of doing this :-) > > Perhaps you could summarise responses if there are useful ones? > > Thanks > > Brent Wood > > Programme leader: Environmental Information Delivery > NIWA > DDI: +64 (4) 3860529 <+64%204-386%200529> > > > Brent Wood > Principal Technician - GIS and Spatial Data Management > Programme Leader - Environmental Information Delivery > +64-4-386-0529 <+64%204-386%200529> | 301 Evans Bay Parade, Greta Point, > Wellington | www.niwa.co.nz > [image: NIWA] > To ensure compliance with legal requirements and to maintain cyber > security standards, NIWA's IT systems are subject to ongoing monitoring, > activity logging and auditing. This monitoring and auditing service may be > provided by third parties. Such third parties can access information > transmitted to, processed by and stored on NIWA's IT systems. > ________________________________________ > From: mapserver-users [mapserver-users-bounces at lists.osgeo.org] on behalf > of jenia mtl [jenia.ivlev at gmail.com] > Sent: Thursday, August 24, 2017 13:40 > To: mapserver-users at lists.osgeo.org > Subject: [mapserver-users] How do I perfrom IPC with mapserver? > > > Hello. > > > I need mapserver to get the vector data from another process. > > Is that possible? Maybe I can use CGI or something else to get vector data > from a socket instead of a file? > > > Thanks > Jenia Ivlev > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image341e7a.JPG Type: image/jpeg Size: 20819 bytes Desc: not available URL: From bob.basques at ci.stpaul.mn.us Thu Aug 24 14:47:47 2017 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Thu, 24 Aug 2017 21:47:47 +0000 Subject: [mapserver-users] Labelling Lines with Center justification not owrking as expected. Message-ID: All, I?m working on a Parcel Assessment app that will display Parcel edges and which streets they abut. I?m trying to label each edge of the parcel with it?s Edge length, but the positioning of the labels is not at all what I?m expecting in the output. Here is a sample image: https://www.dropbox.com/s/ppp1cihnl4flycf/rc_parcels_assessment.02.png?dl=0 The blue lines represent a connection from the center of each of the parcel edge segments being assigned, to the approriate Street/Alley centerline (not shown). I can?t seem to get the labels to center them selves on the segments. There should be one distance label centered on each segment at the start of each of the blue lines where they intersect the red parcel edges. My next workaround would be to use a centroid of the line as the label point. I think I?ve tried all available combinations of settings in the Mapfile, but maybe I missed something. Anyone have any ideas? Here is the Label layer for the Parcel edges: LAYER NAME 'Parcels-Query-Edges' STATUS ON TYPE LINE METADATA "ows_title" "Parcels-Query-Edges" "gml_include_items" "all" END CONNECTIONTYPE PostGIS CONNECTION ?***REMOVED***? DATA "geom from ( select round(length::numeric,2) round_el, * from assessment.rc_parcel_segments_no_overlaps WHERE parcelid = '%pin%' OR parcelid = '%qstring%' ) as subquery using unique segid srid=200068" PROJECTION "init=epsg:200068" END CLASSITEM "parcelid" LABELITEM "round_el" VALIDATION 'pin' '^[0-9]{12}$' 'qstring' '^[0-9]{12}$' END CLASS STYLE GEOMTRANSFORM "start" SYMBOL "circle" COLOR 255 0 0 SIZE 12 END STYLE GEOMTRANSFORM "end" SYMBOL "circle" COLOR 255 0 0 SIZE 12 END # STYLE LABEL FORCE true COLOR 255 0 0 OUTLINECOLOR 255 255 255 FONT "arial-bold" TYPE truetype SIZE 12 ANGLE auto POSITION auto END END # CLASS TEMPLATE 'TEMPLATES/empty.html' END # LAYER Thanks bobb "Reality is merely an illusion, albeit a very persistent one." - Albert Einstein -------------- next part -------------- An HTML attachment was scrubbed... URL: From woodbri at swoodbridge.com Thu Aug 24 17:29:37 2017 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Thu, 24 Aug 2017 20:29:37 -0400 Subject: [mapserver-users] Labelling Lines with Center justification not owrking as expected. In-Reply-To: References: Message-ID: On 8/24/2017 5:47 PM, Basques, Bob (CI-StPaul) wrote: > All, > > I?m working on a Parcel Assessment app that will display Parcel edges > and which streets they abut. ?I?m trying to label each edge of the > parcel with it?s Edge length, but the positioning of the labels is not > at all what I?m expecting in the output. ?Here is a sample image: > > https://www.dropbox.com/s/ppp1cihnl4flycf/rc_parcels_assessment.02.png?dl=0 > > The blue lines represent a connection from the center of each of the > parcel edge segments being assigned, to the approriate Street/Alley > centerline (not shown). ?I can?t seem to get the labels to center them > selves on the segments. ?There should be one distance label centered on > each segment at the start of each of the blue lines where they intersect > the red parcel edges. > > My next workaround would be to use a centroid of the line as the label > point. ?I think I?ve tried all available combinations of settings in the > Mapfile, but maybe I missed something. > > Anyone have any ideas? In the LABEL use a geotransform "center" to create the label point, but this has the problem that you have a point so you have to precompute the ANGLE [angle] in the SQL and make that available to align the label with the edge. -Steve W > Here is the Label layer for the Parcel edges: > > LAYER > NAME 'Parcels-Query-Edges' > STATUS ON > TYPE LINE > > METADATA > "ows_title" "Parcels-Query-Edges" > "gml_include_items" "all" > END > > CONNECTIONTYPE PostGIS > CONNECTION ?***REMOVED***? > DATA "geom from ( > select > round(length::numeric,2) round_el, > * from assessment.rc_parcel_segments_no_overlaps > WHERE parcelid = '%pin%' > OR parcelid = '%qstring%' > ) as subquery using unique segid srid=200068" > > PROJECTION > "init=epsg:200068" > END > > CLASSITEM "parcelid" > LABELITEM "round_el" > > VALIDATION > 'pin' '^[0-9]{12}$' > 'qstring' '^[0-9]{12}$' > END > > CLASS > STYLE > GEOMTRANSFORM "start" > SYMBOL "circle" > COLOR 255 0 0 > SIZE 12 > END > STYLE > GEOMTRANSFORM "end" > SYMBOL "circle" > COLOR 255 0 0 > SIZE 12 > END # STYLE > LABEL > FORCE true > COLOR ?255 0 0 > OUTLINECOLOR 255 255 255 > FONT "arial-bold" > TYPE truetype > SIZE 12 > ANGLE auto > POSITION auto > END > END # CLASS > TEMPLATE 'TEMPLATES/empty.html' > END # LAYER > > Thanks > > bobb > > > > > > > "Reality is merely an illusion, albeit a very persistent one." > - Albert Einstein > > > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus From jukka.rahkonen at maanmittauslaitos.fi Fri Aug 25 05:32:14 2017 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Fri, 25 Aug 2017 12:32:14 +0000 Subject: [mapserver-users] Mapserver 7.0.6 from MS4W does not find spatial index from Spatialite Message-ID: Hi, I have a Spatialite database which has a valid and consistent spatial index if I ask spatialite-gui to check it. However Mapserver 7.0.6 from MS4W 3.2.2 does not find it. Layer is defined as CONNECTIONTYPE OGR DEBUG 5 CONNECTION "\ms4w_data\apps\wms-wfs.sqlite" DATA "select * from states" [Fri Aug 25 15:17:41 2017].225000 OGROPen(\ms4w_data\apps\wms-wfs.sqlite) [Fri Aug 25 15:17:41 2017].235000 msConnPoolRegister(states,\ms4w_data\apps\wms-wfs.sqlite,00A0F2D0) [Fri Aug 25 15:17:41 2017].236000 msOGRFileOpen(): Layer select * from states has spatial index disabled [Fri Aug 25 15:17:41 2017].236000 msOGRFileWhichShapes: SQL = select * from states WHERE MbrIntersects("Geometry", BuildMbr(-110.556532,27.919128,-78.556643,44.907341)). I wonder what is the check that is performed. Obviously not either of these two: select spatial_index_enabled from geometry_columns where f_table_name='states'; returns 1 select checkspatialindex('states','geometry'); returns 1 -Jukka Rahkonen- -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Fri Aug 25 08:56:29 2017 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Fri, 25 Aug 2017 15:56:29 +0000 Subject: [mapserver-users] Labelling Lines with Center justification not owrking as expected. In-Reply-To: References: Message-ID: Steve, Doesn?t look like there is a LABEL option avaiable for GEOMTRANSFORM. All needs to be inside of the STYLE block. I tried wrapping it in a STYLE block inside of the Label, and got back: msDrawLabelCAche(): General error message. Labels only support LABELPNT and LABELPOLY GEOMTRANSFORMS I also tried ?center? and ?centroid? as parameters. . . . bobb On Aug 24, 2017, at 7:29 PM, Stephen Woodbridge > wrote: On 8/24/2017 5:47 PM, Basques, Bob (CI-StPaul) wrote: All, I?m working on a Parcel Assessment app that will display Parcel edges and which streets they abut. I?m trying to label each edge of the parcel with it?s Edge length, but the positioning of the labels is not at all what I?m expecting in the output. Here is a sample image: https://www.dropbox.com/s/ppp1cihnl4flycf/rc_parcels_assessment.02.png?dl=0 The blue lines represent a connection from the center of each of the parcel edge segments being assigned, to the approriate Street/Alley centerline (not shown). I can?t seem to get the labels to center them selves on the segments. There should be one distance label centered on each segment at the start of each of the blue lines where they intersect the red parcel edges. My next workaround would be to use a centroid of the line as the label point. I think I?ve tried all available combinations of settings in the Mapfile, but maybe I missed something. Anyone have any ideas? In the LABEL use a geotransform "center" to create the label point, but this has the problem that you have a point so you have to precompute the ANGLE [angle] in the SQL and make that available to align the label with the edge. -Steve W Here is the Label layer for the Parcel edges: LAYER NAME 'Parcels-Query-Edges' STATUS ON TYPE LINE METADATA "ows_title" "Parcels-Query-Edges" "gml_include_items" "all" END CONNECTIONTYPE PostGIS CONNECTION ?***REMOVED***? DATA "geom from ( select round(length::numeric,2) round_el, * from assessment.rc_parcel_segments_no_overlaps WHERE parcelid = '%pin%' OR parcelid = '%qstring%' ) as subquery using unique segid srid=200068" PROJECTION "init=epsg:200068" END CLASSITEM "parcelid" LABELITEM "round_el" VALIDATION 'pin' '^[0-9]{12}$' 'qstring' '^[0-9]{12}$' END CLASS STYLE GEOMTRANSFORM "start" SYMBOL "circle" COLOR 255 0 0 SIZE 12 END STYLE GEOMTRANSFORM "end" SYMBOL "circle" COLOR 255 0 0 SIZE 12 END # STYLE LABEL FORCE true COLOR 255 0 0 OUTLINECOLOR 255 255 255 FONT "arial-bold" TYPE truetype SIZE 12 ANGLE auto POSITION auto END END # CLASS TEMPLATE 'TEMPLATES/empty.html' END # LAYER Thanks bobb "Reality is merely an illusion, albeit a very persistent one." - Albert Einstein _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. ?Antoine de Saint-Exup?ry -------------- next part -------------- An HTML attachment was scrubbed... URL: From even.rouault at spatialys.com Fri Aug 25 12:14:37 2017 From: even.rouault at spatialys.com (Even Rouault) Date: Fri, 25 Aug 2017 21:14:37 +0200 Subject: [mapserver-users] Mapserver 7.0.6 from MS4W does not find spatial index from Spatialite In-Reply-To: References: Message-ID: <1810323.xAmE5xPsE8@even-i700> On vendredi 25 ao?t 2017 12:32:14 CEST Rahkonen Jukka (MML) wrote: > Hi, > > I have a Spatialite database which has a valid and consistent spatial index > if I ask spatialite-gui to check it. However Mapserver 7.0.6 from MS4W > 3.2.2 does not find it. > > Layer is defined as > > CONNECTIONTYPE OGR > DEBUG 5 > CONNECTION "\ms4w_data\apps\wms-wfs.sqlite" > DATA "select * from states" > > [Fri Aug 25 15:17:41 2017].225000 OGROPen(\ms4w_data\apps\wms-wfs.sqlite) > [Fri Aug 25 15:17:41 2017].235000 > msConnPoolRegister(states,\ms4w_data\apps\wms-wfs.sqlite,00A0F2D0) [Fri Aug > 25 15:17:41 2017].236000 msOGRFileOpen(): Layer select * from states has > spatial index disabled [Fri Aug 25 15:17:41 2017].236000 > msOGRFileWhichShapes: SQL = select * from states WHERE > MbrIntersects("Geometry", > BuildMbr(-110.556532,27.919128,-78.556643,44.907341)). > > I wonder what is the check that is performed. Obviously not either of these > two: > > select spatial_index_enabled from geometry_columns where > f_table_name='states'; returns 1 > select checkspatialindex('states','geometry'); There's this test that is done: char* pszRequest = NULL; pszRequest = msStringConcatenate(pszRequest, "SELECT * FROM sqlite_master WHERE type = 'table' AND name = 'idx_"); pszRequest = msStringConcatenate(pszRequest, psInfo->pszSpatialFilterTableName); pszRequest = msStringConcatenate(pszRequest, "_"); pszRequest = msStringConcatenate(pszRequest, OGR_L_GetGeometryColumn(psInfo->hLayer)); pszRequest = msStringConcatenate(pszRequest, "'"); So it checks the existence of idx_{tablename}_{geometryname} table, but in a case sensitive way. Here I see from the MbrIntersects() call that the geometry name is Geometry, so I guess it tries idx_states_Geometry, but that actual name must be idx_states_geometry. Can you retry by putting the table and geometry column name in lower case ? If that works, the test should likely be fixed to be case insensitive. > returns 1 > > -Jukka Rahkonen- -- Spatialys - Geospatial professional services http://www.spatialys.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Fri Aug 25 12:29:12 2017 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Fri, 25 Aug 2017 19:29:12 +0000 Subject: [mapserver-users] Labelling Lines with Center justification not owrking as expected. In-Reply-To: References: Message-ID: <96D3B6F6-EBF2-4170-BD31-DADF7240EB39@ci.stpaul.mn.us> Ok, at least now they are in the right spot. https://www.dropbox.com/s/tsyr3p0zyui65cb/rc_parcels_assessment.02b.png?dl=0 GEOMTRANSFORM doesn?t seem to work on Lines . . . so . . . I added a layer just for the Label point from the original line segments in Postgres . . . LAYER NAME 'Parcels-Query-Edges-Label' STATUS ON TYPE POINT METADATA "ows_title" "Parcels-Query-Edges-Label" "gml_include_items" "all" END CONNECTIONTYPE PostGIS CONNECTION ?host=localhost dbname=postgres user=mapserv password=***? DATA "geom from ( select ST_Centroid(geom) geom, round(length::numeric,2) round_el, segid, parcelid, length from assessment.rc_parcel_segments_no_overlaps WHERE parcelid = '%pin%' OR parcelid = '%qstring%' ) as subquery using unique segid srid=200068" PROJECTION "init=epsg:200068" END CLASSITEM "parcelid" LABELITEM "round_el" LABELCACHE on VALIDATION 'pin' '^[0-9]{12}$' 'qstring' '^[0-9]{12}$' END CLASS LABEL FORCE true COLOR 0 255 0 OUTLINECOLOR 255 255 255 FONT "arial-bold" TYPE truetype SIZE 12 ANGLE auto POSITION uc END END # CLASS TEMPLATE 'TEMPLATES/empty.html' END # LAYER bobb On Aug 25, 2017, at 10:56 AM, Basques, Bob (CI-StPaul) wrote: Steve, Doesn?t look like there is a LABEL option avaiable for GEOMTRANSFORM. All needs to be inside of the STYLE block. I tried wrapping it in a STYLE block inside of the Label, and got back: msDrawLabelCAche(): General error message. Labels only support LABELPNT and LABELPOLY GEOMTRANSFORMS I also tried ?center? and ?centroid? as parameters. . . . bobb On Aug 24, 2017, at 7:29 PM, Stephen Woodbridge > wrote: On 8/24/2017 5:47 PM, Basques, Bob (CI-StPaul) wrote: All, I?m working on a Parcel Assessment app that will display Parcel edges and which streets they abut. I?m trying to label each edge of the parcel with it?s Edge length, but the positioning of the labels is not at all what I?m expecting in the output. Here is a sample image: https://www.dropbox.com/s/ppp1cihnl4flycf/rc_parcels_assessment.02.png?dl=0 The blue lines represent a connection from the center of each of the parcel edge segments being assigned, to the approriate Street/Alley centerline (not shown). I can?t seem to get the labels to center them selves on the segments. There should be one distance label centered on each segment at the start of each of the blue lines where they intersect the red parcel edges. My next workaround would be to use a centroid of the line as the label point. I think I?ve tried all available combinations of settings in the Mapfile, but maybe I missed something. Anyone have any ideas? In the LABEL use a geotransform "center" to create the label point, but this has the problem that you have a point so you have to precompute the ANGLE [angle] in the SQL and make that available to align the label with the edge. -Steve W Here is the Label layer for the Parcel edges: LAYER NAME 'Parcels-Query-Edges' STATUS ON TYPE LINE METADATA "ows_title" "Parcels-Query-Edges" "gml_include_items" "all" END CONNECTIONTYPE PostGIS CONNECTION ?***REMOVED***? DATA "geom from ( select round(length::numeric,2) round_el, * from assessment.rc_parcel_segments_no_overlaps WHERE parcelid = '%pin%' OR parcelid = '%qstring%' ) as subquery using unique segid srid=200068" PROJECTION "init=epsg:200068" END CLASSITEM "parcelid" LABELITEM "round_el" VALIDATION 'pin' '^[0-9]{12}$' 'qstring' '^[0-9]{12}$' END CLASS STYLE GEOMTRANSFORM "start" SYMBOL "circle" COLOR 255 0 0 SIZE 12 END STYLE GEOMTRANSFORM "end" SYMBOL "circle" COLOR 255 0 0 SIZE 12 END # STYLE LABEL FORCE true COLOR 255 0 0 OUTLINECOLOR 255 255 255 FONT "arial-bold" TYPE truetype SIZE 12 ANGLE auto POSITION auto END END # CLASS TEMPLATE 'TEMPLATES/empty.html' END # LAYER Thanks bobb "Reality is merely an illusion, albeit a very persistent one." - Albert Einstein _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. ?Antoine de Saint-Exup?ry _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users An inventor is simply a fellow who doesn?t take his education too seriously. ?Charles F. Kettering -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Fri Aug 25 13:39:45 2017 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Fri, 25 Aug 2017 20:39:45 +0000 Subject: [mapserver-users] Mapserver 7.0.6 from MS4W does not find spatial index from Spatialite In-Reply-To: <1810323.xAmE5xPsE8@even-i700> References: , <1810323.xAmE5xPsE8@even-i700> Message-ID: <1503693585039.21051@maanmittauslaitos.fi> Hi, My db was made with spatialite-gui and it creates geometry column 'Geometry' and index as CREATE VIRTUAL TABLE "idx_states_Geometry" USING rtree( pkid, xmin, xmax, ymin, ymax) So I think that your guess is not correct. I copied the database with ogr2ogr and then the spatial index is found as can be seen from the Mapserver log: [Fri Aug 25 23:26:06 2017].755000 msOGRFileOpen(): Layer 0 has spatial index enabled [Fri Aug 25 23:26:06 2017].755000 msOGRFileWhichShapes: Setting spatial filter to -124.70843703125 21.84359421875 -66.99236296875 52.48410578125 Column in now 'GEOMETRY' and index CREATE VIRTUAL TABLE "idx_states_GEOMETRY" USING rtree(pkid, xmin, xmax, ymin, ymax) I can't guess what goes wrong. I believe that it would be safe to compare the names with "tolower". You can use case sensitive names in SQLite ('Geometry' or 'GEOMETRY') but you can't create both 'Geometry' and 'GEOMETRY' into the same table if I remember right. -Jukka- ________________________________ L?hett?j?: Even Rouault L?hetetty: 25. elokuuta 2017 22:14 Vastaanottaja: mapserver-users at lists.osgeo.org Kopio: Rahkonen Jukka (MML) Aihe: Re: [mapserver-users] Mapserver 7.0.6 from MS4W does not find spatial index from Spatialite On vendredi 25 ao?t 2017 12:32:14 CEST Rahkonen Jukka (MML) wrote: > Hi, > > I have a Spatialite database which has a valid and consistent spatial index > if I ask spatialite-gui to check it. However Mapserver 7.0.6 from MS4W > 3.2.2 does not find it. > > Layer is defined as > > CONNECTIONTYPE OGR > DEBUG 5 > CONNECTION "\ms4w_data\apps\wms-wfs.sqlite" > DATA "select * from states" > > [Fri Aug 25 15:17:41 2017].225000 OGROPen(\ms4w_data\apps\wms-wfs.sqlite) > [Fri Aug 25 15:17:41 2017].235000 > msConnPoolRegister(states,\ms4w_data\apps\wms-wfs.sqlite,00A0F2D0) [Fri Aug > 25 15:17:41 2017].236000 msOGRFileOpen(): Layer select * from states has > spatial index disabled [Fri Aug 25 15:17:41 2017].236000 > msOGRFileWhichShapes: SQL = select * from states WHERE > MbrIntersects("Geometry", > BuildMbr(-110.556532,27.919128,-78.556643,44.907341)). > > I wonder what is the check that is performed. Obviously not either of these > two: > > select spatial_index_enabled from geometry_columns where > f_table_name='states'; returns 1 > select checkspatialindex('states','geometry'); There's this test that is done: char* pszRequest = NULL; pszRequest = msStringConcatenate(pszRequest, "SELECT * FROM sqlite_master WHERE type = 'table' AND name = 'idx_"); pszRequest = msStringConcatenate(pszRequest, psInfo->pszSpatialFilterTableName); pszRequest = msStringConcatenate(pszRequest, "_"); pszRequest = msStringConcatenate(pszRequest, OGR_L_GetGeometryColumn(psInfo->hLayer)); pszRequest = msStringConcatenate(pszRequest, "'"); So it checks the existence of idx_{tablename}_{geometryname} table, but in a case sensitive way. Here I see from the MbrIntersects() call that the geometry name is Geometry, so I guess it tries idx_states_Geometry, but that actual name must be idx_states_geometry. Can you retry by putting the table and geometry column name in lower case ? If that works, the test should likely be fixed to be case insensitive. > returns 1 > > -Jukka Rahkonen- -- Spatialys - Geospatial professional services http://www.spatialys.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From woodbri at swoodbridge.com Fri Aug 25 17:25:57 2017 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Fri, 25 Aug 2017 20:25:57 -0400 Subject: [mapserver-users] Labelling Lines with Center justification not owrking as expected. In-Reply-To: References: Message-ID: <77c647ec-d2cc-f64c-1dec-246fb25169d5@swoodbridge.com> bobb, Ok, then I think you should probably compute a point, label, angle columns in the SQL and then use these to generate the label Something like: LAYER TYPE POINT ... DATA "geom from ( select gid, st_centroid(geom) as geom, format(..., st_length(geom)*convert2units), st_azimuth(geom) as angle from table ) as subquery using unique segid srid=200068" LABELITEM "label" CLASS LABEL ANGLE [angle] ... END END END On 8/25/2017 11:56 AM, Basques, Bob (CI-StPaul) wrote: > Steve, > > Doesn?t look like there is a LABEL option avaiable for GEOMTRANSFORM. > ?All needs to be inside of the STYLE block. ?I tried wrapping it in a > STYLE block inside of the Label, and got back: > > > msDrawLabelCAche(): General error message. Labels only support LABELPNT > and LABELPOLY GEOMTRANSFORMS > > > I also tried ?center? and ?centroid? as parameters. . . . > > bobb > > > > >> On Aug 24, 2017, at 7:29 PM, Stephen Woodbridge >> > wrote: >> >> On 8/24/2017 5:47 PM, Basques, Bob (CI-StPaul) wrote: >>> All, >>> I?m working on a Parcel Assessment app that will display Parcel edges >>> and which streets they abut. ?I?m trying to label each edge of the >>> parcel with it?s Edge length, but the positioning of the labels is >>> not at all what I?m expecting in the output. Here is a sample image: >>> https://www.dropbox.com/s/ppp1cihnl4flycf/rc_parcels_assessment.02.png?dl=0 >>> The blue lines represent a connection from the center of each of the >>> parcel edge segments being assigned, to the approriate Street/Alley >>> centerline (not shown). ?I can?t seem to get the labels to center >>> them selves on the segments. ?There should be one distance label >>> centered on each segment at the start of each of the blue lines where >>> they intersect the red parcel edges. >>> My next workaround would be to use a centroid of the line as the >>> label point. ?I think I?ve tried all available combinations of >>> settings in the Mapfile, but maybe I missed something. >>> Anyone have any ideas? >> >> In the LABEL use a geotransform "center" to create the label point, >> but this has the problem that you have a point so you have to >> precompute the ANGLE [angle] in the SQL and make that available to >> align the label with the edge. >> >> -Steve W >> >>> Here is the Label layer for the Parcel edges: >>> LAYER >>> NAME 'Parcels-Query-Edges' >>> STATUS ON >>> TYPE LINE >>> METADATA >>> "ows_title" "Parcels-Query-Edges" >>> "gml_include_items" "all" >>> END >>> CONNECTIONTYPE PostGIS >>> CONNECTION ?***REMOVED***? >>> DATA "geom from ( >>> select >>> round(length::numeric,2) round_el, >>> * from assessment.rc_parcel_segments_no_overlaps >>> WHERE parcelid = '%pin%' >>> OR parcelid = '%qstring%' >>> ) as subquery using unique segid srid=200068" >>> PROJECTION >>> "init=epsg:200068" >>> END >>> CLASSITEM "parcelid" >>> LABELITEM "round_el" >>> VALIDATION >>> 'pin' '^[0-9]{12}$' >>> 'qstring' '^[0-9]{12}$' >>> END >>> CLASS >>> STYLE >>> GEOMTRANSFORM "start" >>> SYMBOL "circle" >>> COLOR 255 0 0 >>> SIZE 12 >>> END >>> STYLE >>> GEOMTRANSFORM "end" >>> SYMBOL "circle" >>> COLOR 255 0 0 >>> SIZE 12 >>> END # STYLE >>> LABEL >>> FORCE true >>> COLOR ?255 0 0 >>> OUTLINECOLOR 255 255 255 >>> FONT "arial-bold" >>> TYPE truetype >>> SIZE 12 >>> ANGLE auto >>> POSITION auto >>> END >>> END # CLASS >>> TEMPLATE 'TEMPLATES/empty.html' >>> END # LAYER >>> Thanks >>> bobb >>> "Reality is merely an illusion, albeit a very persistent one." >>> ???- Albert Einstein >>> _______________________________________________ >>> mapserver-users mailing list >>> mapserver-users at lists.osgeo.org >>> https://lists.osgeo.org/mailman/listinfo/mapserver-users >> >> >> --- >> This email has been checked for viruses by Avast antivirus software. >> https://www.avast.com/antivirus >> >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > Perfection is achieved, not when there is nothing more to add, but when > there is nothing left to take away. > ?Antoine de Saint-Exup?ry > > > From aperi2007 at gmail.com Mon Aug 28 00:55:06 2017 From: aperi2007 at gmail.com (Andrea Peri) Date: Mon, 28 Aug 2017 09:55:06 +0200 Subject: [mapserver-users] A legend with the number of features Message-ID: Hi, I need to produce a legend from a GetLegendGraphics request froma categorized rendering where there is a number of features for every value. Is this possible with mapserver ? Thx, -- ----------------- Andrea Peri . . . . . . . . . qwerty ????? ----------------- From schepers at rvr-online.de Mon Aug 28 00:56:59 2017 From: schepers at rvr-online.de (Schepers, Benjamin) Date: Mon, 28 Aug 2017 07:56:59 +0000 Subject: [mapserver-users] Using OGL rendering instead of AGG In-Reply-To: <1500981258419-5329120.post@n6.nabble.com> References: <1500981258419-5329120.post@n6.nabble.com> Message-ID: <7088A26751CB34409B159B4237D510A87CA5EFE0@W2K8-EXDB02.VERBAND.LOCAL> Hi Ram, the DEM-service we provide, uses the classic mechanism with pixel value and expression. The response-times with nearly fullscreen WMS (Format PNG8 or JPEG) are < 1s; there are also some image manipulations done which cost some additional time (BILINEAR-Resampling, COMPOSITE-Features for combination with hillshade, etc.). So in summary mapserver performs generally very well with such raster-data... MAPFILE-Snippet (Classification from 0 - 500m) : CLASSITEM "pixel" CLASS EXPRESSION ([pixel] >= 0 AND [pixel] < 100) STYLE COLORRANGE 108 163 99 165 186 111 DATARANGE 0 100 RANGEITEM "pixel" END END CLASS EXPRESSION ([pixel] >= 100 AND [pixel] < 200) STYLE COLORRANGE 165 186 111 231 213 122 DATARANGE 100 200 RANGEITEM "pixel" END END CLASS EXPRESSION ([pixel] >= 200 AND [pixel] < 300) STYLE COLORRANGE 231 213 122 199 167 92 DATARANGE 200 300 RANGEITEM "pixel" END END CLASS EXPRESSION ([pixel] >= 300 AND [pixel] < 400) STYLE COLORRANGE 199 167 92 176 120 58 DATARANGE 300 400 RANGEITEM "pixel" END END CLASS EXPRESSION ([pixel] >= 400 AND [pixel] < 500) STYLE COLORRANGE 176 120 58 215 127 63 DATARANGE 400 500 RANGEITEM "pixel" END END Maybe your data could be optimized, if you are not satisfied with response-times? If I remember right, I used 32-bit grayscale GeoTIFF for DEM and Hillshade (both with DEFLATE-Compression and internal TILING) and I also calculated Overviews with gdaladdo for faster presentation in smaller scales... Ben -----Urspr?ngliche Nachricht----- Von: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Im Auftrag von ramchandra Gesendet: Dienstag, 25. Juli 2017 13:14 An: mapserver-users at lists.osgeo.org Betreff: [mapserver-users] Using OGL rendering instead of AGG Hi All, I am trying to color classify a DEM by adding multiple styles to the layer entry in the map file using the PIXEL value as the EXPRESSION. I am trying to speedup the rendering of the styled layer. I tried using the Hardware accelerated rendering through OpenGL. I have added the cmake flags so that OpenGL binaries are loaded when building Mapserver. I also made changes in the source code to enable the OGL Rendering by setting the MACRO #USE_OGL to 1. I have also changed my OUTPUTFORMAT as follows to trigger opengl rendering. OUTPUTFORMAT NAME "OGL_PNG24" DRIVER "OGL/PNG" IMAGEMODE RGB END # OUTPUTFORMAT In-spite of doing all these when i am sending the request it appends a new OUTPUTFORMAT object with AGG Driver as follows. OUTPUTFORMAT NAME "png" MIMETYPE "image/png" DRIVER "AGG/PNG" EXTENSION "png" IMAGEMODE RGB TRANSPARENT FALSE END # OUTPUTFORMAT It also changes my OGL OUTPUTFORMAT by adding the additional fields MIMETYPE and EXTENSION. OUTPUTFORMAT NAME "OGL_PNG24" MIMETYPE "image/png; mode=24bit" DRIVER "OGL/PNG" EXTENSION "png" IMAGEMODE RGB TRANSPARENT FALSE END # OUTPUTFORMAT When I debug the code I see an error when the OGL output format block is parsed. The error says "OGL_PNG24 driver is not configured". Can anyone point out what might me causing this error or how to enable OpenGL based rendering. Regards, Ram -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Using-OGL-rendering-instead-of-AGG-tp5329120.html Sent from the Mapserver - User mailing list archive at Nabble.com. _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From lars.schylberg at blixtmail.se Mon Aug 28 04:08:55 2017 From: lars.schylberg at blixtmail.se (lars.schylberg at blixtmail.se) Date: Mon, 28 Aug 2017 13:08:55 +0200 Subject: [mapserver-users] A legend with the number of features In-Reply-To: References: Message-ID: I guess this is ok as long as You have a CLASS for each feature.? The GetLegendGraphics looks for the NAME in each class and makes an entry in the legend based on that. /Lars S. -----Originalmeddelande----- > Fr?n: "Andrea Peri" > Till: mapserver-users at lists.osgeo.org > Datum: 2017-08-28 09:55 > ?mne: [mapserver-users] A legend with the number of features > > Hi, > I need to produce a legend from a GetLegendGraphics request froma > categorized rendering where there is a number of features for every > value. > > Is this possible with mapserver ? > > Thx, > -- > ----------------- > Andrea Peri > . . . . . . . . . > qwerty ????? > ----------------- > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users -- ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sethg at geographika.co.uk Tue Aug 29 10:01:21 2017 From: sethg at geographika.co.uk (Seth G) Date: Tue, 29 Aug 2017 19:01:21 +0200 Subject: [mapserver-users] SLD symbols in MapServer Message-ID: <1504026081.486972.1088798696.138383E7@webmail.messagingengine.com> Hi all, I've been trying out the applySLD functions in MapScript. A symbol in the SLD containing the following: circle Produces a Mapfile style such as: STYLE COLOR 236 165 77 OUTLINECOLOR "#00000000" SIZE 9 SYMBOL "sld_mark_symbol_circle_filled" END # STYLE There are a whole set of these symbol names defined in https://github.com/mapserver/mapserver/blob/master/mapogcsld.c #define SLD_LINE_SYMBOL_NAME "sld_line_symbol" #define SLD_LINE_SYMBOL_DASH_NAME "sld_line_symbol_dash" #define SLD_MARK_SYMBOL_SQUARE "sld_mark_symbol_square" #define SLD_MARK_SYMBOL_SQUARE_FILLED "sld_mark_symbol_square_filled" #define SLD_MARK_SYMBOL_CIRCLE "sld_mark_symbol_circle" #define SLD_MARK_SYMBOL_CIRCLE_FILLED "sld_mark_symbol_circle_filled" #define SLD_MARK_SYMBOL_TRIANGLE "sld_mark_symbol_triangle" #define SLD_MARK_SYMBOL_TRIANGLE_FILLED "sld_mark_symbol_triangle_filled" #define SLD_MARK_SYMBOL_STAR "sld_mark_symbol_star" #define SLD_MARK_SYMBOL_STAR_FILLED "sld_mark_symbol_star_filled" #define SLD_MARK_SYMBOL_CROSS "sld_mark_symbol_cross" #define SLD_MARK_SYMBOL_CROSS_FILLED "sld_mark_symbol_cross_filled" #define SLD_MARK_SYMBOL_X "sld_mark_symbol_x" #define SLD_MARK_SYMBOL_X_FILLED "sld_mark_symbol_x_filled" Are these symbols available anywhere? Or should we implement these ourselves? Any information on the above would be much appreciated. Regards, Seth -- web:http://geographika.co.uk twitter: @geographika From bob.basques at ci.stpaul.mn.us Thu Aug 31 07:28:22 2017 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Thu, 31 Aug 2017 14:28:22 +0000 Subject: [mapserver-users] Legend graphics for individual layers in Mapfile. Message-ID: All, I was wondering if there was a way to grab an individual layer legend graphic via a TEMPLATE? I want to use the graphic as a header in a HTML popup for each feature in a layer? Can this sort of thing be catured in the TEMPLATE somehow? Failing that, what about a SPRITE approach, is there any way to count down the legend list based on name (via the TEMPLATE) to window out the appropriate legend graphic for display? I?m just trying to automate the process of putting the Carto Symbol into the popups if possible. Thanks bobb "I'm not interested in preserving the status quo; I want to overthrow it.? - Niccolo Machiavelli -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Thu Aug 31 07:34:48 2017 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Thu, 31 Aug 2017 14:34:48 +0000 Subject: [mapserver-users] Legend graphics for individual layers in Mapfile. In-Reply-To: References: Message-ID: <911ED88E-6E08-4636-BBDB-DE2B1152D0B4@ci.stpaul.mn.us> Hmm, I wonder if SHPXY and SVG could work here?? Can I grap the colors for SVG perhaps? bobb On Aug 31, 2017, at 9:28 AM, Basques, Bob (CI-StPaul) > wrote: All, I was wondering if there was a way to grab an individual layer legend graphic via a TEMPLATE? I want to use the graphic as a header in a HTML popup for each feature in a layer? Can this sort of thing be catured in the TEMPLATE somehow? Failing that, what about a SPRITE approach, is there any way to count down the legend list based on name (via the TEMPLATE) to window out the appropriate legend graphic for display? I?m just trying to automate the process of putting the Carto Symbol into the popups if possible. Thanks bobb "I'm not interested in preserving the status quo; I want to overthrow it.? - Niccolo Machiavelli _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users "I have never killed anyone, but I have read some obituary notices with great satisfaction." - Clarence Darrow -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcnolii at hotmail.com Thu Aug 31 10:24:02 2017 From: mcnolii at hotmail.com (Olivier Gagnon) Date: Thu, 31 Aug 2017 17:24:02 +0000 Subject: [mapserver-users] Dynamic Watermark Message-ID: Hi there, I'm new to mapserver. I need to develop a custom function to add a dynamic watermark using a wms layer. The process is simple : I have a polygon layer with a "providerName" field. This layer will be used as an overlay on top of other layers. I need to get the features returned byt the spatial query, get all the provider names for the current bbox by using the features collection, add a point to the layer (ex: bottom center) with the names of the providers as a label. This has to be done on each pan and zoom. I think it's quite simple so how would I get the list of features returned by the spatial query ? How do I add the point and the label ? I'm thinking to use python. Where do I put the code ? How do I link it to the mapfile ? I'll continue reading in the meantime. Thanks Envoy? ? partir d?Outlook -------------- next part -------------- An HTML attachment was scrubbed... URL: