[mapserver-users] Bad BBOX passed to db query

Fawcett, David (MNIT) David.Fawcett at state.mn.us
Tue Sep 24 10:18:30 PDT 2013


Notice that your Map projection is 4326, but that your Map units are set to meters.  

I am guessing that this is your problem.

The map units and the units that the map extent are expressed in have to match your map projection/srs.

David.

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jack Walters
Sent: Tuesday, September 24, 2013 11:17 AM
To: Lime, Steve D (MNIT); mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Bad BBOX passed to db query

Before Update:
___________________________
MAP
     EXTENT -138 40 -110 60
     SIZE 500 500
     UNITS meters
     FONTSET "/var/www/gtc/html/current/mapping/maps/_fonts/fonts.lst"

     WEB
         METADATA
             "wms_title" "Zonar Web Mapping"
             "wms_srs" "epsg:4326 epsg:99999 epsg:4269"
             "tile_map_edge_buffer" "256" # 16 pixel rendering buffer
             "tile_metatile_level" "2" # metatile 2 levels up (4:1 = 1024px metatile)
         END #METADATA
     END #WEB

     TRANSPARENT true

     PROJECTION
         "init=epsg:4326"
     END #PROJECTION

     OUTPUTFORMAT
         NAME png
         DRIVER AGG/PNG
         IMAGEMODE RGB
         MIMETYPE "image/png"
     END

     ###############################################################
     #  SYMBOLS
     ###############################################################

     SYMBOL
         NAME "misc_circle"
         TYPE ellipse
         FILLED true
         POINTS
             1 1
         END
     END
     SYMBOL
         NAME "triangle_circle"
         TYPE ellipse
         FILLED true
         POINTS
             1 1
         END
     END
     SYMBOL
         NAME "triangle_arrow"
         TYPE vector
         FILLED true
         POINTS
             0 -3
             3 6
             0 4
             -3 6
             0 -3
         END
     END

     ###############################################################
     #  LAYERS
     ###############################################################
     LAYER
         NAME "loi_names"

         DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"
         CONNECTIONTYPE postgis
         CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"

         TYPE ANNOTATION
         STATUS OFF
         PROJECTION
             "init=epsg:4326"
         END #PROJECTION
         METADATA
             "wms_title" "loi_names"
         END #METADATA

         LABELITEM "name"

         CLASS
             LABEL
                 EXPRESSION ([area] >= 70)
                 MINSCALEDENOM 36978669.43  # Z#3
                 MAXSCALEDENOM 295829355.45 # Z#23+
                 BUFFER 10
                 FONT VeraBi
                 SIZE 8
                 TYPE truetype
                 WRAP "/"
                 COLOR [rgb_color]
                 OUTLINEWIDTH 2
                 OUTLINECOLOR 210 210 210
                 MINFEATURESIZE 60
             END #LABEL
         END #CLASS
         CLASS
             LABEL
                 EXPRESSION ([area] >= 0.4)
                 MINSCALEDENOM 9244667.36 # Z#23+
                 MAXSCALEDENOM 36978669.43 # Z#3
                 BUFFER 10
                 FONT VeraBi
                 SIZE 8
                 TYPE truetype
                 WRAP "/"
                 COLOR [rgb_color]
                 OUTLINEWIDTH 2
                 OUTLINECOLOR 210 210 210
                 MINFEATURESIZE 60
             END #LABEL
         END #CLASS
         CLASS
             LABEL
                 MINSCALEDENOM 0 # Z#23+
                 MAXSCALEDENOM 9244667.36 # Z#6
                 BUFFER 10
                 FONT VeraBi
                 SIZE 10
                 TYPE truetype
                 WRAP "/"
                 COLOR [rgb_color]
                 OUTLINEWIDTH 2
                 OUTLINECOLOR 210 210 210
                 MINFEATURESIZE 60
             END #LABEL
         END #CLASS
     END #LAYER


     LAYER
         NAME "loi_polys"
         DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"
         CONNECTIONTYPE postgis
         CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"

         TYPE polygon
         STATUS OFF
         PROJECTION
             "init=epsg:4326"
         END #PROJECTION
         METADATA
             "wms_title" "Locations of Interest polys"
             "wms_timeextent" "2000-01-01/2100-01-01"
             "wms_timeitem" "ts"
         END #METADATA

         LABELITEM "name"

         CLASS
             STYLE
                 OUTLINECOLOR [rgb_color]
             END #STYLE
         END #CLASS
     END #LAYER

     LAYER
         NAME "loi_lines"
         DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"
         CONNECTIONTYPE postgis
         CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"

         TYPE line
         STATUS OFF
         PROJECTION
             "init=epsg:4326"
         END #PROJECTION
         METADATA
             "wms_title" "Locations of Interest lines"
             "wms_timeextent" "2000-01-01/2100-01-01"
             "wms_timeitem" "ts"
         END #METADATA

         LABELITEM "name"
         CLASS
             STYLE
                 COLOR [rgb_color]
             END #STYLE
         END #CLASS
     END #LAYER
