Re: [mapserver-users] copyright, logos, etc
On Wed, Feb 11, 2015 at 03:25:15PM +, Eichner, Andreas - SID wrote: It's a little ugly but it works with: https://gist.github.com/silenius/f0b0fb856b82a7c70eaa Being on PostGIS I'd suggest using the native driver with something like that: CONNECTIONTYPE postgis DATA geom FROM (select id, name, now() as generated_date, st_GeomFromText('POINT(-5 70)') AS geom FROM map WHERE id=%MYID%) AS tmp USING SRID=-1 USING UNIQUE id CLASS LABEL TEXT Species name: [name] (last updated: [generated_date]) FONT vera TYPE TRUETYPE SIZE 7 BUFFER 1 COLOR 0 0 0 FORCE TRUE STYLE GEOMTRANSFORM 'labelpoly' COLOR 255 255 255 END END END that works even better .. thanks! -- Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. pgpBULtS7KA_P.pgp Description: PGP signature ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] copyright, logos, etc
On Wed, Feb 11, 2015 at 02:55:37PM +, Eichner, Andreas - SID wrote: Thanks, I'll try it that way. Another idea I had was to create a POINT layer with a FEATURE POINTS x y END END and use that layer in my SLD stylesheet (which is generated dynamically) with a TextSymbolizerLabelsometextblabla/Label ... /TextSymbolizer like on https://gist.github.com/silenius/1f4a020f35a4113cdd4d but it seems that it's unsupported by Mapserver (if I understand well https://github.com/mapserver/mapserver/blob/master/mapogcsld.c#L2706 ) You're right. That's unsupported. But to me it looks as you could cheat by using an empty PropertyName/: TextSymbolizerLabelThis static text will be displayedPropertyName//Label/TextSymbolizer more or less, it seems that there are some serious issues with the XML parser: The following doesn't work: se:Labelogc:PropertyName /foo/se:Label The following returns a strange msFontsetLookupFonts(): TrueType Font error. Requested font (^A) not found.: se:Label ogc:PropertyName /foo /se:Label With: se:Label ogc:PropertyName / foo /se:Label it works more or less, it display (foo ) etc Would it be possible in the future to add support for a CDATA-like section that goes directly within the FEATURE - TEXT part of the layer? I guess a basic implementation wouldn't be too hard to implement. But many elements of symbology encoding map to se:ParameterValueType which is a mixture of text nodes and ogc:expressions and this is generally not very well supported. I'd guess this needs huge reworking on both parser and engine... So, to get at least the simple cases supported you might want to file a ticket. I'll do that ..! Thanks, Julien -- Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. pgpEom52otH47.pgp Description: PGP signature ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] copyright, logos, etc
On Wed, Feb 11, 2015 at 01:32:54PM +, Eichner, Andreas - SID wrote: what I really need to do is to make an SQL query (something like select name from map where id=%MYID%) and use that attribute in the TEXT part of the FEATURE section (something like FEATURE POINTS x y END TEXT Species name: [name] END) Any idea is welcome on how to do that in the Mapserver way .. I have not test it but I would suggest replacing the inlined feature with a OGR point layer connected to a MYSQL view or a OGR VRT datasource that associates every line with the position of the annotation. 1) MYSQL view: CREATE OR REPLACE VIEW species_annotation AS SELECT id, GeomFromText('POINT(60 -10)') AS Shape, name FROM map; LAYER ... # FEATURE #POINTS # 60 -10# the offset (from lower left) in pixels #END # Points #TEXT © xyz company 2006 # this is your displaying text # END # Feature CONNECTIONTYPE ogr CONNECTION 'MYSQL: ...' DATA 'species_annotation' LABELITEM 'name' FILTER ([id]=%MYID%) ... END # Layer 2) OGR VRT datasource: In species_annotation.vrt: OGRVRTDataSource OGRVRTLayer name=species_annotation SrcDataSourceMYSQL: .../SrcDataSource SrcSQLSELECT id, 60 as x, -10 as y, name FROM map/SrcSQL FIDid/FID GeometryTypewkbPoint/GeometryType LayerSRSNULL/LayerSRS GeometryField encoding=PointFromColumns x=x y=y reportSrcColumn=false / /OGRVRTLayer /OGRVRTDataSource Test with: ogrinfo -al species_annotation.vrt -fid existing id LAYER ... CONNECTIONTYPE ogr CONNECTION 'species_annotation.vrt' DATA 'species_annotation' LABELITEM 'name' FILTER ([id] = %MYID%) ... END # Layer HTH Thanks, I'll try it that way. Another idea I had was to create a POINT layer with a FEATURE POINTS x y END END and use that layer in my SLD stylesheet (which is generated dynamically) with a TextSymbolizerLabelsometextblabla/Label ... /TextSymbolizer like on https://gist.github.com/silenius/1f4a020f35a4113cdd4d but it seems that it's unsupported by Mapserver (if I understand well https://github.com/mapserver/mapserver/blob/master/mapogcsld.c#L2706 ) Would it be possible in the future to add support for a CDATA-like section that goes directly within the FEATURE - TEXT part of the layer? Thanks! Julien -- Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. pgpt2qhsgcGDB.pgp Description: PGP signature ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] copyright, logos, etc
On Wed, Feb 11, 2015 at 01:32:54PM +, Eichner, Andreas - SID wrote: what I really need to do is to make an SQL query (something like select name from map where id=%MYID%) and use that attribute in the TEXT part of the FEATURE section (something like FEATURE POINTS x y END TEXT Species name: [name] END) Any idea is welcome on how to do that in the Mapserver way .. I have not test it but I would suggest replacing the inlined feature with a OGR point layer connected to a MYSQL view or a OGR VRT datasource that associates every line with the position of the annotation. 1) MYSQL view: CREATE OR REPLACE VIEW species_annotation AS SELECT id, GeomFromText('POINT(60 -10)') AS Shape, name FROM map; LAYER ... # FEATURE #POINTS # 60 -10# the offset (from lower left) in pixels #END # Points #TEXT © xyz company 2006 # this is your displaying text # END # Feature CONNECTIONTYPE ogr CONNECTION 'MYSQL: ...' DATA 'species_annotation' LABELITEM 'name' FILTER ([id]=%MYID%) ... END # Layer 2) OGR VRT datasource: In species_annotation.vrt: OGRVRTDataSource OGRVRTLayer name=species_annotation SrcDataSourceMYSQL: .../SrcDataSource SrcSQLSELECT id, 60 as x, -10 as y, name FROM map/SrcSQL FIDid/FID GeometryTypewkbPoint/GeometryType LayerSRSNULL/LayerSRS GeometryField encoding=PointFromColumns x=x y=y reportSrcColumn=false / /OGRVRTLayer /OGRVRTDataSource Test with: ogrinfo -al species_annotation.vrt -fid existing id LAYER ... CONNECTIONTYPE ogr CONNECTION 'species_annotation.vrt' DATA 'species_annotation' LABELITEM 'name' FILTER ([id] = %MYID%) ... END # Layer HTH It's a little ugly but it works with: https://gist.github.com/silenius/f0b0fb856b82a7c70eaa Thank you very much! -- Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. pgpfsxJwn9mOX.pgp Description: PGP signature ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] copyright, logos, etc
On Thu, Feb 05, 2015 at 02:41:40PM +0100, Julien Cigar wrote: Hello, I'm using Mapserver to generate maps for various PostGIS layers and it works pretty well, especially with SLD to filter WMS requests. Now the users want to include: - a logo (PNG file) in the upper right corner - a copyright text at the bottom center of the page - a text generated at ... with the date For now I have the following MAP file: https://gist.github.com/silenius/545d479132981dc5a55a (only relevant parts are shown) For the logo and the copyright text it works more or less (although it seems über complicated for such simple thing, but maybe there is a simpler way of doing it ?), the only problem I have is that if I change the WIDTH and HEIGHT of the map the things disappear, as the POINTS in the FEATURE section don't fit the map size. I wonder if there is a simple way to tell Mapserver to just put that 20px .PNG file in the upper right corner of the generated map or something like that .. ? Any idea how could I do for the generated date ? Thanks ! Julien Hello, After digging hours in the documentation I ended by modifying the generated image file with PIL ... It's not the ideal solution but I don't see an easy way in Mapserver to simply add some text to a generated image. I used http://www.mapserver.org/faq.html#how-do-i-add-a-copyright-notice-on-the-corner-of-my-map for the static ones (which works) but what I really need to do is to make an SQL query (something like select name from map where id=%MYID%) and use that attribute in the TEXT part of the FEATURE section (something like FEATURE POINTS x y END TEXT Species name: [name] END) Any idea is welcome on how to do that in the Mapserver way .. Julien -- Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. pgp7SXuiBTSL9.pgp Description: PGP signature ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Label in SLD
Hello, With the following https://gist.github.com/silenius/1f4a020f35a4113cdd4d is it normal that the Label (line 29-31) within my TextSymbolizer is not rendered (the PointSymbolizer is) ? Thanks, Julien -- Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. pgpyPok02B2gn.pgp Description: PGP signature ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] copyright, logos, etc
Hello, I'm using Mapserver to generate maps for various PostGIS layers and it works pretty well, especially with SLD to filter WMS requests. Now the users want to include: - a logo (PNG file) in the upper right corner - a copyright text at the bottom center of the page - a text generated at ... with the date For now I have the following MAP file: https://gist.github.com/silenius/545d479132981dc5a55a (only relevant parts are shown) For the logo and the copyright text it works more or less (although it seems über complicated for such simple thing, but maybe there is a simpler way of doing it ?), the only problem I have is that if I change the WIDTH and HEIGHT of the map the things disappear, as the POINTS in the FEATURE section don't fit the map size. I wonder if there is a simple way to tell Mapserver to just put that 20px .PNG file in the upper right corner of the generated map or something like that .. ? Any idea how could I do for the generated date ? Thanks ! Julien -- Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. pgpe6V9uxSIk_.pgp Description: PGP signature ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMS layer filtering
On 06/12/2013 14:23, Kralidis,Tom [Ontario] wrote: Hi: we have a MapServer OWS instance which we use to disseminate observations via WMS and WFS/SOS. One of our layers has 1 million records (PostGIS backend). The layer has CLASS level EXPRESSION objects for WMS visualization/classification. We initially implemented a LAYER level FILTER, however we have use cases to serve the same layer (with the same identifier) via WFS, in which case we'd like all the data to be available. Our problem happens when visualizing via WMS. We have a Boolean column in our PostGIS table ('latest_observation') which allows us to filter easily to visualize latest observations, which is our desired WMS default. Because we have defined CLASS level filters, the WMS GetMap request is first querying and fetching all records and _then_ applying CLASS level filters (which all include 'latest_observation=1'. So this ends up hurting us performance wise. We'd like to have this filter at the query level so that less members are passed back from the SQL query. When we do a LAYER.FILTER with latest_observation=1, the result is instant (beautiful!). But if we put a LAYER.FILTER, this constrains the data access from the WFS perspective against the same LAYER def. Is there any way to apply a LAYER.FILTER type approach to work _just_ in WMS mode? We'd like all the data in WFS mode. I know we can duplicate the LAYER object as a workaround, but from a data management perspective we'd rather now. I hope I have explained this clearly enough. Any suggestions? It may seems strange (?), but there is nothing in the WMS spec to filter a WMS layer (that's why Geoserver has CQL filters), and I think the OGC way to filter a WMS request is through an SLD stylesheet (which can be generated dynamically). Thanks ..Tom ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] OGC spatial filter + SLD
On 11/24/2012 14:23, Julien Cigar wrote: On 11/23/2012 19:12, Thomas Gratier wrote: Hello, Hello, Don't know exactly your case but you can maybe rely on runtime substitution http://mapserver.org/cgi/runsub.html and spatial abilities of your database e.g http://postgis.refractions.net/docs/ST_Within.html or on filter (support within http://mapserver.org/mapfile/expressions.html#spatial-expressions-that-return-a-logical-value-geos ) + runtime substitution In all case, a bit dirty compare to SLD filter but no choice it seems. I'm slowly progressing on this issue: - I can confirm that Mapserver supports OGC spatial filters to filter WMS requests (so far I've tested with ogc:BBOX and ogc:Within. The filter is converted to an EXPRESSION clause in the Mapfile by Mapserver for example: EXPRESSION ([shape] within fromText('POLYGON ((24.2073126960992191 0.7680569582964826, 24.2968673039010241 0.7680569582964826, 24.2968673039010241 0.8576025453261950, 24.2073126960992191 0.8576025453261950, 24.2073126960992191 0.7680569582964826))')) - it seems that there is an obscure bug in the parsing code for the gml:coordinates tag: The following works: ogc:BBOX ogc:PropertyNamegeom/ogc:PropertyName gml:Box srsName=http://www.opengis.net/gml/srs/epsg.xml#4326; gml:coordinates decimal=. cs=, ts= 24.207313,0.768057 24.296867,0.857603/gml:coordinates /gml:Box /ogc:BBOX BUT, if there is a space (or a newline) in the gml:coordinates decimal=. cs=, ts= content it doesn't work, so the followings don't work: gml:coordinates decimal=. cs=, ts= 24.207313,0.768057 24.296867,0.857603 /gml:coordinates gml:coordinates decimal=. cs=, ts= 24.207313,0.768057 24.296867,0.857603 /gml:coordinates (...) HOWEVER, this problem doesn't appear in an ogc:Within, in any case the gml:coordinates is parsed correctly: So the following works: ogc:Within ogc:PropertyNamegeom/ogc:PropertyName gml:Polygon srsName=http://www.opengis.net/gml/srs/epsg.xml#4326; gml:outerBoundaryIs gml:LinearRing gml:coordinates decimal=. cs=, ts= 24.20731269609922 0.7680569582964826,24.296867303901024 0.7680569582964826,24.296867303901024 0.857602545326195,24.20731269609922 0.857602545326195,24.20731269609922 0.7680569582964826 /gml:coordinates /gml:LinearRing /gml:outerBoundaryIs /gml:Polygon /ogc:Within For readability I've pasted the code on http://pastie.org/5427465 Could someone confirm this is a bug .. ? Another problem now: it seems impossible to combine a spatial filter with a non-spatial filter (filters are simply ignored) Any idea ..? My SLD file is here: http://pastie.org/5437516 and I've tried with GML2 and GML3 Julien Regards ThomasG Regards, Julien ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] OGC spatial filter + SLD
On 11/23/2012 19:12, Thomas Gratier wrote: Hello, Hello, Don't know exactly your case but you can maybe rely on runtime substitution http://mapserver.org/cgi/runsub.html and spatial abilities of your database e.g http://postgis.refractions.net/docs/ST_Within.html or on filter (support within http://mapserver.org/mapfile/expressions.html#spatial-expressions-that-return-a-logical-value-geos ) + runtime substitution In all case, a bit dirty compare to SLD filter but no choice it seems. I'm slowly progressing on this issue: - I can confirm that Mapserver supports OGC spatial filters to filter WMS requests (so far I've tested with ogc:BBOX and ogc:Within. The filter is converted to an EXPRESSION clause in the Mapfile by Mapserver for example: EXPRESSION ([shape] within fromText('POLYGON ((24.2073126960992191 0.7680569582964826, 24.2968673039010241 0.7680569582964826, 24.2968673039010241 0.8576025453261950, 24.2073126960992191 0.8576025453261950, 24.2073126960992191 0.7680569582964826))')) - it seems that there is an obscure bug in the parsing code for the gml:coordinates tag: The following works: ogc:BBOX ogc:PropertyNamegeom/ogc:PropertyName gml:Box srsName=http://www.opengis.net/gml/srs/epsg.xml#4326; gml:coordinates decimal=. cs=, ts= 24.207313,0.768057 24.296867,0.857603/gml:coordinates /gml:Box /ogc:BBOX BUT, if there is a space (or a newline) in the gml:coordinates decimal=. cs=, ts= content it doesn't work, so the followings don't work: gml:coordinates decimal=. cs=, ts= 24.207313,0.768057 24.296867,0.857603 /gml:coordinates gml:coordinates decimal=. cs=, ts= 24.207313,0.768057 24.296867,0.857603 /gml:coordinates (...) HOWEVER, this problem doesn't appear in an ogc:Within, in any case the gml:coordinates is parsed correctly: So the following works: ogc:Within ogc:PropertyNamegeom/ogc:PropertyName gml:Polygon srsName=http://www.opengis.net/gml/srs/epsg.xml#4326; gml:outerBoundaryIs gml:LinearRing gml:coordinates decimal=. cs=, ts= 24.20731269609922 0.7680569582964826,24.296867303901024 0.7680569582964826,24.296867303901024 0.857602545326195,24.20731269609922 0.857602545326195,24.20731269609922 0.7680569582964826 /gml:coordinates /gml:LinearRing /gml:outerBoundaryIs /gml:Polygon /ogc:Within For readability I've pasted the code on http://pastie.org/5427465 Could someone confirm this is a bug .. ? Regards ThomasG Regards, Julien ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] OGC spatial filter + SLD
On 11/23/2012 17:11, Thomas Gratier wrote: Hello, Hello, I haven' try but it's not available refering to the doc http://mapserver.org/ogc/sld.html#issues-found-during-implementation e.g Limitation of the FilterEncoding to comparison and logical filters. The spatial filters were not made available since it required major changes in MapServer WMS support. within is a spatial filter so no luck it seems. Looks like I missed this part in the documentation .. and it's really a bad news that Mapserver doesn't support spatial WMS filtering through OGC filters. What would be the alternative way of doing it? My layer definition looks like: http://pastie.org/5424011 One solution would be to use Mapscript, rewrite the SQL query and use the ST_Within() function.. but I would like to avoid that. Regards ThomasG Thank you, Julien ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver + apache2 + python mapscript configuration
http://mapserver.org/mapscript/index.html ..? the Python API is just a SWIG wrapper On 09/26/2012 11:37, Constantin Malii wrote: Hi, everybody I need some help with configuration of mapserver with apache and python mapscript. I compiled mapserver with required libs (zlib, libgd, libjpeg, gdal(with python)). I followed some instructions from Begining Mapserver book and mapserver.org http://mapserver.org site. Now i want to install python mapscript and set up mapserver with apache2. Planing to create a django application and use python mapscript to interact with mapserver. The problem is that i dont find any explicite guide or tutorial how to do it right, this include setting working directory for mapserver and apache, setting permissions. Could anyone help me please. Thank's. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver + apache2 + python mapscript configuration
if it can help, I copy/paste code from a *very* old project (the only one I've used mapscript) .. if it can help: http://pastie.org/private/kjenmk0ewq42w1k71wbfxg On 09/26/2012 11:54, Julien Cigar wrote: http://mapserver.org/mapscript/index.html ..? the Python API is just a SWIG wrapper On 09/26/2012 11:37, Constantin Malii wrote: Hi, everybody I need some help with configuration of mapserver with apache and python mapscript. I compiled mapserver with required libs (zlib, libgd, libjpeg, gdal(with python)). I followed some instructions from Begining Mapserver book and mapserver.org http://mapserver.org site. Now i want to install python mapscript and set up mapserver with apache2. Planing to create a django application and use python mapscript to interact with mapserver. The problem is that i dont find any explicite guide or tutorial how to do it right, this include setting working directory for mapserver and apache, setting permissions. Could anyone help me please. Thank's. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMS works, WFS doesn't
On 09/26/2012 14:17, basvmrs wrote: Hi, I followed the instructions on http://mapserver.org/ogc/wfs_server.html to set up a WFS server with the shown example file. I find that WMS works fine, but WFS doesn't, even though I am basically using the same configuration. The WMS server: http://wms.cipix4.cipix.nl/?MAP=%2Fhome%2Figis%2Fwww%2Fdata%2Fwms%2Ftutorial%2Fhtdocs%2Fex.mapservice=wmsrequest=GetMapbbox=-180.00,-90.00,180.00,83.627419layers=continentsversion=1.0.0srs=epsg:4326format=jpegwidth=500height=500 GetFeatureInfo also works: http://wms.cipix4.cipix.nl/?MAP=%2Fhome%2Figis%2Fwww%2Fdata%2Fwms%2Ftutorial%2Fhtdocs%2Fex.mapservice=wmsversion=1.3.0request=GetFeatureInfobbox=-180.00,-90.00,180.00,83.627419layers=continentsversion=1.0.0srs=epsg:4326format=jpegwidth=500height=500query_layers=continentsinfo_formate=xmlX=106Y=80 But now for WFS: http://wms.cipix4.cipix.nl/?MAP=%2Fhome%2Figis%2Fwww%2Fdata%2Fwms%2Ftutorial%2Fhtdocs%2Fex.mapservice=wfsrequest=GetFeatureTYPENAME=continentsversion=1.0.0 It says: msWFSGetFeature(): WFS server error. TYPENAME 'continents' doesn't exist in this server. Please check the capabilities and reformulate your request. I don't get it: the typename should be the same as the layer name and that works fine in the WMS request. /var/log/mapserver reveals nothing interesting at all. My mapfile is: your mapfile is missing .. ? are you sure that your layer METADATA section contains wfs_enable_request * (or ows_enable_request *) ? * * After a couple of hours of searching I though I should just ask someone. Thanks! -- View this message in context: http://osgeo-org.1560.n6.nabble.com/WMS-works-WFS-doesn-t-tp5004603.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] some questions regarding getFeatureInfo, SLD, PostGIS
Hello, I'm using Mapserver 6.0.1 with the following PostGIS layer: http://pastie.org/private/84042k84vmljbontls5xvq The user has the possibility to select quite a lot of filters, which implies that the SQL query should, in theory ,be generated dynamically. As this is not possible with Mapserver (run-time substitution with HTTP parameters and VALIDATION ... END isn't powerful enough is my case), I'm dynamically generating an SLD (http://pastie.org/private/p66ml3uvqwcnphuuvera) to filter items and it works very well. Some questions: - Why does Mapserver doesn't have a very lightweight template language (or something similar) to dynamically build a string following given parameters? It could be really useful to avoid unnecessary JOIN, etc. For example something like: http://pastie.org/private/bojm3pi1dwrv18m2tvq (this is just an example, but the idea is there) - I noticed in the PostgreSQL logs that sometimes Mapserver adds an additional condition to the WHERE clause when SLD is used. For example with the following ogc:Filter in my SLD: # ogc:Filter ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo /ogc:Filter # Mapserver adds an additional and (( (basis_of_record_id= 1) )): (...) AS q where geom GeomFromText('POLYGON((-3.6860351557368 -9.81732918571448,-3.6860351557368 9.81732918571447,47.6860351496117 9.81732918571447,47.6860351496117 -9.81732918571448,-3.6860351557368 -9.81732918571448))',4326) and (( (basis_of_record_id= 1) )) which is not bad as less rows have to be post-processed by the SLD engine. However, as soon as I add an additional ogc:or (or ogc:and) as: # ogc:or ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal2/ogc:Literal /ogc:PropertyIsEqualTo /ogc:or # Mapserver doesn't add this additional AND/OR clause (and (( (basis_of_record_id= 1) OR (basis_of_record_id = 2) )) in this case).. Why ? - Is it normal that my SLD is totally ignored when I'm using REQUEST=GetFeatureInfo? Is the SLD only processed with REQUEST=GetMap? If this is the case, what's the typical alternative way of doing it? Should I go through WFS .. ? In advance, thank you for your answers :) Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] some questions regarding getFeatureInfo, SLD, PostGIS
On 09/21/2012 13:30, Rahkonen Jukka wrote: And perhaps, if you would like to do something very tricky, you could create a function or stored procedure into your database and call that from DATA with the dynamic variables? The compute_style thing in this thread suggests that it might work http://www.mail-archive.com/mapserver-users@lists.osgeo.org/msg08537.html The SQL and/or PL/pgSQL ways are indeed a good idea..(provided that the PostgreSQL planner generates equal plans) Thank you!, Julien -Jukka Rahkonen- Smith, Michael wrote: At the SQL level, you can do some fancy work with CASE and setting some default values The CASE function allows you to set all kind of logical comparisons. You can do conditional joins that way, setting the join condition to a non matching value when you don't want the join, etc. SQL is more powerful than any template language. Mike On 9/21/12 7:07 AM, Julien Cigarjci...@ulb.ac.be wrote: On 09/21/2012 12:50, Rahkonen Jukka wrote: Hi, Hello, So you have tried to define variables %SEX% and %BOD_ID%, used them inside your DATA and then fired WMS GetMaps by addingSEX=your_valueBOD_ID=your_id? Does in not work or why it is not powerful enough? It is not powerful enough because it doesn't allow you to make simple logical tests (if defined/equals/...), the run-time substitution is a simple replace %FOO% by the value of FOO= from the query string. It doesn't allow you to do something like: if FOO is defined or equal to xxx, then add JOIN foo f ON f.id = bar.foo_id, select additional columns, and add a WHERE foo.id = ... at a certain place in the DATA string. I guess mapscript should be used in this case, but it would be really interesting to have this simple template language (or another solution) without having to involve mapscript. Julien -Jukka Rahkonen- Julien Cigar wrote: Hello, I'm using Mapserver 6.0.1 with the following PostGIS layer: http://pastie.org/private/84042k84vmljbontls5xvq The user has the possibility to select quite a lot of filters, which implies that the SQL query should, in theory ,be generated dynamically. As this is not possible with Mapserver (run-time substitution with HTTP parameters and VALIDATION ... END isn't powerful enough is my case), I'm dynamically generating an SLD (http://pastie.org/private/p66ml3uvqwcnphuuvera) to filter items and it works very well. Some questions: - Why does Mapserver doesn't have a very lightweight template language (or something similar) to dynamically build a string following given parameters? It could be really useful to avoid unnecessary JOIN, etc. For example something like: http://pastie.org/private/bojm3pi1dwrv18m2tvq (this is just an example, but the idea is there) - I noticed in the PostgreSQL logs that sometimes Mapserver adds an additional condition to the WHERE clause when SLD is used. For example with the followingogc:Filter in my SLD: # ogc:Filter ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo /ogc:Filter # Mapserver adds an additional and (( (basis_of_record_id= 1) )): (...) AS q where geom GeomFromText('POLYGON((-3.6860351557368 -9.81732918571448,-3.6860351557368 9.81732918571447,47.6860351496117 9.81732918571447,47.6860351496117 -9.81732918571448,- 3.6860351557368 -9.81732918571448))',4326) and (( (basis_of_record_id= 1) )) which is not bad as less rows have to be post-processed by the SLD engine. However, as soon as I add an additionalogc:or (orogc:and) as: # ogc:or ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal2/ogc:Literal /ogc:PropertyIsEqualTo /ogc:or # Mapserver doesn't add this additional AND/OR clause (and (( (basis_of_record_id= 1) OR (basis_of_record_id = 2) )) in this case).. Why ? - Is it normal that my SLD is totally ignored when I'm using REQUEST=GetFeatureInfo? Is the SLD only processed with REQUEST=GetMap? If this is the case, what's the typical alternative way of doing it? Should I go through WFS .. ? In advance, thank you for your answers :) Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] some questions regarding getFeatureInfo, SLD, PostGIS
On 09/21/2012 13:24, Smith, Michael ERDC-RDE-CRREL-NH wrote: At the SQL level, you can do some fancy work with CASE and setting some default values The CASE function allows you to set all kind of logical comparisons. You can do conditional joins that way, setting the join condition to a non matching value when you don't want the join, etc. SQL is more powerful than any template language. You'll have to explain me how you add a JOIN clause through a CASE statement ..? :) Mike On 9/21/12 7:07 AM, Julien Cigarjci...@ulb.ac.be wrote: On 09/21/2012 12:50, Rahkonen Jukka wrote: Hi, Hello, So you have tried to define variables %SEX% and %BOD_ID%, used them inside your DATA and then fired WMS GetMaps by addingSEX=your_valueBOD_ID=your_id? Does in not work or why it is not powerful enough? It is not powerful enough because it doesn't allow you to make simple logical tests (if defined/equals/...), the run-time substitution is a simple replace %FOO% by the value of FOO= from the query string. It doesn't allow you to do something like: if FOO is defined or equal to xxx, then add JOIN foo f ON f.id = bar.foo_id, select additional columns, and add a WHERE foo.id = ... at a certain place in the DATA string. I guess mapscript should be used in this case, but it would be really interesting to have this simple template language (or another solution) without having to involve mapscript. Julien -Jukka Rahkonen- Julien Cigar wrote: Hello, I'm using Mapserver 6.0.1 with the following PostGIS layer: http://pastie.org/private/84042k84vmljbontls5xvq The user has the possibility to select quite a lot of filters, which implies that the SQL query should, in theory ,be generated dynamically. As this is not possible with Mapserver (run-time substitution with HTTP parameters and VALIDATION ... END isn't powerful enough is my case), I'm dynamically generating an SLD (http://pastie.org/private/p66ml3uvqwcnphuuvera) to filter items and it works very well. Some questions: - Why does Mapserver doesn't have a very lightweight template language (or something similar) to dynamically build a string following given parameters? It could be really useful to avoid unnecessary JOIN, etc. For example something like: http://pastie.org/private/bojm3pi1dwrv18m2tvq (this is just an example, but the idea is there) - I noticed in the PostgreSQL logs that sometimes Mapserver adds an additional condition to the WHERE clause when SLD is used. For example with the followingogc:Filter in my SLD: # ogc:Filter ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo /ogc:Filter # Mapserver adds an additional and (( (basis_of_record_id= 1) )): (...) AS q where geom GeomFromText('POLYGON((-3.6860351557368 -9.81732918571448,-3.6860351557368 9.81732918571447,47.6860351496117 9.81732918571447,47.6860351496117 -9.81732918571448,-3.6860351557368 -9.81732918571448))',4326) and (( (basis_of_record_id= 1) )) which is not bad as less rows have to be post-processed by the SLD engine. However, as soon as I add an additionalogc:or (orogc:and) as: # ogc:or ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal2/ogc:Literal /ogc:PropertyIsEqualTo /ogc:or # Mapserver doesn't add this additional AND/OR clause (and (( (basis_of_record_id= 1) OR (basis_of_record_id = 2) )) in this case).. Why ? - Is it normal that my SLD is totally ignored when I'm using REQUEST=GetFeatureInfo? Is the SLD only processed with REQUEST=GetMap? If this is the case, what's the typical alternative way of doing it? Should I go through WFS .. ? In advance, thank you for your answers :) Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] some questions regarding getFeatureInfo, SLD, PostGIS
On 09/21/2012 13:24, Smith, Michael ERDC-RDE-CRREL-NH wrote: At the SQL level, you can do some fancy work with CASE and setting some default values The CASE function allows you to set all kind of logical comparisons. You can do conditional joins that way, setting the join condition to a non matching value when you don't want the join, etc. SQL is more powerful than any template language. Mike ok I was wrong, you meant JOIN foo ON (CASE ... ) I guess .. ? On 9/21/12 7:07 AM, Julien Cigarjci...@ulb.ac.be wrote: On 09/21/2012 12:50, Rahkonen Jukka wrote: Hi, Hello, So you have tried to define variables %SEX% and %BOD_ID%, used them inside your DATA and then fired WMS GetMaps by addingSEX=your_valueBOD_ID=your_id? Does in not work or why it is not powerful enough? It is not powerful enough because it doesn't allow you to make simple logical tests (if defined/equals/...), the run-time substitution is a simple replace %FOO% by the value of FOO= from the query string. It doesn't allow you to do something like: if FOO is defined or equal to xxx, then add JOIN foo f ON f.id = bar.foo_id, select additional columns, and add a WHERE foo.id = ... at a certain place in the DATA string. I guess mapscript should be used in this case, but it would be really interesting to have this simple template language (or another solution) without having to involve mapscript. Julien -Jukka Rahkonen- Julien Cigar wrote: Hello, I'm using Mapserver 6.0.1 with the following PostGIS layer: http://pastie.org/private/84042k84vmljbontls5xvq The user has the possibility to select quite a lot of filters, which implies that the SQL query should, in theory ,be generated dynamically. As this is not possible with Mapserver (run-time substitution with HTTP parameters and VALIDATION ... END isn't powerful enough is my case), I'm dynamically generating an SLD (http://pastie.org/private/p66ml3uvqwcnphuuvera) to filter items and it works very well. Some questions: - Why does Mapserver doesn't have a very lightweight template language (or something similar) to dynamically build a string following given parameters? It could be really useful to avoid unnecessary JOIN, etc. For example something like: http://pastie.org/private/bojm3pi1dwrv18m2tvq (this is just an example, but the idea is there) - I noticed in the PostgreSQL logs that sometimes Mapserver adds an additional condition to the WHERE clause when SLD is used. For example with the followingogc:Filter in my SLD: # ogc:Filter ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo /ogc:Filter # Mapserver adds an additional and (( (basis_of_record_id= 1) )): (...) AS q where geom GeomFromText('POLYGON((-3.6860351557368 -9.81732918571448,-3.6860351557368 9.81732918571447,47.6860351496117 9.81732918571447,47.6860351496117 -9.81732918571448,-3.6860351557368 -9.81732918571448))',4326) and (( (basis_of_record_id= 1) )) which is not bad as less rows have to be post-processed by the SLD engine. However, as soon as I add an additionalogc:or (orogc:and) as: # ogc:or ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal2/ogc:Literal /ogc:PropertyIsEqualTo /ogc:or # Mapserver doesn't add this additional AND/OR clause (and (( (basis_of_record_id= 1) OR (basis_of_record_id = 2) )) in this case).. Why ? - Is it normal that my SLD is totally ignored when I'm using REQUEST=GetFeatureInfo? Is the SLD only processed with REQUEST=GetMap? If this is the case, what's the typical alternative way of doing it? Should I go through WFS .. ? In advance, thank you for your answers :) Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] some questions regarding getFeatureInfo, SLD, PostGIS
On 09/21/2012 14:22, Smith, Michael ERDC-RDE-CRREL-NH wrote: What I've done is have the join in the sql but either join it to the correct join column or join it to a null match (and make it an outer join). I typically use oracle syntax and not ansi syntax but the trick is to have all the table joins in the sql but using case to alter the join condition. I see.. the only problem I see with this solution is that you cannot do inner join (as the resultset will always be empty if one of the join condition is false). Just curious: is the Oracle planner smart enough to not JOIN the table if the join condition is false ? With PostgreSQL it seems not the case..: congo_river=# explain analyze select occ.id as occ_id, si.id as site_id FROM occurrences occ LEFT JOIN sites si ON 1=2; QUERY PLAN --- Nested Loop Left Join (cost=0.00..536.20 rows=5840 width=8) (actual time=0.015..39.875 rows=5840 loops=1) Join Filter: false - Seq Scan on occurrences occ (cost=0.00..536.20 rows=5840 width=4) (actual time=0.007..8.234 rows=5840 loops=1) - Result (cost=0.00..0.08 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=5840) One-Time Filter: false Total runtime: 47.016 ms (6 rows) congo_river=# Thanks Julien On 9/21/12 8:06 AM, Julien Cigarjci...@ulb.ac.be wrote: On 09/21/2012 13:24, Smith, Michael ERDC-RDE-CRREL-NH wrote: At the SQL level, you can do some fancy work with CASE and setting some default values The CASE function allows you to set all kind of logical comparisons. You can do conditional joins that way, setting the join condition to a non matching value when you don't want the join, etc. SQL is more powerful than any template language. You'll have to explain me how you add a JOIN clause through a CASE statement ..? :) Mike On 9/21/12 7:07 AM, Julien Cigarjci...@ulb.ac.be wrote: On 09/21/2012 12:50, Rahkonen Jukka wrote: Hi, Hello, So you have tried to define variables %SEX% and %BOD_ID%, used them inside your DATA and then fired WMS GetMaps by addingSEX=your_valueBOD_ID=your_id? Does in not work or why it is not powerful enough? It is not powerful enough because it doesn't allow you to make simple logical tests (if defined/equals/...), the run-time substitution is a simple replace %FOO% by the value of FOO= from the query string. It doesn't allow you to do something like: if FOO is defined or equal to xxx, then add JOIN foo f ON f.id = bar.foo_id, select additional columns, and add a WHERE foo.id = ... at a certain place in the DATA string. I guess mapscript should be used in this case, but it would be really interesting to have this simple template language (or another solution) without having to involve mapscript. Julien -Jukka Rahkonen- Julien Cigar wrote: Hello, I'm using Mapserver 6.0.1 with the following PostGIS layer: http://pastie.org/private/84042k84vmljbontls5xvq The user has the possibility to select quite a lot of filters, which implies that the SQL query should, in theory ,be generated dynamically. As this is not possible with Mapserver (run-time substitution with HTTP parameters and VALIDATION ... END isn't powerful enough is my case), I'm dynamically generating an SLD (http://pastie.org/private/p66ml3uvqwcnphuuvera) to filter items and it works very well. Some questions: - Why does Mapserver doesn't have a very lightweight template language (or something similar) to dynamically build a string following given parameters? It could be really useful to avoid unnecessary JOIN, etc. For example something like: http://pastie.org/private/bojm3pi1dwrv18m2tvq (this is just an example, but the idea is there) - I noticed in the PostgreSQL logs that sometimes Mapserver adds an additional condition to the WHERE clause when SLD is used. For example with the followingogc:Filterin my SLD: # ogc:Filter ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo /ogc:Filter # Mapserver adds an additional and (( (basis_of_record_id= 1) )): (...) AS q where geomGeomFromText('POLYGON((-3.6860351557368 -9.81732918571448,-3.6860351557368 9.81732918571447,47.6860351496117 9.81732918571447,47.6860351496117 -9.81732918571448,-3.6860351557368 -9.81732918571448))',4326) and (( (basis_of_record_id= 1) )) which is not bad as less rows have to be post-processed by the SLD engine. However, as soon as I add an additionalogc:or(orogc:and) as: # ogc:or ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal1/ogc:Literal /ogc:PropertyIsEqualTo ogc:PropertyIsEqualTo ogc:PropertyNamebasis_of_record_id/ogc:PropertyName ogc:Literal2/ogc:Literal /ogc:PropertyIsEqualTo
Re: [mapserver-users] SLD TextSymbolizer in 6.1-dev
Hi, I don't know for your problem but I used to use the SvgParameter .. instead of the CssParameter .. (this is in SLD 1.1.0) It works fine in 6.1 Here is one of my SLD template, if it can help ... http://www.pastie.org/4164772 Julien On 06/27/2012 15:07, jlundnielsen wrote: Hi List, In the process of preparing for 6.2 I have discovered a problem applying labels through the use of SLD TextSymbolizer in 6.1-dev. The following is applying labels fine in my current install of 6.0.1, but not in 6.1-dev: ... TextSymbolizer Label PropertyNameNAME/PropertyName /Label CssParameter name=font-familyarial/CssParameter CssParameter name=font-stylebold/CssParameter CssParameter name=font-size18/CssParameter /TextSymbolizer ... The request does not fail as such in 6.1-dev, just no labels are applied... Digging out the temporary mapfile reveals that 'TEXT ([NAME])' is put in the layer in both cases, but in 6.1-dev there is no declaration of 'LABEL' for the layer, so it is not shown. Am I doing something wrong here? Anyone having similar experiences? -- View this message in context: http://osgeo-org.1560.n6.nabble.com/SLD-TextSymbolizer-in-6-1-dev-tp4984223.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] PostGIS query
On 01/31/2012 17:05, Carlos Ruiz wrote: Julien, Hi Carlos, Have you tried with views ? When I need to map complex queries I build a view to just handle the where clauses. I usually use a view, but in this case there are a lot of tables involved and I would like to avoid dozens of unnecessary JOIN Cheers from México IC Carlos Ruiz *From:* Julien Cigar jci...@ulb.ac.be *To:* mapserver-users@lists.osgeo.org mapserver-users@lists.osgeo.org *Sent:* Tuesday, January 31, 2012 6:38 AM *Subject:* [mapserver-users] PostGIS query Hello, Is there a way to (deeply) modify the SQL query in a PostGIS layer? I would like to add some JOIN, additional WHERE clauses, etc As I'm afraid that Run-time Substitution isn't flexible enough for this case ... is there any other possibility, other than mapscript? I guess there is no possibility to define variables, conditions, etc in a .map file .. ? Thanks, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org mailto:mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] PostGIS query
Hello, Is there a way to (deeply) modify the SQL query in a PostGIS layer? I would like to add some JOIN, additional WHERE clauses, etc As I'm afraid that Run-time Substitution isn't flexible enough for this case ... is there any other possibility, other than mapscript? I guess there is no possibility to define variables, conditions, etc in a .map file .. ? Thanks, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] how to use STYLES .. ?
OK.. it looks like I cannot use STYLES= and SLD= at the same time .. Does anyone have an idea how to put a simple text constant (copyright) and a graphic image (logo) at the bottom of a map (*in SLD*)? Thanks, Julien On 09/06/2011 13:50, Julien Cigar wrote: Hello, I have the following layer http://www.pastie.org/2490986 with the following SLD http://www.pastie.org/2490993 Is it possible to mix a SLD= with a STYLES= .. ? Any idea why with the following request (STYLES=bar): http://my.server/mapserver?map=/my/mapfile.mapLAYERS=eeaTRANSPARENT=TRUEFORMAT=image/pngSLD=http://my.server/mysldSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=fooSRS=EPSG:3857BBOX=-9378667.0980278,1061783.1742937,13163529.784472,15737692.603004WIDTH=1152HEIGHT=750 Mapserver outputs: msWMSLoadGetMapParams(): WMS server error. Style (foo) not defined on layer. If I understood well STYLES should override the CLASSGROUP, so I don't understand why it doesn't work .. Thanks, Julien ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Filter Point features from PostGIS Layer
couldn't you use WHERE ST_GeometryType(col) = ST_Point ? On 09/02/2011 13:50, kaipi wrote: I have a PostGIS database with polygon, line and point features. I want to make a Mapserver layer, that only displays the point features. AFAIK without such filtering Mapserver would render in a Point-Type-Layer also the polygon features as points. How would a FILTER or EXPRESSION look like to tell Mapserver to only query for point features ? Thanks, Harry -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Filter-Point-features-from-PostGIS-Layer-tp6753585p6753585.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Filter Point features from PostGIS Layer
On 09/02/2011 14:02, Julien Cigar wrote: couldn't you use WHERE ST_GeometryType(col) = ST_Point ? also note that to avoid a seqscan you should create an appropriate index: CREATE INDEX your_index ON your_table(ST_GeometryType(geom)) WHERE ST_GeometryType(geom) = 'ST_Point'; On 09/02/2011 13:50, kaipi wrote: I have a PostGIS database with polygon, line and point features. I want to make a Mapserver layer, that only displays the point features. AFAIK without such filtering Mapserver would render in a Point-Type-Layer also the polygon features as points. How would a FILTER or EXPRESSION look like to tell Mapserver to only query for point features ? Thanks, Harry -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Filter-Point-features-from-PostGIS-Layer-tp6753585p6753585.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] SLD ignored with mode=map .. ?
On 09/01/2011 06:30, Steve Lime wrote: This would be a nice addition to standard CGI behavior wouldn't it? Could a ticket be filed and maybe this added in 6.2? +1 for this..! another thing that would be great (?) is if we could mix a SLD with a Mapfile, or a least some parts On Tue, Aug 30, 2011 at 11:08 AM, Daniel Morissette dmorisse...@mapgears.com wrote: Yes, that's the expected behavior: SLDs are supported only in WMS requests. On 11-08-29 07:39 AM, Julien Cigar wrote: Hello, everything is in the title :) : I wondered if it's normal that my SLD is ignored when mode=map (it works perfectly with WMS)? I use an URL like: http://home.bebif.be/mapserver?map=/path/to/mapfile.maplayer=metzgermode=mapSLD=http://some.host.be/nobanis/mysld.xml Thank you, Julien ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- Daniel Morissette http://www.mapgears.com/ Provider of Professional MapServer Support since 2000 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Issue with run-time substitution?
On 08/30/2011 13:43, Stephen Davies wrote: I am running mapserver 6.0.1 with map files migrated from 5.6.3. One of my map files has stopped working properly and I suspect that it may be a bug in the 6.0.1 run-time substitution code. The relevant map file layer sections look like this: LAYER CONNECTIONTYPE postgis NAME battery DATA geom from wmd using unique id using SRID=4283 CONNECTION user=scldad dbname=benparts STATUS ON TYPE POINT VALIDATION vucv '[0-9]*_[0-9]*' END FILTER (stype='B' and uc='%vucv%') PROJECTION init=epsg:4283 END MAXSCALE 500 LABELITEM label CLASSITEM state CLASS EXPRESSION G STYLE COLOR0 255 0 SYMBOL 'dot' SIZE 7 OFFSET 17 0 END LABEL POSITION CR TYPE TRUETYPE FONT arial SIZE 8 COLOR 0 255 0 OFFSET 20 0 FORCE TRUE STYLE GEOMTRANSFORM 'labelpoly' COLOR 255 255 255 END END END . . END There are twelve layers with essentially the same definition apart from the STYPE values. The invoking URL hasvucv=137_11 but the postgresql log reveals that no substitution has occurred. The final pgsql command still has '%vucv%'. I suspect that having more than one FILTER with the same substitution breaks things as all other substitutions work fine. (I also tried putting the substitution in the DATA entry but with no better result.) You should use a METADATA section, something like: METADATA vucv_validation_pattern '[0-9]*_[0-9]*' END instead of VALIDATION Cheers, Stephen -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] SLD ignored with mode=map .. ?
Hello, everything is in the title :) : I wondered if it's normal that my SLD is ignored when mode=map (it works perfectly with WMS)? I use an URL like: http://home.bebif.be/mapserver?map=/path/to/mapfile.maplayer=metzgermode=mapSLD=http://some.host.be/nobanis/mysld.xml Thank you, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] SLD and LABEL MINDISTANCE ..?
On 08/09/2011 13:23, Julien Cigar wrote: Hello, I'm using SLD with a TextSymbolizer section for labeling my polygons (this is what I have at the moment http://www.pastie.org/2344427). It works well except that I miss the MINDISTANCE of the LABEL section and wondered if there is a way to do it in the SLD ..? Does Mapserver supports some VendorOption that are undocumented? Is there a way to mix a LABEL section (in the .map file) with the SLD? Thanks, Julien apparently it's not possible to use a SLD and CLASS/LABEL definitions together, when I specify a SLD my LABEL definition in my mapfile is simply ignored.. too bad :( ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WFS Spatial Filter Problem
Perhaps the problem comes from the HTTP server (wrong (Fast)CGI config, ...) ? Take a look at your your error.log On 08/10/2011 14:35, Bryan Hempen wrote: Hi David, I enabled debugging using the following settings: CONFIG MS_ERRORFILE /home/bhempen/ms_error.txt DEBUG 5 CONFIG CPL_DEBUG ON CONFIG PROJ_DEBUG ON The only line that shows up after I got an error 500 using the spatial filter is: [Wed Aug 10 14:30:46 2011].451858 CGI Request 1 on process 21100 Not really helpful, right? Regards, Bryan On 09/08/2011 15:38, Fawcett, David (MPCA) wrote: Bryan, For testing, I would enable debugging at the MAP or LAYER level. If you set DEBUG 5, I think that you should be able to see the query that MapServer is crafting. More on debugging here: http://mapserver.org/optimization/debugging.html#debugging David. *From:*mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Bryan Hempen *Sent:* Tuesday, August 09, 2011 4:15 AM *Cc:* mapserver-users@lists.osgeo.org *Subject:* Re: [mapserver-users] WFS Spatial Filter Problem Dear Kai and Assefa, After you two guys requested me to send you my setup, I exported the content in the databasetable to a shapefile so you can test it. When I tested the spatial filter right after that, it suddenly worked ! This narrows down the possibilities: - The request I send is definitely not the problem anymore. It works with MapServer + shapefile and with GeoServer. - I exported only the geometries to the shapefile in the table with geometrytype = POLYGON because from ~8000 geometries ~10 are linestrings. So I investigated possible problems with the linestring geometries by telling the MapServer not to serve them using a subquery in the mapfile: DATA the_geom from (select * from alldata where geometrytype(the_geom) = 'POLYGON') as subquery using unique product_id using SRID=4326 Error 500 still occured. Therefore, the data can't be the problem neither, right? - Since I didn't change anything else MapServer must have problems communicating with the PostGIS database, but why Error 500 then? Here is my mapfile: MAP NAME WFS Server STATUS ON SIZE 600 400 SYMBOLSET /var/www/html/psa/bhempen/mapservertest/symbols/symbols.sym EXTENT -180 -90 180 90 UNITS DD SHAPEPATH /var/www/html/psa/bhempen/mapservertest/data/ IMAGECOLOR 255 255 255 FONTSET /var/www/html/psa/bhempen/mapservertest/fonts/fonts.list MAXSIZE 4096 # needs to be set because otherwise an error will appear when rendering images on large screens #IMAGECOLOR 200 200 200 #commented out for WFS PROJECTION 'init=epsg:4326' END WEB TEMPLATE '/var/www/html/psa/bhempen/mapservertest/template.html' IMAGEPATH '/var/www/html/psa/bhempen/tmp/' IMAGEURL '/psa/bhempen/tmp/' METADATA wfs_title WFS Demo Server for MapServer ## REQUIRED wfs_onlineresource http://localhost/cgi-bin/psa/mapserv?map=/home/bhempen/wfs.map; http://localhost/cgi-bin/psa/mapserv?map=/home/bhempen/wfs.map; ## Recommended wfs_srsEPSG:4326 ## Recommended wfs_abstract This text describes my WFS service. ## Recommended END END LAYER NAME omega STATUS DEFAULT TYPE POLYGON METADATA wfs_title omega footprints ##REQUIRED wfs_srs EPSG:4326 ## REQUIRED gml_include_items all ## Optional (serves all attributes for layer) gml_featureid product_id ## REQUIRED END PROJECTION init=epsg:4326 END CONNECTIONTYPE POSTGIS CONNECTION host=localhost port=xxx dbname=xxx user=xxx password=xxx DATA the_geom from alldata using unique product_id using SRID=4326 CLASS STYLE OUTLINECOLOR125 0 0 END END DUMP TRUE ## REQUIRED END # layer END Does anyone see a problem with the setup? Many thanks to Kai and Assefa for the help so far! I am going to send you the shapefile (which you could import into the database with pgsql2shp), the mapfile, and my client. Kind regards, Bryan This message and any attachments are intended for the use of the addressee or addressees only. The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its content is not permitted. If you received this message in error, please notify the sender and delete it from your system. Emails can be altered and their integrity cannot be guaranteed by the sender. Please consider the environment before printing this email. = This message and any
[mapserver-users] SLD and LABEL MINDISTANCE ..?
Hello, I'm using SLD with a TextSymbolizer section for labeling my polygons (this is what I have at the moment http://www.pastie.org/2344427). It works well except that I miss the MINDISTANCE of the LABEL section and wondered if there is a way to do it in the SLD ..? Does Mapserver supports some VendorOption that are undocumented? Is there a way to mix a LABEL section (in the .map file) with the SLD? Thanks, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] substitution in a PostGIS layer .. ?
Hello, I have the following mapfile: http://www.pastie.org/2206896 with the following SLD: http://www.pastie.org/2206902 (generated dynamically) I wondered how can I change the WHERE sp.id=%SPID% in the subselect (following a CGI parameter)? I read http://mapserver.org/cgi/runsub.html, and tried with %SPID% (by passwing SPID=3 in my URL) but it doesn't seems to work ... any idea? Thanks, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] substitution in a PostGIS layer .. ?
OK.. I missed the (must validate against DATAPATTERN) part. I added SPID_validation_pattern ^[0-9]+$ in my METADATA and it works ! However, it looks a little hackish to me .. I wondered if Mapserver uses PQescapeStringConn() in background? In other words: is _validation_pattern the only way to protect against SQL injection? What it I allow a pattern that may take part in a SQL injection (like ', #, ..) ? Thanks, Julien On 07/13/2011 14:29, Julien Cigar wrote: Hello, I have the following mapfile: http://www.pastie.org/2206896 with the following SLD: http://www.pastie.org/2206902 (generated dynamically) I wondered how can I change the WHERE sp.id=%SPID% in the subselect (following a CGI parameter)? I read http://mapserver.org/cgi/runsub.html, and tried with %SPID% (by passwing SPID=3 in my URL) but it doesn't seems to work ... any idea? Thanks, Julien ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] substitution in a PostGIS layer .. ?
On 07/13/2011 15:07, Daniel Morissette wrote: On 11-07-13 08:41 AM, Julien Cigar wrote: OK.. I missed the (must validate against DATAPATTERN) part. I added SPID_validation_pattern ^[0-9]+$ in my METADATA and it works ! However, it looks a little hackish to me .. I wondered if Mapserver uses PQescapeStringConn() in background? In other words: is _validation_pattern the only way to protect against SQL injection? What it I allow a pattern that may take part in a SQL injection (like ', #, ..) ? The %variable% replacement stuff does not attempt to do any kind of escaping at the moment, so yes you are on your own with your validation pattern. This may be a stupid question but: is there a reason why PQescapeStringConn() is not used to do the substitution? Thanks, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] merging shapefiles
Hello, I have an (OpenLayers) map with two layers: - Country (as a base layer) - EEA You can see the output here: http://home.bebif.be/~jcigar/map.jpg The Country layer contains just the borders of the countries, and the EEA layer (the colorized areas) contains environmental areas. What I'd like to do is to select a polygon within a country for a specific zone. For example I would like to select part of Belgium with the Atlantic EEA (in blue), which is the north of Belgium. I also need to save some information in the database for the polygon (I'm using Mapserver/PostGIS). What would be the best way to do this? Would you merge the two layers into one (be creating new polygons)? thanks, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] changing dynamically LABEL BACKGROUNDCOLOR
use SLD ? On 01/27/2011 16:42, tommaso wrote: Hallo everybody, the background color of labels cannot be changed dynamically via attribute binding or CGI parameters, is right? Is there a workaround for this? Regards, Tommaso ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Re: fedora 14 cannot find -lpgport
On 11/18/2010 10:35, Sebastian E. Ovide wrote: from http://forums.fedoraforum.org/showthread.php?p=1417824#post1417824 it looks like libpgport isn't supported by fedora... Is there any other way to build MapServer without that library ? disable Postgis support ? I don't use Fedora, but I reported a similar problem with the FreeBSD port, which looks like yours: http://www.freebsd.org/cgi/query-pr.cgi?pr=145002 On Wed, Nov 17, 2010 at 3:49 PM, Sebastian E. Ovide sebastian.ov...@gmail.com mailto:sebastian.ov...@gmail.com wrote: Hi Guys, I'm building mapserver in Fedora 14 and getting /usr/bin/ld: cannot find -lpgport collect2: ld returned 1 exit status doing yum list | grep pgport and yum provides *pgport* I cannot see any package with pgport... any ideas ? -- Sebastian E. Ovide -- Sebastian E. Ovide ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] WMS Filters ?
Hello, I wondered if I can use OGC filters with WMS ? It works well with WFS, but nothing is indicated in the documentation for WMS, and I tried to add Filter=FilterPropertyIsEqualToPropertyNameinfo/PropertyNameLiteraltest10/Literal/PropertyIsEqualTo/Filter to my WMS request but it doesn't work :( In case it isn't supported, what's the Mapserver-way to do it ? Should I use a FILTER in my LAYER section ? My final goal is to add layers dynamically in OpenLayers based on an OGC filter .. Thanks, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMS Filters ?
OK, I'll take a look at SLD :) Thank you for your quick answers! Julien On 10/01/2010 15:06, Rahkonen Jukka wrote: Hi, Filters can be buried inside SLD. See http://mapserver.org/ogc/sld.html There are also a few clickable and working examples. -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Julien Cigar Lähetetty: 1. lokakuuta 2010 16:00 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: [mapserver-users] WMS Filters ? Hello, I wondered if I can use OGC filters with WMS ? It works well with WFS, but nothing is indicated in the documentation for WMS, and I tried to add Filter=FilterPropertyIsEqualToPropertyNameinfo/Proper tyNameLiteraltest10/Literal/PropertyIsEqualTo/Filter to my WMS request but it doesn't work :( In case it isn't supported, what's the Mapserver-way to do it ? Should I use a FILTER in my LAYER section ? My final goal is to add layers dynamically in OpenLayers based on an OGC filter .. Thanks, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] reprojection
On 09/22/2010 08:36, Rahkonen Jukka wrote: Hi, For sure the original image is not in EPSG:4326. You can guess it from the coordinates, for example Origin = (-8563840.575678950175643,6466755.550653258338571) EPSG:4326 is naturally between -90,90 and -180,180. There does read AUTHORITY[EPSG,4326]] in one place of the gdalinfo report, but it is in the section that tells the datum or the projection. I am not sure what the right projection could be, but I found this projection wiht the same lookin parametrers from my Mapserver proj directory: # WGS 84 / Antarctic Polar Stereographic 3031 +proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs If this is correct, you do not need to reproject at all because your image is already in EPSG:3031. -Jukka Rahkonen- Thanks for the clarification, looks like I misunderstood the output of gdalinfo..! Julien -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Julien Cigar Lähetetty: 21. syyskuuta 2010 22:09 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: [mapserver-users] reprojection Hello, I'm trying to re-project a RASTER layer but without success so far. I have the following TIFF file: m...@mordor:/home/mage/gis % gdalinfo antarctica_sthn_ocean.tiff Driver: GTiff/GeoTIFF Files: antarctica_sthn_ocean.tiff Size is 12216, 9094 Coordinate System is: PROJCS[ Projection Name = WGS_1984_Stereographic_South_Pole Units = meters GeoTIFF Units = meters, GEOGCS[WGS 84, DATUM[WGS_1984, SPHEROID[WGS 84,6378137,298.257223563, AUTHORITY[EPSG,7030]], AUTHORITY[EPSG,6326]], PRIMEM[Greenwich,0], UNIT[degree,0.0174532925199433], AUTHORITY[EPSG,4326]], PROJECTION[Polar_Stereographic], PARAMETER[latitude_of_origin,-71], PARAMETER[central_meridian,0], PARAMETER[scale_factor,1], PARAMETER[false_easting,0], PARAMETER[false_northing,0], UNIT[metre,1, AUTHORITY[EPSG,9001]]] Origin = (-8563840.575678950175643,6466755.550653258338571) Pixel Size = (1420.390210742724321,-1420.394765779645695) Metadata: TIFFTAG_XRESOLUTION=900 TIFFTAG_YRESOLUTION=900 TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left (-8563840.576, 6466755.551) ( 52d56'33.71W, 8d 9'27.23S) Lower Left (-8563840.576,-6450314.449) (126d59'13.87W, 8d12'36.90S) Upper Right ( 8787646.239, 6466755.551) ( 53d39'3.45E, 7d12'35.07S) Lower Right ( 8787646.239,-6450314.449) (126d16'45.99E, 7d15'38.97S) Center ( 111902.832,8220.551) ( 85d47'54.65E, 88d58'2.41S) Band 1 Block=256x256 Type=Byte, ColorInterp=Red Overviews: 6108x4547, 3054x2274, 1527x1137, 764x569 Metadata: LAYER_TYPE=athematic Band 2 Block=256x256 Type=Byte, ColorInterp=Green Overviews: 6108x4547, 3054x2274, 1527x1137, 764x569 Metadata: LAYER_TYPE=athematic Band 3 Block=256x256 Type=Byte, ColorInterp=Blue Overviews: 6108x4547, 3054x2274, 1527x1137, 764x569 Metadata: LAYER_TYPE=athematic If I understood well the output of gdalinfo, the projection seems to be EPSG:4326. Now I want to re-project this to EPSG:3031. I tried with the following MAP file : MAP NAME antarctic STATUS ON SIZE 600 400 EXTENT -8563840.576 -6450314.449 8787646.239 6466755.551 IMAGECOLOR 255 255 255 PROJECTION init=epsg:3031 END OUTPUTFORMAT NAME png DRIVER GD/PNG MIMETYPE image/png IMAGEMODE RGBA EXTENSION png END LAYER NAME ocean TYPE RASTER STATUS DEFAULT DATA antarctica_sthn_ocean.tiff PROJECTION init=epsg:4326 END END END ... but all what I get is a gray 600x400 PNG image ... Any idea what could be the problem ? Thanks, Julien -- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] reprojection
Hello, I'm trying to re-project a RASTER layer but without success so far. I have the following TIFF file: m...@mordor:/home/mage/gis % gdalinfo antarctica_sthn_ocean.tiff Driver: GTiff/GeoTIFF Files: antarctica_sthn_ocean.tiff Size is 12216, 9094 Coordinate System is: PROJCS[ Projection Name = WGS_1984_Stereographic_South_Pole Units = meters GeoTIFF Units = meters, GEOGCS[WGS 84, DATUM[WGS_1984, SPHEROID[WGS 84,6378137,298.257223563, AUTHORITY[EPSG,7030]], AUTHORITY[EPSG,6326]], PRIMEM[Greenwich,0], UNIT[degree,0.0174532925199433], AUTHORITY[EPSG,4326]], PROJECTION[Polar_Stereographic], PARAMETER[latitude_of_origin,-71], PARAMETER[central_meridian,0], PARAMETER[scale_factor,1], PARAMETER[false_easting,0], PARAMETER[false_northing,0], UNIT[metre,1, AUTHORITY[EPSG,9001]]] Origin = (-8563840.575678950175643,6466755.550653258338571) Pixel Size = (1420.390210742724321,-1420.394765779645695) Metadata: TIFFTAG_XRESOLUTION=900 TIFFTAG_YRESOLUTION=900 TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left (-8563840.576, 6466755.551) ( 52d56'33.71W, 8d 9'27.23S) Lower Left (-8563840.576,-6450314.449) (126d59'13.87W, 8d12'36.90S) Upper Right ( 8787646.239, 6466755.551) ( 53d39'3.45E, 7d12'35.07S) Lower Right ( 8787646.239,-6450314.449) (126d16'45.99E, 7d15'38.97S) Center ( 111902.832,8220.551) ( 85d47'54.65E, 88d58'2.41S) Band 1 Block=256x256 Type=Byte, ColorInterp=Red Overviews: 6108x4547, 3054x2274, 1527x1137, 764x569 Metadata: LAYER_TYPE=athematic Band 2 Block=256x256 Type=Byte, ColorInterp=Green Overviews: 6108x4547, 3054x2274, 1527x1137, 764x569 Metadata: LAYER_TYPE=athematic Band 3 Block=256x256 Type=Byte, ColorInterp=Blue Overviews: 6108x4547, 3054x2274, 1527x1137, 764x569 Metadata: LAYER_TYPE=athematic If I understood well the output of gdalinfo, the projection seems to be EPSG:4326. Now I want to re-project this to EPSG:3031. I tried with the following MAP file : MAP NAME antarctic STATUS ON SIZE 600 400 EXTENT -8563840.576 -6450314.449 8787646.239 6466755.551 IMAGECOLOR 255 255 255 PROJECTION init=epsg:3031 END OUTPUTFORMAT NAME png DRIVER GD/PNG MIMETYPE image/png IMAGEMODE RGBA EXTENSION png END LAYER NAME ocean TYPE RASTER STATUS DEFAULT DATA antarctica_sthn_ocean.tiff PROJECTION init=epsg:4326 END END END ... but all what I get is a gray 600x400 PNG image ... Any idea what could be the problem ? Thanks, Julien attachment: jcigar.vcf___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users