Re: [mapserver-users] query creation issues
Hi Mark: Personally I'd steer you to the simplified query templates as described here: http://mapserver.org/development/rfc/ms-rfc-36.html This allows you to put everything in one place and better separates data from presentation. No more header/footer's. Plus you can have multiple presentations for the same layer. That said, the mapfile below doesn't have any queryable layers. There is no TEMPLATE defined for the one layer that is present. If you want to use the new style templating you'd do something like this: 1- Define an output format: OUTPUTFORMAT NAME 'my-template' DRIVER 'TEMPLATE' MIMETYPE 'text/html; subtype=compass' FORMATOPTION "FILE=templates/my-template.html" END 2- Optionally make it the default query format (otherwise you need to use qformat CGI parameter): WEB QUERYFORMAT 'my-template' ... END 3- Make layers queryable by adding something like: TEMPLATE 'void' 4- Write your template, for example my-template.html might look like: --- snip --- This is my template: [resultset layer="mjrroads"] [feature]Type: [TYPE][/feature] [/resultset] Done presenting layers. --- snip --- Steve From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees Sent: Wednesday, March 20, 2013 10:45 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] query creation issues Hello everyone, I'm trying to create a query so I can query the roads/expressways from the map. I'm pretty sure I have created the headers and footers correctly but not sure...regardless i'm not entirely too sure where to stick the particular code in my .map file (shown below). I have bolded the code that I'm trying to incorporate into the .map file but not sure why it's not working. Thanks Mark # Map file created from QGIS project file C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs # Edit this file to customize for your map interface # (Created with PyQgis MapServer Export plugin) MAP NAME "QGIS-MAP" # Map image size SIZE 500 500 UNITS meters EXTENT -240 -90 310 400 FONTSET "/wwwroot/fonts/fontset.txt" SYMBOLSET "/wwwroot/symbols/symbols.sty" PROJECTION "proj=lcc" "ellps=GRS80" "lat_0=49" "lon_0=-95" "lat_1=49" "lat_2=77" "datum=NAD83" "units=m" "no_defs" END # Background color for the map canvas -- change as desired IMAGECOLOR 0 100 250 IMAGEQUALITY 95 IMAGETYPE agg OUTPUTFORMAT NAME agg DRIVER AGG/PNG IMAGEMODE RGB END # Legend LEGEND IMAGECOLOR 255 255 255 STATUS ON KEYSIZE 18 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 END END # Web interface definition. Only the template parameter # is required to display a map. See MapServer documentation WEB # Set IMAGEPATH to the path where MapServer should # write its output. IMAGEPATH "/ms4w/tmp/ms_tmp/" # Set IMAGEURL to the url that points to IMAGEPATH # as defined in your web server configuration IMAGEURL "/ms_tmp/" # WMS server settings METADATA 'ows_title' 'QGIS-MAP' 'ows_onlineresource' 'localhost.com/cgi-bin/mapserv.exe?map=C:/wwwroot/M_Mirrlees_Assign3/global.map' 'ows_srs' 'EPSG:4326' END #Scale range at which web interface will operate # Template and header/footer settings # Only the template parameter is required to display a map. See MapServer documentation TEMPLATE 'C:/wwwroot/M_Mirrlees_Assign3/global.html' END SCALEBAR STATUS EMBED UNITS KILOMETERS INTERVALS 3 TRANSPARENT TRUE OUTLINECOLOR 0 0 0 END # End for scalebar QUERYMAP STATUS ON # sets the map to be queryable STYLE HILITE # the selected object is highligthed END # End for QueryMap WEB TEMPLATE global.html IMAGEPATH "/ms4w/tmp/ms_tmp/" IMAGEURL "/ms_tmp/" HEADER "/maps/M_Mirrlees_assign3/header.html" FOOTER "maps/M_Mirrlees_assign3/footer.html" EMPTY "/maps/M_Mirrlees_Assign3/blank.html" END #End for WEB LAYER NAME 'mjrroads' TYPE LINE DUMP false EXTENT -143.210462 39.001401 -50.461045 85.911094 DATA '../data/mjrroads.shp' METADATA 'ows_title' 'mjrroads' END STATUS default TRANSPARENCY 100 PROJECTION 'proj=longlat' 'datum=WGS84' 'no_defs' END CLASSITEM 'TYPE' CLASS NAME "default" EXPRESSION "" STYLE WIDTH 0.91 COLOR 201 157 32 END END CLASS NAME "TYPE = Expressway" EXPRESSION "Expressway" STYLE WIDTH 2.0 COLOR 255 0 0 END END CLASS NAME "TYPE = Primary Highway" EXPRESSION "Primary Highway" MAXSCALEDENOM 250 STYLE WIDTH 1.0 COLOR 0 0 0 END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query creation issues
Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks,Mark> From: steve.l...@state.mn.us > To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/expressways from the > map. I'm pretty sure I have created the headers and footers correctly but not > sure...regardless i'm not entirely too sure where to stick the particular > code in my .map file (shown below). I have bolded the code that I'm trying to > incorporate into the .map file but not sure why it's not working. Thanks Mark > > # Map file created from QGIS project file > C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs > # Edit this file to customize for your map interface > # (Created with PyQgis MapServer Export plugin) > MAP > NAME "QGIS-MAP" > # Map image size > SIZE 500 500 > UNITS meters > EXTENT -240 -90 310 400 > FONTSET "/wwwroot/fonts/fontset.txt" > SYMBOLSET "/wwwroot/symbols/symbols.sty" > PROJECTION > "proj=lcc" > "ellps=GRS80" > "lat_0=49" > "lon_0=-95" > "lat_1=49" > "lat_2=77" > "datum=NAD83" > "units=m" > "no_defs" > END > # Background color for the map canvas -- change as desired > IMAGECOLOR 0 100 250 > IMAGEQUALITY 95 > IMAGETYPE agg > OUTPUTFORMAT > NAME agg > DRIVER AGG/PNG > IMAGEMODE RGB > END > # Legend > LEGEND > IMAGECOLOR 255 255 255 > STATUS ON > KEYSIZE 18 12 > LABEL > TYPE BITMAP > SIZE MEDIUM > COLOR 0 0 89 > END > END > # Web interface definition. Only the template parameter > # is required to display a map. See MapServer documentation > WEB > # Set IMAGEPATH to the path where MapServer should > # write its output. > IMAGEPATH "/ms4w/tmp/ms_tmp/" > # Set IMAGEURL to the url that points to IMAGEPATH > # as defined in your web server configuration > IMAGEURL "/ms_tmp/" > # WMS server settings > METADATA > 'ows_title' 'QGIS-MAP' > 'ows_onlineresource' > 'localhost.com/cgi-bin/mapserv.exe?map=C:/wwwroot/M_Mirrlees_Assign3/global.map' > 'ows_srs' 'EPSG:4326' > END > #Scale range at which web interface will operate > # Template and header/footer setti
Re: [mapserver-users] query creation issues
You need to refer to the attributes next... [NAME][TYPE] Steve From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 12:16 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark > From: steve.l...@state.mn.us<mailto:steve.l...@state.mn.us> > To: mmirrl...@hotmail.com<mailto:mmirrl...@hotmail.com>; > mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: > mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org> > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/expressways from the > map. I'm pretty sure I have created the headers and footers correctly but not > sure...regardless i'm not entirely too sure where to stick the particular > code in my .map file (shown below). I have bolded the code that I'm trying to > incorporate into the .map file but not sure why it's not working. Thanks Mark > > # Map file created from QGIS project file > C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs > # Edit this file to customize for your map interface > # (Created with PyQgis MapServer Export plugin) > MAP > NAME "QGIS-MAP" > # Map image size > SIZE 500 500 > UNITS meters > EXTENT -240 -90 310 400 > FONTSET "/wwwroot/fonts/fontset.txt" > SYMBOLSET "/wwwroot/symbols/symbols.sty" > PROJECTION > "proj=lcc" > "ellps=GRS80" > "lat_0=49" > "lon_0=-95" > "lat_1=49" > "lat_2=77" > "datum=NAD83" > "units=m" > "no_defs" > END > # Background color for the map canvas -- change as desired > IMAGECOLOR 0 100 250 > IMAGEQUALITY 95 > IMAGETYPE agg > OUTPUTFORMAT > NAME agg > DRIVER AGG/PNG > IMAGEMODE RGB > END > # Legend > LEGEND > IMAGECOLOR 255 255 255 > STATUS ON > KEYSIZE 18 12 > LABEL > TYPE BITMAP > SIZE MEDIUM > COLOR 0 0 89 > END > END > # Web interface definition. Only the template parameter > # is required to display a map. See MapServer documentation > WEB > # Set IMAGEPATH to the path where MapServer should > # write its output. > IMAGEPATH "/ms4w/tmp/ms_tmp/" > # Set IMAGEURL to the url that points to IMAGEPATH > # as defined in
Re: [mapserver-users] query creation issues
Hi Steve, Unfortunately that didn't work! But I did manage to get the ID chracteristic outputted as I forgot to include that previously. As when I went to edit the query.html page it shows this ID Name Type 1275 [name] [type] Here is the code that is causing issues for me... [shpidx] [name] [type] While this is the code for the header... Layer: Major Roads ID Name Type As what i'm trying to do is get the name (name of road outputted) and the type (either expressway or major road) Thanks,MarkFrom: steve.l...@state.mn.us To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:22:29 + You need to refer to the attributes next… [NAME][TYPE] Steve From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 12:16 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark > From: steve.l...@state.mn.us > To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/expressways from the > map. I'm pretty sure I have created the headers and footers correctly but not > sure...regardless i'm not entirely too sure where to stick the particular > code in my .map file (shown below). I have bolded the code that I'm trying to incorporate into the .map file but not sure why it's not working. Thanks Mark > > # Map file created from QGIS project file > C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs > # Edit this file to customize for your map interface > # (Created with PyQgis MapServer Export plugin) > MAP > NAME "QGIS-MAP" > # Map image size > SIZE 500 500 > UNITS meters > EXTENT -240 -90 310 400 > FONTSET "/wwwroot/fonts/fontset.txt" > SYMBOLSET "/wwwroot/symbols/symbols.sty" > PROJECTION > "proj=lcc" > "ellps=GRS80" > "lat_0=49" > "lon_0=-95" > "lat_1=49" > "lat_2=77" > "datum=NAD83" > "units=m" > "no_defs" > END > # Background color for the map canvas -- change as desired &g
Re: [mapserver-users] query creation issues
Straight item tags like that ARE case sensitive. Try [item name="name"] and [item name="type"] instead. From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 1:33 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Unfortunately that didn't work! But I did manage to get the ID chracteristic outputted as I forgot to include that previously. As when I went to edit the query.html page it shows this ID Name Type 1275 [name] [type] Here is the code that is causing issues for me... [shpidx] [name] [type] While this is the code for the header... Layer: Major Roads ID Name Type As what i'm trying to do is get the name (name of road outputted) and the type (either expressway or major road) Thanks, Mark From: steve.l...@state.mn.us<mailto:steve.l...@state.mn.us> To: mmirrl...@hotmail.com<mailto:mmirrl...@hotmail.com>; mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:22:29 + You need to refer to the attributes next... [NAME][TYPE] Steve From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 12:16 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark > From: steve.l...@state.mn.us<mailto:steve.l...@state.mn.us> > To: mmirrl...@hotmail.com<mailto:mmirrl...@hotmail.com>; > mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: > mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org> > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/expressways from the > map. I'm pretty sure I have created the headers and footers correctly but not > sure...regardless i'm not entirely too sure where to stick the particular > code in my .map file (shown below). I have bolded the code that I'm trying to > incorporate into the .map file but not sure why it's not working. Thanks Mark > > # Map file created from QGIS project file > C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs > # Edit this file to customize for your map interface > # (Created with PyQg
Re: [mapserver-users] query creation issues
On 3/20/2013 2:32 PM, Mark Mirrlees wrote: Hi Steve, Unfortunately that didn't work! But I did manage to get the ID chracteristic outputted as I forgot to include that previously. As when I went to edit the query.html page it shows this ID NameType 1275 [name] [type] Here is the code that is causing issues for me... [shpidx] [name] [type] Attribute binding is case sensitive. For shapefiles it should be UPPERCASE and for postgis it should be lowercase. Also, you tags are not nested correctly, you have a tr nested inside a tr. :-O -Steve W While this is the code for the header... Layer: Major Roads ID Name Type As what i'm trying to do is get the name (name of road outputted) and the type (either expressway or major road) Thanks, Mark From: steve.l...@state.mn.us To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:22:29 + You need to refer to the attributes next… [NAME][TYPE] Steve *From:*Mark Mirrlees [mailto:mmirrl...@hotmail.com] *Sent:* Wednesday, March 20, 2013 12:16 PM *To:* Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org *Subject:* RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... *Name* *Type* Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark From: steve.l...@state.mn.us <mailto:steve.l...@state.mn.us> To:mmirrl...@hotmail.com <mailto:mmirrl...@hotmail.com>; mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org> Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 17:00:47 + Hi Mark: Personally I'd steer you to the simplified query templates as described here: http://mapserver.org/development/rfc/ms-rfc-36.html This allows you to put everything in one place and better separates data from presentation. No more header/footer's. Plus you can have multiple presentations for the same layer. That said, the mapfile below doesn't have any queryable layers. There is no TEMPLATE defined for the one layer that is present. If you want to use the new style templating you'd do something like this: 1- Define an output format: OUTPUTFORMAT NAME 'my-template' DRIVER 'TEMPLATE' MIMETYPE 'text/html; subtype=compass' FORMATOPTION "FILE=templates/my-template.html" END 2- Optionally make it the default query format (otherwise you need to use qformat CGI parameter): WEB QUERYFORMAT 'my-template' ... END 3- Make layers queryable by adding something like: TEMPLATE 'void' 4- Write your template, for example my-template.html might look like: --- snip --- This is my template: [resultset layer="mjrroads"] [feature]Type: [TYPE][/feature] [/resultset] Done presenting layers. --- snip --- Steve From:mapserver-users-boun...@lists.osgeo.org <mailto:mapserver-users-boun...@lists.osgeo.org> [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees Sent: Wednesday, March 20, 2013 10:45 AM To:mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org> Subject: [mapserver-users] query creation issues Hello everyone, I'm trying to create a query so I can query the roads/expressways from the map. I'm pretty sure I have created the headers and footers correctly but not sure...regardless i'm not entirely too sure where to stick the particular code in my .map file (shown below). I have bolded the code that I'm trying to incorporate into the .map file but not sure why it's not working. Thanks Mark # Map file created from QGIS project file C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs # Edit this file to customize for your map interface # (Created with PyQgis MapServer Export plugin) MAP NAME "QGIS-MAP" # Map image size SIZE 500 500 UNITS meters EXTENT -240 -90 310 400 FONTSET "/wwwroot/fonts/fontset.txt" SYMBOLSET "/wwwroot/symbols/symbols.sty" PROJECTION "proj=lcc" "ellps=GRS80" "lat_0=49" "lon_0=-95" "lat_1=49" "lat_2=77" "datum=NAD83" "units=m" "no_defs" END # Background color for the map canvas -- change as desired IMAGEC
Re: [mapserver-users] query creation issues
Hi there, Ok I managed to get this outputted...but under the [name] and [type] I need to get these fields populated from the query of the mjrroads... IDNameType1164[name][type] Code from mjrroadsquery.html [shpidx] [name] [type] Now if I change the [name] to [map] in the mjrroadsquery.html I get the following... ID Name Type 1164 /wwwroot/M_Mirrlees_Assign3/global.map [type] Code from mjrroads.html Layer: Major Roads ID Name Type All i'm trying to do is get the Name and Type fields to be showing the name of the road, and the type of the road. Thanks,Mark From: steve.l...@state.mn.us To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:41:52 + Straight item tags like that ARE case sensitive. Try [item name=”name”] and [item name=”type”] instead. From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 1:33 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Unfortunately that didn't work! But I did manage to get the ID chracteristic outputted as I forgot to include that previously. As when I went to edit the query.html page it shows this ID Name Type 1275 [name] [type] Here is the code that is causing issues for me... [shpidx] [name] [type] While this is the code for the header... Layer: Major Roads ID Name Type As what i'm trying to do is get the name (name of road outputted) and the type (either expressway or major road) Thanks, Mark From: steve.l...@state.mn.us To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:22:29 + You need to refer to the attributes next… [NAME][TYPE] Steve From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 12:16 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark > From: steve.l...@state.mn.us > To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/express
Re: [mapserver-users] query creation issues
Does anyone have any updates on how to fix this? As I mentioned before I managed to get the ID field populated whenever I query the map but I need to get the same thing for the name of the road and the type of road... If there is anything else that you require please let me know as this is causing a great deal of confusion why it won't work! Thanks,Mark From: mmirrl...@hotmail.com To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Date: Wed, 20 Mar 2013 14:53:57 -0400 Subject: Re: [mapserver-users] query creation issues Hi there, Ok I managed to get this outputted...but under the [name] and [type] I need to get these fields populated from the query of the mjrroads... IDNameType1164[name][type] Code from mjrroadsquery.html [shpidx] [name] [type] Now if I change the [name] to [map] in the mjrroadsquery.html I get the following... ID Name Type 1164 /wwwroot/M_Mirrlees_Assign3/global.map [type] Code from mjrroads.html Layer: Major Roads ID Name Type All i'm trying to do is get the Name and Type fields to be showing the name of the road, and the type of the road. Thanks,Mark ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query creation issues
Did you see this in Steve's email: > layer=mjrroads&shapeindex=[shpidx]&shpext=[shpext_esc]&mapext=shape&ma > p=[map]">--> > > [shpidx] > [name] > [type] > Attribute binding is case sensitive. For shapefiles it should be UPPERCASE and for postgis it should be lowercase. Also, you tags are not nested correctly, you have a tr nested inside a tr. :-O -Steve W Your data comes from shapefiles. You need to put "name" and "type" in upper case. [NAME] [TYPE] Worth _ From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees Sent: Wednesday, March 20, 2013 3:47 PM To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] query creation issues Does anyone have any updates on how to fix this? As I mentioned before I managed to get the ID field populated whenever I query the map but I need to get the same thing for the name of the road and the type of road... If there is anything else that you require please let me know as this is causing a great deal of confusion why it won't work! Thanks, Mark _ From: mmirrl...@hotmail.com To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Date: Wed, 20 Mar 2013 14:53:57 -0400 Subject: Re: [mapserver-users] query creation issues Hi there, Ok I managed to get this outputted...but under the [name] and [type] I need to get these fields populated from the query of the mjrroads... ID Name Type 1164 [name] [type] Code from mjrroadsquery.html [shpidx] [name] [type] Now if I change the [name] to [map] in the mjrroadsquery.html I get the following... ID Name Type 1164 /wwwroot/M_Mirrlees_Assign3/global.map [type] Code from mjrroads.html Layer: Major Roads ID Name Type All i'm trying to do is get the Name and Type fields to be showing the name of the road, and the type of the road. Thanks, Mark _ No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.2904 / Virus Database: 2641/6189 - Release Date: 03/19/13 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query creation issues
Hi there I guess I misread that! Thanks for everyone's help! As everything is working the way is needed! Mark Sent from my BlackBerry® powered by Virgin Mobile. -Original Message- From: Worth Lutz Date: Wed, 20 Mar 2013 20:13:52 To: ; Subject: RE: [mapserver-users] query creation issues Did you see this in Steve's email: > layer=mjrroads&shapeindex=[shpidx]&shpext=[shpext_esc]&mapext=shape&ma > p=[map]">--> > > [shpidx] > [name] > [type] > Attribute binding is case sensitive. For shapefiles it should be UPPERCASE and for postgis it should be lowercase. Also, you tags are not nested correctly, you have a tr nested inside a tr. :-O -Steve W Your data comes from shapefiles. You need to put "name" and "type" in upper case. [NAME] [TYPE] Worth From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees Sent: Wednesday, March 20, 2013 3:47 PM To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] query creation issues Does anyone have any updates on how to fix this? As I mentioned before I managed to get the ID field populated whenever I query the map but I need to get the same thing for the name of the road and the type of road... If there is anything else that you require please let me know as this is causing a great deal of confusion why it won't work! Thanks, Mark From: mmirrl...@hotmail.com To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Date: Wed, 20 Mar 2013 14:53:57 -0400 Subject: Re: [mapserver-users] query creation issues Hi there, Ok I managed to get this outputted...but under the [name] and [type] I need to get these fields populated from the query of the mjrroads... ID Name Type 1164 [name] [type] Code from mjrroadsquery.html [shpidx] [name] [type] Now if I change the [name] to [map] in the mjrroadsquery.html I get the following... ID Name Type 1164 /wwwroot/M_Mirrlees_Assign3/global.map [type] Code from mjrroads.html Layer: Major Roads ID Name Type All i'm trying to do is get the Name and Type fields to be showing the name of the road, and the type of the road. Thanks, Mark No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2013.0.2904 / Virus Database: 2641/6189 - Release Date: 03/19/13 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users