END #MAP
______________________________________

After Update:
______________________________________
MAP
     EXTENT -138 40 -110 60
     SIZE 500 500
     UNITS meters
     FONTSET "/var/www/gtc/html/current/mapping/maps/_fonts/fonts.lst"

     WEB
         METADATA
             "wms_title" "Zonar Web Mapping"
             "wms_srs" "epsg:4326 epsg:99999 epsg:4269"
             "tile_map_edge_buffer" "256" # 16 pixel rendering buffer
             "tile_metatile_level" "2" # metatile 2 levels up (4:1 = 1024px metatile)
         END #METADATA
     END #WEB

     TRANSPARENT true

     PROJECTION
         AUTO
     END #PROJECTION

     OUTPUTFORMAT
         NAME png
         DRIVER AGG/PNG
         IMAGEMODE RGB
         MIMETYPE "image/png"
     END

     ###############################################################
     #  SYMBOLS
     ###############################################################

     SYMBOL
         NAME "misc_circle"
         TYPE ellipse
         FILLED true
         POINTS
             1 1
         END
     END
     SYMBOL
         NAME "triangle_circle"
         TYPE ellipse
         FILLED true
         POINTS
             1 1
         END
     END
     SYMBOL
         NAME "triangle_arrow"
         TYPE vector
         FILLED true
         POINTS
             0 -3
             3 6
             0 4
             -3 6
             0 -3
         END
     END

     ###############################################################
     #  LAYERS
     ###############################################################
     LAYER
         NAME "loi_names"
         STATUS OFF
         TYPE POINT

         CONNECTIONTYPE postgis
         CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"
         PROCESSING "CLOSE_CONNECTION=DEFER"

         DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"

         METADATA
             "wms_title" "loi_names"
         END #METADATA

         LABELITEM "name"

         CLASS
             LABEL
                 EXPRESSION ([area] >= 70)
                 MINSCALEDENOM 36978669.43  # Z#3
                 MAXSCALEDENOM 295829355.45 # Z#23+
                 BUFFER 10
                 FONT VeraBi
                 SIZE 8
                 TYPE truetype
                 WRAP "/"
                 COLOR [rgb_color]
                 OUTLINEWIDTH 2
                 OUTLINECOLOR 210 210 210
                 MINFEATURESIZE 60
             END #LABEL
             LABEL
                 EXPRESSION ([area] >= 0.4)
                 MINSCALEDENOM 9244667.36 # Z#23+
                 MAXSCALEDENOM 36978669.43 # Z#3
                 BUFFER 10
                 FONT VeraBi
                 SIZE 8
                 TYPE truetype
                 WRAP "/"
                 COLOR [rgb_color]
                 OUTLINEWIDTH 2
                 OUTLINECOLOR 210 210 210
                 MINFEATURESIZE 60
             END #LABEL
             LABEL
                 MINSCALEDENOM 0 # Z#23+
                 MAXSCALEDENOM 9244667.36 # Z#6
                 BUFFER 10
                 FONT VeraBi
                 SIZE 10
                 TYPE truetype
                 WRAP "/"
                 COLOR [rgb_color]
                 OUTLINEWIDTH 2
                 OUTLINECOLOR 210 210 210
                 MINFEATURESIZE 60
             END #LABEL
         END #CLASS
     END #LAYER
     LAYER
         NAME "loi_polys"
         DEBUG 1
         STATUS OFF
         TYPE POLYGON

         CONNECTIONTYPE postgis
         CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"
         PROCESSING "CLOSE_CONNECTION=DEFER"

         DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"

         LABELITEM "name"
         METADATA
             "wms_title" "loi_polys"
         END #METADATA

         CLASS
             STYLE
                 OUTLINECOLOR [rgb_color]
             END #STYLE
         END #CLASS
     END #LAYER
     LAYER
         NAME "loi_lines"
         STATUS OFF
         TYPE LINE

         CONNECTIONTYPE postgis
         CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"
         PROCESSING "CLOSE_CONNECTION=DEFER"

         DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"

         LABELITEM "name"
         METADATA
             "wms_title" "loi_lines"
         END #METADATA

         CLASS
             STYLE
                 COLOR [rgb_color]
             END #STYLE
         END #CLASS
     END #LAYER
END #MAP
______________________________

Hope that helps.

Thanks,
Jack Walters
Web Development Engineer III
Zonar Systems


Confidentiality Notice: This e-mail may contain proprietary information some of which may be legally privileged. It is for the intended recipient(s) only. If you believe that it has been sent to you in error, please notify the sender by reply e-mail and delete the message. Any disclosure, copying, distribution or use of this information by someone other than the intended recipient(s) is prohibited and may be unlawful.
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users





More information about the MapServer-users mailing list